main.tf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #Base RHEL repository used for building XDR RPMs like syslog-ng in CodeBuild
  2. resource "aws_ecr_repository" "codebuild-rhel7" {
  3. name = "codebuild-rhel7"
  4. tags = merge(var.standard_tags, var.tags)
  5. }
  6. #Allow codebuild to access the ECR Repository
  7. resource "aws_ecr_repository_policy" "codebuild-rhel7" {
  8. repository = aws_ecr_repository.codebuild-rhel7.name
  9. policy = <<EOF
  10. {
  11. "Version": "2008-10-17",
  12. "Statement": [
  13. {
  14. "Sid": "new statement",
  15. "Effect": "Allow",
  16. "Principal": {
  17. "Service": "codebuild.amazonaws.com"
  18. },
  19. "Action": [
  20. "ecr:GetDownloadUrlForLayer",
  21. "ecr:BatchGetImage",
  22. "ecr:BatchCheckLayerAvailability"
  23. ]
  24. }
  25. ]
  26. }
  27. EOF
  28. }
  29. # not needed, but leaving the code for possible future use.
  30. # #base centos7 image used for building portal
  31. # resource "aws_ecr_repository" "codebuild-centos7" {
  32. # name = "codebuild-centos7"
  33. # tags = merge(var.standard_tags, var.tags)
  34. # }
  35. # #Allow codebuild to access the ECR Repository
  36. # resource "aws_ecr_repository_policy" "codebuild-centos7" {
  37. # repository = aws_ecr_repository.codebuild-centos7.name
  38. # policy = <<EOF
  39. # {
  40. # "Version": "2008-10-17",
  41. # "Statement": [
  42. # {
  43. # "Sid": "new statement",
  44. # "Effect": "Allow",
  45. # "Principal": {
  46. # "Service": "codebuild.amazonaws.com"
  47. # },
  48. # "Action": [
  49. # "ecr:GetDownloadUrlForLayer",
  50. # "ecr:BatchGetImage",
  51. # "ecr:BatchCheckLayerAvailability"
  52. # ]
  53. # }
  54. # ]
  55. # }
  56. # EOF
  57. # }