Skip to content

Commit

Permalink
🐳 Update JML Report ECR (#9343)
Browse files Browse the repository at this point in the history
Update JML ECR

Signed-off-by: Jacob Woffenden <jacob.woffenden@justice.gov.uk>
  • Loading branch information
jacobwoffenden authored Jan 14, 2025
1 parent 17e4040 commit 1e50be2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
data "aws_iam_policy_document" "analytical_platform_jml_report_ecr_repository" {
statement {
sid = "LambdaECRImageRetrievalPolicy"
effect = "Allow"
actions = [
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer",
"ecr:SetRepositoryPolicy",
"ecr:DeleteRepositoryPolicy",
"ecr:GetRepositoryPolicy"
]
principals {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
condition {
test = "StringLike"
variable = "aws:sourceArn"
values = ["arn:aws:lambda:${data.aws_region.current.name}:${local.environment_management.account_ids["analytical-platform-data-production"]}:function:analytical-platform-jml-report*"]
}
}
}

module "analytical_platform_jml_report_ecr_repository" {
#checkov:skip=CKV_TF_1:Module registry does not support commit hashes for versions
#checkov:skip=CKV_TF_2:Module registry does not support tags for versions

source = "terraform-aws-modules/ecr/aws"
version = "2.3.0"

repository_name = "analytical-platform-jml-report"
repository_policy = data.aws_iam_policy_document.analytical_platform_jml_report_ecr_repository.json
repository_encryption_type = "KMS"
repository_kms_key = module.ecr_kms.key_arn

create_lifecycle_policy = false

tags = local.tags
}
37 changes: 0 additions & 37 deletions terraform/environments/analytical-platform-common/ecr.tf

This file was deleted.

0 comments on commit 1e50be2

Please sign in to comment.