Skip to content

Commit 3113633

Browse files
committed
APM-1598 Point task definition to dev account docker registry
1 parent e14ef82 commit 3113633

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

  • ansible/roles
    • create-api-deployment-pre-reqs/templates/terraform
    • deploy-ecs-proxies/templates/terraform

ansible/roles/create-api-deployment-pre-reqs/templates/terraform/iam.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,15 @@ data "aws_iam_policy_document" "deploy-user" {
286286

287287
}
288288

289+
statement {
290+
actions = [
291+
"ssm:GetParameter",
292+
"ssm:GetParameters",
293+
"ssm:GetParametersByPath",
294+
]
295+
296+
resources = [
297+
"arn:aws:ssm:${local.region}:${local.account_id}:parameter/${var.account}/account-ids/*",
298+
]
299+
}
289300
}

ansible/roles/deploy-ecs-proxies/templates/terraform/locals.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
data "aws_caller_identity" "current" {}
22
data "aws_region" "current" {}
3-
4-
3+
data "aws_ssm_parameter" "ptl_account_id" {
4+
name = "/account-ids/ptl"
5+
}
56

67
locals {
8+
ptl_account_id = data.aws_ssm_parameter.ptl_account_id.value
79
account_id = data.aws_caller_identity.current.account_id
810
region = data.aws_region.current.name
911
env_service_id = "${var.apigee_environment}-${var.service_id}"
@@ -49,7 +51,7 @@ locals {
4951
(
5052
container
5153
| combine(
52-
{'image': '${local.account_id}.dkr.ecr.eu-west-2.amazonaws.com/' + service_id + '_' + container.name + ':' + build_label }
54+
{'image': '${local.ptl_account_id}.dkr.ecr.eu-west-2.amazonaws.com/' + service_id + '_' + container.name + ':' + build_label }
5355
)
5456
) | to_json
5557
}},

0 commit comments

Comments
 (0)