generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update JML ECR Signed-off-by: Jacob Woffenden <jacob.woffenden@justice.gov.uk>
- Loading branch information
1 parent
17e4040
commit 1e50be2
Showing
2 changed files
with
39 additions
and
37 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
terraform/environments/analytical-platform-common/ecr-repositories.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file was deleted.
Oops, something went wrong.