diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.docker-asset.lit.expected.json b/packages/@aws-cdk/aws-codebuild/test/integ.docker-asset.lit.expected.json index 6dba932b450c7..b44b47039e9a3 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.docker-asset.lit.expected.json +++ b/packages/@aws-cdk/aws-codebuild/test/integ.docker-asset.lit.expected.json @@ -45,8 +45,8 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17": { "Type": "AWS::IAM::Role", @@ -428,7 +428,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "MyImageAdoptRepository6CA902F6", @@ -469,4 +473,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.ecr.lit.expected.json b/packages/@aws-cdk/aws-codebuild/test/integ.ecr.lit.expected.json index e9a45fa464e2e..bd8809fd97ad4 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.ecr.lit.expected.json +++ b/packages/@aws-cdk/aws-codebuild/test/integ.ecr.lit.expected.json @@ -1,9 +1,8 @@ { "Resources": { "MyRepoF4F48043": { - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain", "Type": "AWS::ECR::Repository", + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, "MyProjectRole9BBE5233": { @@ -170,7 +169,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Ref": "MyRepoF4F48043" }, @@ -195,4 +198,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json index d07defcdb2122..77c4d9b07b13f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json @@ -195,8 +195,8 @@ }, "EcrRepoBB83A592": { "Type": "AWS::ECR::Repository", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "TaskDefTaskRole1EDB4A67": { "Type": "AWS::IAM::Role", @@ -317,8 +317,8 @@ "Status": "Enabled" } }, - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "EcsProjectRoleE2F0E9D2": { "Type": "AWS::IAM::Role", @@ -536,7 +536,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Ref": "EcrRepoBB83A592" } @@ -1071,4 +1075,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.expected.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.expected.json index b84802ba44251..e37940ec0781d 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.expected.json +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.expected.json @@ -45,8 +45,8 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17": { "Type": "AWS::IAM::Role", @@ -299,7 +299,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "DockerImageAdoptRepositoryA86481BC", @@ -325,4 +329,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr/lib/repository.ts b/packages/@aws-cdk/aws-ecr/lib/repository.ts index 643be23a85b07..0db4487a8f436 100644 --- a/packages/@aws-cdk/aws-ecr/lib/repository.ts +++ b/packages/@aws-cdk/aws-ecr/lib/repository.ts @@ -120,8 +120,8 @@ export abstract class RepositoryBase extends Resource implements IRepository { */ public repositoryUriForTag(tag?: string): string { const tagSuffix = tag ? `:${tag}` : ''; - const parts = Stack.of(this).parseArn(this.repositoryArn); - return `${parts.account}.dkr.ecr.${parts.region}.amazonaws.com/${this.repositoryName}${tagSuffix}`; + const parts = this.stack.parseArn(this.repositoryArn); + return `${parts.account}.dkr.ecr.${parts.region}.${this.stack.urlSuffix}/${this.repositoryName}${tagSuffix}`; } /** diff --git a/packages/@aws-cdk/aws-ecr/test/integ.basic.expected.json b/packages/@aws-cdk/aws-ecr/test/integ.basic.expected.json index bc9110222d3c8..08a8e2f9380af 100644 --- a/packages/@aws-cdk/aws-ecr/test/integ.basic.expected.json +++ b/packages/@aws-cdk/aws-ecr/test/integ.basic.expected.json @@ -50,7 +50,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Ref": "Repo02AC86CF" } diff --git a/packages/@aws-cdk/aws-ecr/test/test.repository.ts b/packages/@aws-cdk/aws-ecr/test/test.repository.ts index 58bee57920256..fa15f68818df8 100644 --- a/packages/@aws-cdk/aws-ecr/test/test.repository.ts +++ b/packages/@aws-cdk/aws-ecr/test/test.repository.ts @@ -165,7 +165,9 @@ export = { { 'Fn::Select': [ 4, arnSplit ] }, '.dkr.ecr.', { 'Fn::Select': [ 3, arnSplit ] }, - '.amazonaws.com/', + '.', + { Ref: 'AWS::URLSuffix' }, + '/', { Ref: 'Repo02AC86CF' } ]]}); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json index 51979f83882c8..e2de65df98fb2 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json @@ -346,11 +346,6 @@ "ClusterEB0386A7": { "Type": "AWS::ECS::Cluster" }, - "FargateServiceTaskDefwebLogGroup71FAF541": { - "Type": "AWS::Logs::LogGroup", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" - }, "FargateServiceLBB353E155": { "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", "Properties": { @@ -561,7 +556,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "FargateServiceTaskDefwebAssetImageAdoptRepositoryCDAFD419", @@ -659,8 +658,13 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargateServiceTaskDefwebLogGroup71FAF541": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "FargateServiceTaskDefExecutionRole9194820E": { "Type": "AWS::IAM::Role", @@ -771,6 +775,7 @@ "MinimumHealthyPercent": 50 }, "DesiredCount": 1, + "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", "LoadBalancers": [ { @@ -781,7 +786,6 @@ } } ], - "HealthCheckGracePeriodSeconds": 60, "NetworkConfiguration": { "AwsvpcConfiguration": { "AssignPublicIp": "DISABLED", @@ -1041,4 +1045,4 @@ "Description": "Artifact hash for asset \"aws-ecs-integ/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json index 12533f9a86d5d..e685231b6a121 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json @@ -344,7 +344,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "ScheduledFargateTaskScheduledTaskDefScheduledContainerAssetImageAdoptRepository49B45957", @@ -437,13 +441,13 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "ScheduledFargateTaskScheduledTaskDefScheduledContainerLogGroup4134B16C": { "Type": "AWS::Logs::LogGroup", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "ScheduledFargateTaskScheduledTaskDefExecutionRoleD37356D5": { "Type": "AWS::IAM::Role", @@ -801,8 +805,8 @@ "physicalResourceId": "awsfargateintegScheduledFargateTaskScheduledTaskDefB0AD4F70" } }, - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17": { "Type": "AWS::IAM::Role", @@ -1123,4 +1127,4 @@ "Description": "Artifact hash for asset \"aws-fargate-integ/AWS679f53fac002430cb0da5b7982bd2287/Code\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-ec2-task.lit.expected.json b/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-ec2-task.lit.expected.json index 3575db08986a6..b22e03b1e7723 100644 --- a/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-ec2-task.lit.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-ec2-task.lit.expected.json @@ -446,37 +446,37 @@ "Resource": "*" }, { - "Action": [ - "ecs:ListContainerInstances", - "ecs:SubmitContainerStateChange", - "ecs:SubmitTaskStateChange" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EcsCluster97242B84", - "Arn" - ] + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EcsCluster97242B84", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:UpdateContainerInstancesState", + "ecs:ListTasks" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "EcsCluster97242B84", + "Arn" + ] + } } }, - { - "Action": [ - "ecs:UpdateContainerInstancesState", - "ecs:ListTasks" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "EcsCluster97242B84", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - } + "Effect": "Allow", + "Resource": "*" + } ], "Version": "2012-10-17" }, @@ -740,7 +740,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "TaskDefTheContainerAssetImageAdoptRepository997406C3", @@ -832,13 +836,13 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "TaskDefTheContainerLogGroupD94C8EF5": { "Type": "AWS::Logs::LogGroup", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "TaskDefExecutionRoleB4775C97": { "Type": "AWS::IAM::Role", @@ -1215,4 +1219,4 @@ "Description": "Artifact hash for asset \"aws-ecs-integ-ecs/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json b/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json index f206f22e023e2..c4a85357a7070 100644 --- a/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json @@ -303,7 +303,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "TaskDefTheContainerAssetImageAdoptRepository997406C3", @@ -396,8 +400,13 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TaskDefTheContainerLogGroupD94C8EF5": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "TaskDefExecutionRoleB4775C97": { "Type": "AWS::IAM::Role", @@ -755,13 +764,8 @@ "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" } }, - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" - }, - "TaskDefTheContainerLogGroupD94C8EF5": { - "Type": "AWS::Logs::LogGroup", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17": { "Type": "AWS::IAM::Role", @@ -1113,4 +1117,4 @@ "Description": "Artifact hash for asset \"aws-ecs-integ-fargate/AWS679f53fac002430cb0da5b7982bd2287/Code\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.expected.json index e98a6431c534e..63cbbe67ce751 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.expected.json @@ -524,7 +524,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "TaskDefTheContainerAssetImageAdoptRepository997406C3", @@ -614,13 +618,13 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "TaskDefTheContainerLogGroupD94C8EF5": { "Type": "AWS::Logs::LogGroup", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "TaskDefExecutionRoleB4775C97": { "Type": "AWS::IAM::Role", @@ -996,4 +1000,4 @@ "Description": "Artifact hash for asset \"aws-ecs-integ2/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.fargate-task.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.fargate-task.expected.json index e1a400ded6bea..65e5f44e40c30 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.fargate-task.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.fargate-task.expected.json @@ -97,7 +97,11 @@ } ] }, - ".amazonaws.com/", + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", { "Fn::GetAtt": [ "TaskDefTheContainerAssetImageAdoptRepository997406C3", @@ -189,8 +193,13 @@ "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C", "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17" ], - "DeletionPolicy": "Delete", - "UpdateReplacePolicy": "Delete" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TaskDefTheContainerLogGroupD94C8EF5": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "TaskDefExecutionRoleB4775C97": { "Type": "AWS::IAM::Role", @@ -279,11 +288,6 @@ ] } }, - "TaskDefTheContainerLogGroupD94C8EF5": { - "Type": "AWS::Logs::LogGroup", - "DeletionPolicy": "Retain", - "UpdateReplacePolicy": "Retain" - }, "AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17": { "Type": "AWS::IAM::Role", "Properties": { @@ -589,4 +593,4 @@ "Description": "Artifact hash for asset \"aws-ecs-integ2/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code\"" } } -} +} \ No newline at end of file