From ce33b4045764f841c10072923de4f3cc3feb6770 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Tue, 4 Jun 2019 21:53:39 +0200 Subject: [PATCH 01/15] fix(@aws-cdk/aws-events-targets): event-rules cannot have targets with the same construct id. --- .../@aws-cdk/aws-events-targets/lib/lambda.ts | 2 +- .../test/lambda/integ.events.expected.json | 219 ++++++++---------- 2 files changed, 94 insertions(+), 127 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts index d4e4b88d4fabc..81082c6278cba 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts @@ -39,7 +39,7 @@ export class LambdaFunction implements events.IRuleTarget { } return { - id: this.handler.node.id, + id: this.handler.node.uniqueId, arn: this.handler.functionArn, input: this.props.event, }; diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json index 9e2df8005f1c4..702ab948e4dcc 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json @@ -1,138 +1,105 @@ { - "Resources": { - "MyFuncServiceRole54065130": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": { - "Fn::Join": [ - "", - [ - "lambda.", - { - "Ref": "AWS::URLSuffix" - } + "Resources": { + "MyFuncServiceRole54065130": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [{ + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::Join": [ + "", [ + "lambda.", + { + "Ref": "AWS::URLSuffix" + } + ] + ] + } + } + }], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [{ + "Fn::Join": [ + "", [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] ] - ] - } - } + }] } - ], - "Version": "2012-10-17" }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" + "MyFunc8A243A2C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "MyFunc8A243A2C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "ZipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": ["MyFuncServiceRole54065130", "Arn"] + }, + "Runtime": "nodejs8.10" + }, + "DependsOn": ["MyFuncServiceRole54065130"] }, - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "MyFuncServiceRole54065130", - "Arn" - ] + "MyFuncAllowEventRulelambdaeventsTimer0E6AB6D8E3B334A3": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": ["TimerBF6F831F", "Arn"] + } + } }, - "Runtime": "nodejs8.10" - }, - "DependsOn": [ - "MyFuncServiceRole54065130" - ] - }, - "MyFuncAllowEventRulelambdaeventsTimer0E6AB6D8E3B334A3": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "MyFunc8A243A2C", - "Arn" - ] + "MyFuncAllowEventRulelambdaeventsTimer27F866A1E0669C645": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": ["Timer2B6F162E9", "Arn"] + } + } }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "TimerBF6F831F", - "Arn" - ] - } - } - }, - "MyFuncAllowEventRulelambdaeventsTimer27F866A1E0669C645": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "MyFunc8A243A2C", - "Arn" - ] + "TimerBF6F831F": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(1 minute)", + "State": "ENABLED", + "Targets": [{ + "Arn": { + "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] + }, + "Id": "lambdaeventsMyFunc910E580F" + }] + } }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "Timer2B6F162E9", - "Arn" - ] + "Timer2B6F162E9": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(2 minutes)", + "State": "ENABLED", + "Targets": [{ + "Arn": { + "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] + }, + "Id": "lambdaeventsMyFunc910E580F" + }] + } } - } - }, - "TimerBF6F831F": { - "Type": "AWS::Events::Rule", - "Properties": { - "ScheduleExpression": "rate(1 minute)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "MyFunc8A243A2C", - "Arn" - ] - }, - "Id": "MyFunc" - } - ] - } - }, - "Timer2B6F162E9": { - "Type": "AWS::Events::Rule", - "Properties": { - "ScheduleExpression": "rate(2 minutes)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "MyFunc8A243A2C", - "Arn" - ] - }, - "Id": "MyFunc" - } - ] - } } - } } \ No newline at end of file From 58a6cbcdb6d4c5263dc800abfa955d9a0b171729 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Thu, 6 Jun 2019 20:23:36 +0200 Subject: [PATCH 02/15] fix uniqueId dimension to 64 chars --- packages/@aws-cdk/aws-events-targets/lib/lambda.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts index 81082c6278cba..1f14b66bcb2b6 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts @@ -37,9 +37,10 @@ export class LambdaFunction implements events.IRuleTarget { sourceArn: rule.ruleArn }); } + const id = this.handler.node.uniqueId; return { - id: this.handler.node.uniqueId, + id: id.substring(Math.max(id.length - 64, 0), id.length), arn: this.handler.functionArn, input: this.props.event, }; From 5fd1465edf0c5a4e5ee31be81b563c130ca38023 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Thu, 6 Jun 2019 21:47:07 +0200 Subject: [PATCH 03/15] fix integ.instance.lit.expected.json (got from Travis): local build does not work --- packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json index fa1f1d4ac9f2d..f09b306ce7a43 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json @@ -884,7 +884,7 @@ "Arn" ] }, - "Id": "Function" + "Id": "awscdkrdsinstanceFunctionD515EE19" } ] } From c3785463a071783dd54f0b095352226cf27acbcb Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Fri, 7 Jun 2019 11:43:47 +0200 Subject: [PATCH 04/15] move uniqueId cut inside aws-events/lib/rule.ts. change in uniqueId in events target --- packages/@aws-cdk/aws-events-targets/lib/codebuild.ts | 2 +- packages/@aws-cdk/aws-events-targets/lib/codepipeline.ts | 2 +- packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts | 2 +- packages/@aws-cdk/aws-events-targets/lib/lambda.ts | 3 +-- packages/@aws-cdk/aws-events-targets/lib/sns.ts | 2 +- packages/@aws-cdk/aws-events-targets/lib/sqs.ts | 2 +- packages/@aws-cdk/aws-events-targets/lib/state-machine.ts | 2 +- packages/@aws-cdk/aws-events/lib/rule.ts | 4 +++- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/lib/codebuild.ts b/packages/@aws-cdk/aws-events-targets/lib/codebuild.ts index be60e79d1db03..d5e80498801ac 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/codebuild.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/codebuild.ts @@ -15,7 +15,7 @@ export class CodeBuildProject implements events.IRuleTarget { */ public bind(_rule: events.IRule): events.RuleTargetConfig { return { - id: this.project.node.id, + id: this.project.node.uniqueId, arn: this.project.projectArn, role: singletonEventRole(this.project, [new iam.PolicyStatement() .addAction('codebuild:StartBuild') diff --git a/packages/@aws-cdk/aws-events-targets/lib/codepipeline.ts b/packages/@aws-cdk/aws-events-targets/lib/codepipeline.ts index 10df105a3987b..ac41ea9662d53 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/codepipeline.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/codepipeline.ts @@ -12,7 +12,7 @@ export class CodePipeline implements events.IRuleTarget { public bind(_rule: events.IRule): events.RuleTargetConfig { return { - id: this.pipeline.node.id, + id: this.pipeline.node.uniqueId, arn: this.pipeline.pipelineArn, role: singletonEventRole(this.pipeline, [new iam.PolicyStatement() .addResource(this.pipeline.pipelineArn) diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index b2e8205725698..fb144a8b7dd4a 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -99,7 +99,7 @@ export class EcsTask implements events.IRuleTarget { .addResource(this.taskDefinition.taskRole.roleArn)); } - const id = this.taskDefinition.node.id + '-on-' + this.cluster.node.id; + const id = this.taskDefinition.node.uniqueId + '-on-' + this.cluster.node.uniqueId; const arn = this.cluster.clusterArn; const role = singletonEventRole(this.taskDefinition, policyStatements); const containerOverrides = this.props.containerOverrides && this.props.containerOverrides diff --git a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts index 14ea14aa1cd07..7f3cbb1fa3b0e 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts @@ -37,10 +37,9 @@ export class LambdaFunction implements events.IRuleTarget { sourceArn: rule.ruleArn }); } - const id = this.handler.node.uniqueId; return { - id: id.substring(Math.max(id.length - 64, 0), id.length), + id: this.handler.node.uniqueId, arn: this.handler.functionArn, input: this.props.event, }; diff --git a/packages/@aws-cdk/aws-events-targets/lib/sns.ts b/packages/@aws-cdk/aws-events-targets/lib/sns.ts index 829ea7392c21e..395c1fe2121e2 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/sns.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/sns.ts @@ -39,7 +39,7 @@ export class SnsTopic implements events.IRuleTarget { this.topic.grantPublish(new iam.ServicePrincipal('events.amazonaws.com')); return { - id: this.topic.node.id, + id: this.topic.node.uniqueId, arn: this.topic.topicArn, input: this.props.message, }; diff --git a/packages/@aws-cdk/aws-events-targets/lib/sqs.ts b/packages/@aws-cdk/aws-events-targets/lib/sqs.ts index 25ea2310e9067..0c97cc05b3ed1 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/sqs.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/sqs.ts @@ -59,7 +59,7 @@ export class SqsQueue implements events.IRuleTarget { ); const result = { - id: this.queue.node.id, + id: this.queue.node.uniqueId, arn: this.queue.queueArn, input: this.props.message, }; diff --git a/packages/@aws-cdk/aws-events-targets/lib/state-machine.ts b/packages/@aws-cdk/aws-events-targets/lib/state-machine.ts index 9e79811ff1ea5..60453326213f2 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/state-machine.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/state-machine.ts @@ -29,7 +29,7 @@ export class SfnStateMachine implements events.IRuleTarget { */ public bind(_rule: events.IRule): events.RuleTargetConfig { return { - id: this.machine.node.id, + id: this.machine.node.uniqueId, arn: this.machine.stateMachineArn, role: singletonEventRole(this.machine, [new iam.PolicyStatement() .addAction('states:StartExecution') diff --git a/packages/@aws-cdk/aws-events/lib/rule.ts b/packages/@aws-cdk/aws-events/lib/rule.ts index 152657993cee0..7110e370fbcef 100644 --- a/packages/@aws-cdk/aws-events/lib/rule.ts +++ b/packages/@aws-cdk/aws-events/lib/rule.ts @@ -230,5 +230,7 @@ export class Rule extends Resource implements IRule { * Result must match regex [\.\-_A-Za-z0-9]+ */ function sanitizeId(id: string) { - return id.replace(/[^\.\-_A-Za-z0-9]/g, '-'); + const _id = id.replace(/[^\.\-_A-Za-z0-9]/g, '-'); + // cut to 64 chars to respect AWS::Events::Rule Target Id field specification + return _id.substring(Math.max(_id.length - 64, 0), _id.length); } \ No newline at end of file From bdc8c3c261890097ebf11246454186f7dd5b4ab0 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Fri, 7 Jun 2019 11:56:53 +0200 Subject: [PATCH 05/15] fix integration tests after uniqueId migration. --- .../test/codebuild/integ.project-events.expected.json | 8 ++++---- .../integ.pipeline-event-target.expected.json | 2 +- .../test/ecs/integ.event-ec2-task.lit.expected.json | 2 +- .../test/ecs/integ.event-fargate-task.expected.json | 10 +++++----- .../test/sns/integ.sns-event-rule-target.expected.json | 2 +- .../test/sqs/integ.sqs-event-rule-target.expected.json | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json index 04a6e3740851e..403dc199d6dfb 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json @@ -44,7 +44,7 @@ "Arn" ] }, - "Id": "MyProject", + "Id": "awscdkcodebuildeventsMyProjectEF919B0E", "RoleArn": { "Fn::GetAtt": [ "MyProjectEventsRole5B7D93F5", @@ -56,7 +56,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic", + "Id": "awscdkcodebuildeventsMyTopic550011DC", "InputTransformer": { "InputPathsMap": { "f1": "$.detail.repositoryName", @@ -284,7 +284,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic" + "Id": "awscdkcodebuildeventsMyTopic550011DC" } ] } @@ -313,7 +313,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic", + "Id": "awscdkcodebuildeventsMyTopic550011DC", "InputTransformer": { "InputPathsMap": { "f1": "$.detail.completed-phase" diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json index 5c4b2bf89391c..4954e716263ff 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json @@ -365,7 +365,7 @@ ] ] }, - "Id": "Pipeline", + "Id": "pipelineeventsPipelineD8DD4529", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", 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 c9f77ff04f967..8dee7e2c8bcfb 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 @@ -1052,7 +1052,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "TaskDef-on-EcsCluster", + "Id": "wsecsintegecsTaskDef8DD0C801-on-awsecsintegecsEcsCluster028757CF", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ 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 efe8c37519fa8..f0dd0d3afc8fc 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 @@ -609,7 +609,7 @@ "Arn" ] }, - "Id": "TaskDef-on-EcsCluster", + "Id": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -645,7 +645,7 @@ } ] }, - "physicalResourceId": "TaskDef-on-EcsCluster" + "physicalResourceId": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB" }, "Update": { "service": "CloudWatchEvents", @@ -686,7 +686,7 @@ "Arn" ] }, - "Id": "TaskDef-on-EcsCluster", + "Id": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -722,7 +722,7 @@ } ] }, - "physicalResourceId": "TaskDef-on-EcsCluster" + "physicalResourceId": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB" } } }, @@ -933,7 +933,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "TaskDef-on-EcsCluster", + "Id": "egfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json index e7113875c4cea..2c8279ffca762 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json @@ -49,7 +49,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic" + "Id": "awscdksnseventtargetMyTopicB7575CD8" } ] } diff --git a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json index cf16e28d07764..37c1084afe974 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json @@ -13,7 +13,7 @@ "Arn" ] }, - "Id": "MyQueue" + "Id": "awscdksqseventtargetMyQueueF7EBF3AE" } ] } From f099eb0a45a11205c16d00945f7fde3b8f0c17cd Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Fri, 7 Jun 2019 15:56:30 +0200 Subject: [PATCH 06/15] change uniqueId for ecs-task target rule. fix integration tests --- .../test/integ.rule.lit.expected.json | 2 +- .../aws-events-targets/lib/ecs-task.ts | 2 +- .../test/ecs/event-rule-target.test.ts | 29 +++++++++++++++++-- .../integ.event-ec2-task.lit.expected.json | 2 +- .../integ.event-fargate-task.expected.json | 10 +++---- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/packages/@aws-cdk/aws-config/test/integ.rule.lit.expected.json b/packages/@aws-cdk/aws-config/test/integ.rule.lit.expected.json index eff352b6a34f1..86cb180ebc9e3 100644 --- a/packages/@aws-cdk/aws-config/test/integ.rule.lit.expected.json +++ b/packages/@aws-cdk/aws-config/test/integ.rule.lit.expected.json @@ -206,7 +206,7 @@ "Arn": { "Ref": "ComplianceTopic0229448B" }, - "Id": "ComplianceTopic" + "Id": "awscdkconfigruleintegComplianceTopic55CAF01A" } ] } diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index fb144a8b7dd4a..08e457ca380ae 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -99,7 +99,7 @@ export class EcsTask implements events.IRuleTarget { .addResource(this.taskDefinition.taskRole.roleArn)); } - const id = this.taskDefinition.node.uniqueId + '-on-' + this.cluster.node.uniqueId; + const id = this.taskDefinition.node.uniqueId; const arn = this.cluster.clusterArn; const role = singletonEventRole(this.taskDefinition, policyStatements); const containerOverrides = this.props.containerOverrides && this.props.containerOverrides diff --git a/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts b/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts index 01a2fb6c707a2..c7a713236218b 100644 --- a/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts @@ -50,7 +50,8 @@ test("Can use EC2 taskdef as EventRule target", () => { }, InputTemplate: "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"command\":[\"echo\",]}]}" }, - RoleArn: { "Fn::GetAtt": ["TaskDefEventsRoleFB3B67B8", "Arn"] } + RoleArn: { "Fn::GetAtt": ["TaskDefEventsRoleFB3B67B8", "Arn"] }, + Id: taskDefinition.node.uniqueId } ] }); @@ -123,7 +124,7 @@ test("Can use Fargate taskdef as EventRule target", () => { "Arn" ] }, - Id: "TaskDef-on-EcsCluster", + Id: taskDefinition.node.uniqueId, EcsParameters: { TaskDefinitionArn: { Ref: "TaskDef54694570" @@ -159,7 +160,29 @@ test("Can use Fargate taskdef as EventRule target", () => { } ] }, - physicalResourceId: "TaskDef-on-EcsCluster" + physicalResourceId: taskDefinition.node.uniqueId } }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Events::Rule', { + Targets: [ + { + Arn: { "Fn::GetAtt": ["EcsCluster97242B84", "Arn"] }, + EcsParameters: { + TaskCount: 1, + TaskDefinitionArn: { Ref: "TaskDef54694570" } + }, + InputTransformer: { + InputPathsMap: { + f1: "$.detail.event" + }, + InputTemplate: "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"command\":[\"echo\",]}]}" + }, + RoleArn: { "Fn::GetAtt": ["TaskDefEventsRoleFB3B67B8", "Arn"] }, + Id: taskDefinition.node.uniqueId + } + ] + }); + }); 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 8dee7e2c8bcfb..1551e3074a660 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 @@ -1052,7 +1052,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "wsecsintegecsTaskDef8DD0C801-on-awsecsintegecsEcsCluster028757CF", + "Id": "awsecsintegecsTaskDef8DD0C801", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ 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 f0dd0d3afc8fc..f1582b411a944 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 @@ -609,7 +609,7 @@ "Arn" ] }, - "Id": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB", + "Id": "awsecsintegfargateTaskDef8878AF94", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -645,7 +645,7 @@ } ] }, - "physicalResourceId": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB" + "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" }, "Update": { "service": "CloudWatchEvents", @@ -686,7 +686,7 @@ "Arn" ] }, - "Id": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB", + "Id": "awsecsintegfargateTaskDef8878AF94", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -722,7 +722,7 @@ } ] }, - "physicalResourceId": "awsecsintegfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB" + "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" } } }, @@ -933,7 +933,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "egfargateTaskDef8878AF94-on-awsecsintegfargateEcsCluster46E816CB", + "Id": "awsecsintegfargateTaskDef8878AF94", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ From 0f4a4c088b81ae491d734a45d652b975bb87f96e Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Mon, 10 Jun 2019 20:59:57 +0200 Subject: [PATCH 07/15] fix integration test in aws-codepipeline-actions/test/ --- ...g.lambda-deployed-through-codepipeline.lit.expected.json | 4 ++-- .../test/integ.lambda-pipeline.expected.json | 2 +- ...ipeline-code-build-multiple-inputs-outputs.expected.json | 2 +- .../test/integ.pipeline-code-commit.expected.json | 2 +- .../test/integ.pipeline-ecr-source.expected.json | 2 +- .../test/integ.pipeline-events.expected.json | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json index caed1d048c69b..3b06b11c31882 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json @@ -682,7 +682,7 @@ "Id": "Pipeline", "RoleArn": { "Fn::GetAtt": [ - "PipelineEventsRole46BEEA7C", + "PipelineStackPipeline9DB740AF", "Arn" ] } @@ -751,7 +751,7 @@ ] ] }, - "Id": "Pipeline", + "Id": "PipelineStackPipeline9DB740AF", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json index 6878eb270286e..8503cc4ad4a51 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json @@ -444,7 +444,7 @@ ] ] }, - "Id": "Pipeline", + "Id": "awscdkcodepipelinelambdaPipeline87A4B3D3", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json index 8959ea6c3fd74..e5da37a432750 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json @@ -61,7 +61,7 @@ ] ] }, - "Id": "Pipeline", + "Id": "awscdkcodepipelinecodebuildmultipleinputsoutputsPipeline314D3A85", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json index 8e3dae70f0b26..3f81805f2d38f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json @@ -61,7 +61,7 @@ ] ] }, - "Id": "Pipeline", + "Id": "awscdkcodepipelinecodecommitPipelineF780CA18", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json index f7d21ee67d544..130f3c920aebb 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json @@ -277,7 +277,7 @@ ] ] }, - "Id": "MyPipeline", + "Id": "awscdkcodepipelineecrsourceMyPipeline63CF3194", "RoleArn": { "Fn::GetAtt": [ "MyPipelineEventsRoleFAB99F32", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json index 387568106ab8d..a4e1ab7b4d435 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json @@ -374,7 +374,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic" + "Id": "awscdkpipelineeventtargetMyTopic8D32776A" } ] } @@ -426,7 +426,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic" + "Id": "awscdkpipelineeventtargetMyTopic8D32776A" } ] } @@ -473,7 +473,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic", + "Id": "awscdkpipelineeventtargetMyTopic8D32776A", "InputTransformer": { "InputPathsMap": { "f1": "$.detail.pipeline", From 7dd818bb56d288e73bdc62a96e321184e2514419 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Mon, 10 Jun 2019 22:15:05 +0200 Subject: [PATCH 08/15] fix tests in packages/@aws-cdk/aws-ecs-patterns/test/ --- .../test/ec2/integ.scheduled-ecs-task.lit.expected.json | 2 +- .../aws-ecs-patterns/test/ec2/test.scheduled-ecs-task.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json index 8087e2fd4413c..8233c2eb9aa18 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json @@ -810,7 +810,7 @@ "Ref": "ScheduledEc2TaskScheduledTaskDef56328BA4" } }, - "Id": "ScheduledTaskDef-on-EcsCluster", + "Id": "awsecsintegecsScheduledEc2TaskScheduledTaskDef18FB4348", "Input": "{}", "RoleArn": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.scheduled-ecs-task.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.scheduled-ecs-task.ts index ce3827278080a..9ba2198d421d6 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.scheduled-ecs-task.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.scheduled-ecs-task.ts @@ -31,7 +31,7 @@ export = { TaskCount: 1, TaskDefinitionArn: { Ref: "ScheduledEc2TaskScheduledTaskDef56328BA4" } }, - Id: "ScheduledTaskDef-on-EcsCluster", + Id: "ScheduledEc2TaskScheduledTaskDef1EA607E3", Input: "{}", RoleArn: { "Fn::GetAtt": ["ScheduledEc2TaskScheduledTaskDefEventsRole64113C5F", "Arn"] } } @@ -97,7 +97,7 @@ export = { TaskCount: 2, TaskDefinitionArn: { Ref: "ScheduledEc2TaskScheduledTaskDef56328BA4" } }, - Id: "ScheduledTaskDef-on-EcsCluster", + Id: "ScheduledEc2TaskScheduledTaskDef1EA607E3", Input: "{}", RoleArn: { "Fn::GetAtt": ["ScheduledEc2TaskScheduledTaskDefEventsRole64113C5F", "Arn"] } } From 532c02e28b11826f0046d94b4d725f9579d6e9d2 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Mon, 10 Jun 2019 23:06:33 +0200 Subject: [PATCH 09/15] fix test in packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json --- ...teg.lambda-deployed-through-codepipeline.lit.expected.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json index 3b06b11c31882..bb1f382803b72 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json @@ -679,10 +679,10 @@ ] ] }, - "Id": "Pipeline", + "Id": "PipelineStackPipeline9DB740AF", "RoleArn": { "Fn::GetAtt": [ - "PipelineStackPipeline9DB740AF", + "PipelineEventsRole46BEEA7C", "Arn" ] } From c27e874148b5c91dc5169ecc0ebd325c377252a2 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Tue, 11 Jun 2019 11:10:47 +0200 Subject: [PATCH 10/15] fix codepipeline actions tests. wip --- .../aws-autoscaling/lib/scheduled-action.ts | 2 +- ...yed-through-codepipeline.lit.expected.json | 4 +- .../test/integ.lambda-pipeline.expected.json | 2 +- ...uild-multiple-inputs-outputs.expected.json | 2 +- .../integ.pipeline-code-commit.expected.json | 2 +- .../integ.pipeline-event-target.expected.json | 50 +++++++++---------- .../integ.pipeline-event-target.ts | 2 +- .../test/__snapshots__/synth.test.js.snap | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts b/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts index a447fa61ebbc0..24274dc1a0380 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts @@ -1,4 +1,4 @@ -import { Construct, Resource } from '@aws-cdk/cdk'; +import { Construct, Resource } from './node_modules/@aws-cdk/cdk'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScheduledAction } from './autoscaling.generated'; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json index bb1f382803b72..62e5d3dd609dd 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json @@ -679,7 +679,7 @@ ] ] }, - "Id": "PipelineStackPipeline9DB740AF", + "Id": "pipelinePipeline22F2A91D", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", @@ -751,7 +751,7 @@ ] ] }, - "Id": "PipelineStackPipeline9DB740AF", + "Id": "pipelinePipeline22F2A91D", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json index 8503cc4ad4a51..907c4c0ae27f1 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json @@ -444,7 +444,7 @@ ] ] }, - "Id": "awscdkcodepipelinelambdaPipeline87A4B3D3", + "Id": "pipelinePipeline22F2A91D", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json index e5da37a432750..23503d5012ec0 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json @@ -61,7 +61,7 @@ ] ] }, - "Id": "awscdkcodepipelinecodebuildmultipleinputsoutputsPipeline314D3A85", + "Id": "pipelinePipeline22F2A91D", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json index 3f81805f2d38f..1a852bd060cc4 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json @@ -61,7 +61,7 @@ ] ] }, - "Id": "awscdkcodepipelinecodecommitPipelineF780CA18", + "Id": "pipelinePipeline22F2A91D", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json index 4954e716263ff..e99a13854f285 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json @@ -7,7 +7,7 @@ "Triggers": [] } }, - "PipelineArtifactsBucketEncryptionKey01D58D69": { + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2": { "Type": "AWS::KMS::Key", "Properties": { "KeyPolicy": { @@ -60,7 +60,7 @@ "Principal": { "AWS": { "Fn::GetAtt": [ - "PipelineRoleD68726F7", + "pipelinePipeline22F2A91DRole58B7B05E", "Arn" ] } @@ -73,7 +73,7 @@ }, "DeletionPolicy": "Retain" }, - "PipelineArtifactsBucket22248F97": { + "pipelinePipeline22F2A91DArtifactsBucketC1799DCD": { "Type": "AWS::S3::Bucket", "Properties": { "BucketEncryption": { @@ -82,7 +82,7 @@ "ServerSideEncryptionByDefault": { "KMSMasterKeyID": { "Fn::GetAtt": [ - "PipelineArtifactsBucketEncryptionKey01D58D69", + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", "Arn" ] }, @@ -94,7 +94,7 @@ }, "DeletionPolicy": "Retain" }, - "PipelineRoleD68726F7": { + "pipelinePipeline22F2A91DRole58B7B05E": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -121,7 +121,7 @@ } } }, - "PipelineRoleDefaultPolicyC7A05455": { + "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -139,7 +139,7 @@ "Resource": [ { "Fn::GetAtt": [ - "PipelineArtifactsBucket22248F97", + "pipelinePipeline22F2A91DArtifactsBucketC1799DCD", "Arn" ] }, @@ -149,7 +149,7 @@ [ { "Fn::GetAtt": [ - "PipelineArtifactsBucket22248F97", + "pipelinePipeline22F2A91DArtifactsBucketC1799DCD", "Arn" ] }, @@ -170,7 +170,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "PipelineArtifactsBucketEncryptionKey01D58D69", + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", "Arn" ] } @@ -178,20 +178,20 @@ ], "Version": "2012-10-17" }, - "PolicyName": "PipelineRoleDefaultPolicyC7A05455", + "PolicyName": "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19", "Roles": [ { - "Ref": "PipelineRoleD68726F7" + "Ref": "pipelinePipeline22F2A91DRole58B7B05E" } ] } }, - "PipelineC660917D": { + "pipelinePipeline22F2A91DEB5D089B": { "Type": "AWS::CodePipeline::Pipeline", "Properties": { "RoleArn": { "Fn::GetAtt": [ - "PipelineRoleD68726F7", + "pipelinePipeline22F2A91DRole58B7B05E", "Arn" ] }, @@ -248,24 +248,24 @@ "EncryptionKey": { "Id": { "Fn::GetAtt": [ - "PipelineArtifactsBucketEncryptionKey01D58D69", + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", "Arn" ] }, "Type": "KMS" }, "Location": { - "Ref": "PipelineArtifactsBucket22248F97" + "Ref": "pipelinePipeline22F2A91DArtifactsBucketC1799DCD" }, "Type": "S3" } }, "DependsOn": [ - "PipelineRoleDefaultPolicyC7A05455", - "PipelineRoleD68726F7" + "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19", + "pipelinePipeline22F2A91DRole58B7B05E" ] }, - "PipelineEventsRole46BEEA7C": { + "pipelinePipeline22F2A91DEventsRole048D7F59": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -292,7 +292,7 @@ } } }, - "PipelineEventsRoleDefaultPolicyFF4FCCE0": { + "pipelinePipeline22F2A91DEventsRoleDefaultPolicyEED1010F": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -318,7 +318,7 @@ }, ":", { - "Ref": "PipelineC660917D" + "Ref": "pipelinePipeline22F2A91DEB5D089B" } ] ] @@ -327,10 +327,10 @@ ], "Version": "2012-10-17" }, - "PolicyName": "PipelineEventsRoleDefaultPolicyFF4FCCE0", + "PolicyName": "pipelinePipeline22F2A91DEventsRoleDefaultPolicyEED1010F", "Roles": [ { - "Ref": "PipelineEventsRole46BEEA7C" + "Ref": "pipelinePipeline22F2A91DEventsRole048D7F59" } ] } @@ -360,15 +360,15 @@ }, ":", { - "Ref": "PipelineC660917D" + "Ref": "pipelinePipeline22F2A91DEB5D089B" } ] ] }, - "Id": "pipelineeventsPipelineD8DD4529", + "Id": "pipelineeventspipelinePipeline22F2A91DFBB66895", "RoleArn": { "Fn::GetAtt": [ - "PipelineEventsRole46BEEA7C", + "pipelinePipeline22F2A91DEventsRole048D7F59", "Arn" ] } diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts index 8ba9c871fccf5..7747288920842 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts @@ -17,7 +17,7 @@ const repo = new codecommit.Repository(stack, 'Repo', { repositoryName: 'TestRepository' }); -const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); +const pipeline = new codepipeline.Pipeline(stack, 'pipelinePipeline22F2A91D'); const srcArtifact = new codepipeline.Artifact('Src'); pipeline.addStage({ diff --git a/packages/decdk/test/__snapshots__/synth.test.js.snap b/packages/decdk/test/__snapshots__/synth.test.js.snap index 4ff4e5d64b382..cc7b17b3ea085 100644 --- a/packages/decdk/test/__snapshots__/synth.test.js.snap +++ b/packages/decdk/test/__snapshots__/synth.test.js.snap @@ -2502,7 +2502,7 @@ Object { ], ], }, - "Id": "Pipeline", + "Id": "pipelinePipeline22F2A91D", "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineEventsRole46BEEA7C", From 475301a55b43e1e4305bb335eb9d90be98c363a3 Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Tue, 11 Jun 2019 18:29:14 +0200 Subject: [PATCH 11/15] fix integration tests accordingly --- .../integ.project-events.expected.json | 132 +++++------ .../integ.pipeline-event-target.expected.json | 50 ++-- .../integ.event-ec2-task.lit.expected.json | 148 ++++++------ .../integ.event-fargate-task.expected.json | 10 +- .../test/lambda/integ.events.expected.json | 219 ++++++++++-------- .../integ.sns-event-rule-target.expected.json | 2 +- .../integ.sqs-event-rule-target.expected.json | 4 +- 7 files changed, 299 insertions(+), 266 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json index f1b7e15ffa52f..8748eaf36baa6 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json @@ -44,7 +44,7 @@ "Arn" ] }, - "Id": "awscdkcodebuildeventsMyProjectEF919B0E", + "Id": "MyProject", "RoleArn": { "Fn::GetAtt": [ "MyProjectEventsRole5B7D93F5", @@ -56,7 +56,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "awscdkcodebuildeventsMyTopic550011DC", + "Id": "MyTopic", "InputTransformer": { "InputPathsMap": { "detail-repositoryName": "$.detail.repositoryName", @@ -68,59 +68,6 @@ ] } }, - "MyProjectEventsRole5B7D93F5": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": { - "Fn::Join": [ - "", - [ - "events.", - { - "Ref": "AWS::URLSuffix" - } - ] - ] - } - } - } - ], - "Version": "2012-10-17" - } - } - }, - "MyProjectEventsRoleDefaultPolicy397DCBF8": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "MyProject39F7B0AE", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "MyProjectEventsRoleDefaultPolicy397DCBF8", - "Roles": [ - { - "Ref": "MyProjectEventsRole5B7D93F5" - } - ] - } - }, "MyProjectRole9BBE5233": { "Type": "AWS::IAM::Role", "Properties": { @@ -267,16 +214,16 @@ "source": [ "aws.codebuild" ], - "detail-type": [ - "CodeBuild Build State Change" - ], "detail": { "project-name": [ { "Ref": "MyProject39F7B0AE" } ] - } + }, + "detail-type": [ + "CodeBuild Build State Change" + ] }, "State": "ENABLED", "Targets": [ @@ -284,7 +231,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "awscdkcodebuildeventsMyTopic550011DC" + "Id": "MyTopic" } ] } @@ -296,16 +243,16 @@ "source": [ "aws.codebuild" ], - "detail-type": [ - "CodeBuild Build Phase Change" - ], "detail": { "project-name": [ { "Ref": "MyProject39F7B0AE" } ] - } + }, + "detail-type": [ + "CodeBuild Build Phase Change" + ] }, "State": "ENABLED", "Targets": [ @@ -313,7 +260,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "awscdkcodebuildeventsMyTopic550011DC", + "Id": "MyTopic", "InputTransformer": { "InputPathsMap": { "detail-completed-phase": "$.detail.completed-phase" @@ -324,6 +271,59 @@ ] } }, + "MyProjectEventsRole5B7D93F5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::Join": [ + "", + [ + "events.", + { + "Ref": "AWS::URLSuffix" + } + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "MyProjectEventsRoleDefaultPolicy397DCBF8": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "MyProject39F7B0AE", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "MyProjectEventsRoleDefaultPolicy397DCBF8", + "Roles": [ + { + "Ref": "MyProjectEventsRole5B7D93F5" + } + ] + } + }, "MyQueueE6CA6235": { "Type": "AWS::SQS::Queue" }, @@ -417,4 +417,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json index e99a13854f285..5c4b2bf89391c 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json @@ -7,7 +7,7 @@ "Triggers": [] } }, - "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2": { + "PipelineArtifactsBucketEncryptionKey01D58D69": { "Type": "AWS::KMS::Key", "Properties": { "KeyPolicy": { @@ -60,7 +60,7 @@ "Principal": { "AWS": { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DRole58B7B05E", + "PipelineRoleD68726F7", "Arn" ] } @@ -73,7 +73,7 @@ }, "DeletionPolicy": "Retain" }, - "pipelinePipeline22F2A91DArtifactsBucketC1799DCD": { + "PipelineArtifactsBucket22248F97": { "Type": "AWS::S3::Bucket", "Properties": { "BucketEncryption": { @@ -82,7 +82,7 @@ "ServerSideEncryptionByDefault": { "KMSMasterKeyID": { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", + "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn" ] }, @@ -94,7 +94,7 @@ }, "DeletionPolicy": "Retain" }, - "pipelinePipeline22F2A91DRole58B7B05E": { + "PipelineRoleD68726F7": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -121,7 +121,7 @@ } } }, - "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19": { + "PipelineRoleDefaultPolicyC7A05455": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -139,7 +139,7 @@ "Resource": [ { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DArtifactsBucketC1799DCD", + "PipelineArtifactsBucket22248F97", "Arn" ] }, @@ -149,7 +149,7 @@ [ { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DArtifactsBucketC1799DCD", + "PipelineArtifactsBucket22248F97", "Arn" ] }, @@ -170,7 +170,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", + "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn" ] } @@ -178,20 +178,20 @@ ], "Version": "2012-10-17" }, - "PolicyName": "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19", + "PolicyName": "PipelineRoleDefaultPolicyC7A05455", "Roles": [ { - "Ref": "pipelinePipeline22F2A91DRole58B7B05E" + "Ref": "PipelineRoleD68726F7" } ] } }, - "pipelinePipeline22F2A91DEB5D089B": { + "PipelineC660917D": { "Type": "AWS::CodePipeline::Pipeline", "Properties": { "RoleArn": { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DRole58B7B05E", + "PipelineRoleD68726F7", "Arn" ] }, @@ -248,24 +248,24 @@ "EncryptionKey": { "Id": { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", + "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn" ] }, "Type": "KMS" }, "Location": { - "Ref": "pipelinePipeline22F2A91DArtifactsBucketC1799DCD" + "Ref": "PipelineArtifactsBucket22248F97" }, "Type": "S3" } }, "DependsOn": [ - "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19", - "pipelinePipeline22F2A91DRole58B7B05E" + "PipelineRoleDefaultPolicyC7A05455", + "PipelineRoleD68726F7" ] }, - "pipelinePipeline22F2A91DEventsRole048D7F59": { + "PipelineEventsRole46BEEA7C": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -292,7 +292,7 @@ } } }, - "pipelinePipeline22F2A91DEventsRoleDefaultPolicyEED1010F": { + "PipelineEventsRoleDefaultPolicyFF4FCCE0": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -318,7 +318,7 @@ }, ":", { - "Ref": "pipelinePipeline22F2A91DEB5D089B" + "Ref": "PipelineC660917D" } ] ] @@ -327,10 +327,10 @@ ], "Version": "2012-10-17" }, - "PolicyName": "pipelinePipeline22F2A91DEventsRoleDefaultPolicyEED1010F", + "PolicyName": "PipelineEventsRoleDefaultPolicyFF4FCCE0", "Roles": [ { - "Ref": "pipelinePipeline22F2A91DEventsRole048D7F59" + "Ref": "PipelineEventsRole46BEEA7C" } ] } @@ -360,15 +360,15 @@ }, ":", { - "Ref": "pipelinePipeline22F2A91DEB5D089B" + "Ref": "PipelineC660917D" } ] ] }, - "Id": "pipelineeventspipelinePipeline22F2A91DFBB66895", + "Id": "Pipeline", "RoleArn": { "Fn::GetAtt": [ - "pipelinePipeline22F2A91DEventsRole048D7F59", + "PipelineEventsRole46BEEA7C", "Arn" ] } 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 1551e3074a660..89ed874307235 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 @@ -352,9 +352,6 @@ } } }, - "EcsClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicACD2D4A4": { - "Type": "AWS::SNS::Topic" - }, "EcsClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole94543EDA": { "Type": "AWS::IAM::Role", "Properties": { @@ -551,6 +548,9 @@ ] } }, + "EcsClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicACD2D4A4": { + "Type": "AWS::SNS::Topic" + }, "EcsClusterDefaultAutoScalingGroupLifecycleHookDrainHookFFA63029": { "Type": "AWS::AutoScaling::LifecycleHook", "Properties": { @@ -845,6 +845,76 @@ ] } }, + "TaskDefEventsRoleFB3B67B8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::Join": [ + "", + [ + "events.", + { + "Ref": "AWS::URLSuffix" + } + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TaskDefEventsRoleDefaultPolicyA124E85B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecs:RunTask", + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "EcsCluster97242B84", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": { + "Ref": "TaskDef54694570" + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "TaskDefExecutionRoleB4775C97", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TaskDefEventsRoleDefaultPolicyA124E85B", + "Roles": [ + { + "Ref": "TaskDefEventsRoleFB3B67B8" + } + ] + } + }, "EventImageAdoptRepositoryDFAAC242": { "Type": "Custom::ECRAdoptedRepository", "Properties": { @@ -1052,7 +1122,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "awsecsintegecsTaskDef8DD0C801", + "Id": "TaskDef-on-EcsCluster", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ @@ -1063,76 +1133,6 @@ } ] } - }, - "TaskDefEventsRoleFB3B67B8": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": { - "Fn::Join": [ - "", - [ - "events.", - { - "Ref": "AWS::URLSuffix" - } - ] - ] - } - } - } - ], - "Version": "2012-10-17" - } - } - }, - "TaskDefEventsRoleDefaultPolicyA124E85B": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ecs:RunTask", - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "EcsCluster97242B84", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": { - "Ref": "TaskDef54694570" - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "TaskDefExecutionRoleB4775C97", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "TaskDefEventsRoleDefaultPolicyA124E85B", - "Roles": [ - { - "Ref": "TaskDefEventsRoleFB3B67B8" - } - ] - } } }, "Parameters": { 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 f1582b411a944..efe8c37519fa8 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 @@ -609,7 +609,7 @@ "Arn" ] }, - "Id": "awsecsintegfargateTaskDef8878AF94", + "Id": "TaskDef-on-EcsCluster", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -645,7 +645,7 @@ } ] }, - "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" + "physicalResourceId": "TaskDef-on-EcsCluster" }, "Update": { "service": "CloudWatchEvents", @@ -686,7 +686,7 @@ "Arn" ] }, - "Id": "awsecsintegfargateTaskDef8878AF94", + "Id": "TaskDef-on-EcsCluster", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -722,7 +722,7 @@ } ] }, - "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" + "physicalResourceId": "TaskDef-on-EcsCluster" } } }, @@ -933,7 +933,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "awsecsintegfargateTaskDef8878AF94", + "Id": "TaskDef-on-EcsCluster", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json index 702ab948e4dcc..9e2df8005f1c4 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json @@ -1,105 +1,138 @@ { - "Resources": { - "MyFuncServiceRole54065130": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [{ - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": { - "Fn::Join": [ - "", [ - "lambda.", - { - "Ref": "AWS::URLSuffix" - } - ] - ] - } - } - }], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [{ - "Fn::Join": [ - "", [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] + "Resources": { + "MyFuncServiceRole54065130": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::Join": [ + "", + [ + "lambda.", + { + "Ref": "AWS::URLSuffix" + } ] - }] + ] + } + } } + ], + "Version": "2012-10-17" }, - "MyFunc8A243A2C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "ZipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" }, - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": ["MyFuncServiceRole54065130", "Arn"] - }, - "Runtime": "nodejs8.10" - }, - "DependsOn": ["MyFuncServiceRole54065130"] + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "MyFunc8A243A2C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" }, - "MyFuncAllowEventRulelambdaeventsTimer0E6AB6D8E3B334A3": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": ["TimerBF6F831F", "Arn"] - } - } + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "MyFuncServiceRole54065130", + "Arn" + ] }, - "MyFuncAllowEventRulelambdaeventsTimer27F866A1E0669C645": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": ["Timer2B6F162E9", "Arn"] - } - } + "Runtime": "nodejs8.10" + }, + "DependsOn": [ + "MyFuncServiceRole54065130" + ] + }, + "MyFuncAllowEventRulelambdaeventsTimer0E6AB6D8E3B334A3": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] }, - "TimerBF6F831F": { - "Type": "AWS::Events::Rule", - "Properties": { - "ScheduleExpression": "rate(1 minute)", - "State": "ENABLED", - "Targets": [{ - "Arn": { - "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] - }, - "Id": "lambdaeventsMyFunc910E580F" - }] - } + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "TimerBF6F831F", + "Arn" + ] + } + } + }, + "MyFuncAllowEventRulelambdaeventsTimer27F866A1E0669C645": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] }, - "Timer2B6F162E9": { - "Type": "AWS::Events::Rule", - "Properties": { - "ScheduleExpression": "rate(2 minutes)", - "State": "ENABLED", - "Targets": [{ - "Arn": { - "Fn::GetAtt": ["MyFunc8A243A2C", "Arn"] - }, - "Id": "lambdaeventsMyFunc910E580F" - }] - } + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "Timer2B6F162E9", + "Arn" + ] } + } + }, + "TimerBF6F831F": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(1 minute)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "Id": "MyFunc" + } + ] + } + }, + "Timer2B6F162E9": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(2 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "Id": "MyFunc" + } + ] + } } + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json index 2c8279ffca762..e7113875c4cea 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json @@ -49,7 +49,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "awscdksnseventtargetMyTopicB7575CD8" + "Id": "MyTopic" } ] } diff --git a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json index 4fad7eb0d987d..db63b390de3d0 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json @@ -13,7 +13,7 @@ "Arn" ] }, - "Id": "awscdksqseventtargetMyQueueF7EBF3AE" + "Id": "MyQueue" } ] } @@ -74,4 +74,4 @@ } } } -} +} \ No newline at end of file From 19953e7f7d4f43836d8e5b422715b50d0e4b798e Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 12 Jun 2019 11:10:49 +0200 Subject: [PATCH 12/15] Fix import --- packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts b/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts index 24274dc1a0380..a447fa61ebbc0 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts @@ -1,4 +1,4 @@ -import { Construct, Resource } from './node_modules/@aws-cdk/cdk'; +import { Construct, Resource } from '@aws-cdk/cdk'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScheduledAction } from './autoscaling.generated'; From f3e3aaaca2fa6c6459b57236296d22b848320c08 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 13 Jun 2019 12:10:48 +0200 Subject: [PATCH 13/15] Update some expectations --- .../integ.project-events.expected.json | 8 +-- .../integ.pipeline-event-target.expected.json | 50 +++++++++---------- .../test/ecs/event-rule-target.test.ts | 4 +- .../integ.event-ec2-task.lit.expected.json | 2 +- .../integ.event-fargate-task.expected.json | 10 ++-- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json index 8748eaf36baa6..924e12491e703 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json @@ -44,7 +44,7 @@ "Arn" ] }, - "Id": "MyProject", + "Id": "awscdkcodebuildeventsMyProjectEF919B0E", "RoleArn": { "Fn::GetAtt": [ "MyProjectEventsRole5B7D93F5", @@ -56,7 +56,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic", + "Id": "awscdkcodebuildeventsMyTopic550011DC", "InputTransformer": { "InputPathsMap": { "detail-repositoryName": "$.detail.repositoryName", @@ -231,7 +231,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic" + "Id": "awscdkcodebuildeventsMyTopic550011DC" } ] } @@ -260,7 +260,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic", + "Id": "awscdkcodebuildeventsMyTopic550011DC", "InputTransformer": { "InputPathsMap": { "detail-completed-phase": "$.detail.completed-phase" diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json index 5c4b2bf89391c..e99a13854f285 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json @@ -7,7 +7,7 @@ "Triggers": [] } }, - "PipelineArtifactsBucketEncryptionKey01D58D69": { + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2": { "Type": "AWS::KMS::Key", "Properties": { "KeyPolicy": { @@ -60,7 +60,7 @@ "Principal": { "AWS": { "Fn::GetAtt": [ - "PipelineRoleD68726F7", + "pipelinePipeline22F2A91DRole58B7B05E", "Arn" ] } @@ -73,7 +73,7 @@ }, "DeletionPolicy": "Retain" }, - "PipelineArtifactsBucket22248F97": { + "pipelinePipeline22F2A91DArtifactsBucketC1799DCD": { "Type": "AWS::S3::Bucket", "Properties": { "BucketEncryption": { @@ -82,7 +82,7 @@ "ServerSideEncryptionByDefault": { "KMSMasterKeyID": { "Fn::GetAtt": [ - "PipelineArtifactsBucketEncryptionKey01D58D69", + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", "Arn" ] }, @@ -94,7 +94,7 @@ }, "DeletionPolicy": "Retain" }, - "PipelineRoleD68726F7": { + "pipelinePipeline22F2A91DRole58B7B05E": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -121,7 +121,7 @@ } } }, - "PipelineRoleDefaultPolicyC7A05455": { + "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -139,7 +139,7 @@ "Resource": [ { "Fn::GetAtt": [ - "PipelineArtifactsBucket22248F97", + "pipelinePipeline22F2A91DArtifactsBucketC1799DCD", "Arn" ] }, @@ -149,7 +149,7 @@ [ { "Fn::GetAtt": [ - "PipelineArtifactsBucket22248F97", + "pipelinePipeline22F2A91DArtifactsBucketC1799DCD", "Arn" ] }, @@ -170,7 +170,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "PipelineArtifactsBucketEncryptionKey01D58D69", + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", "Arn" ] } @@ -178,20 +178,20 @@ ], "Version": "2012-10-17" }, - "PolicyName": "PipelineRoleDefaultPolicyC7A05455", + "PolicyName": "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19", "Roles": [ { - "Ref": "PipelineRoleD68726F7" + "Ref": "pipelinePipeline22F2A91DRole58B7B05E" } ] } }, - "PipelineC660917D": { + "pipelinePipeline22F2A91DEB5D089B": { "Type": "AWS::CodePipeline::Pipeline", "Properties": { "RoleArn": { "Fn::GetAtt": [ - "PipelineRoleD68726F7", + "pipelinePipeline22F2A91DRole58B7B05E", "Arn" ] }, @@ -248,24 +248,24 @@ "EncryptionKey": { "Id": { "Fn::GetAtt": [ - "PipelineArtifactsBucketEncryptionKey01D58D69", + "pipelinePipeline22F2A91DArtifactsBucketEncryptionKey87C796D2", "Arn" ] }, "Type": "KMS" }, "Location": { - "Ref": "PipelineArtifactsBucket22248F97" + "Ref": "pipelinePipeline22F2A91DArtifactsBucketC1799DCD" }, "Type": "S3" } }, "DependsOn": [ - "PipelineRoleDefaultPolicyC7A05455", - "PipelineRoleD68726F7" + "pipelinePipeline22F2A91DRoleDefaultPolicyCDEE9D19", + "pipelinePipeline22F2A91DRole58B7B05E" ] }, - "PipelineEventsRole46BEEA7C": { + "pipelinePipeline22F2A91DEventsRole048D7F59": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -292,7 +292,7 @@ } } }, - "PipelineEventsRoleDefaultPolicyFF4FCCE0": { + "pipelinePipeline22F2A91DEventsRoleDefaultPolicyEED1010F": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -318,7 +318,7 @@ }, ":", { - "Ref": "PipelineC660917D" + "Ref": "pipelinePipeline22F2A91DEB5D089B" } ] ] @@ -327,10 +327,10 @@ ], "Version": "2012-10-17" }, - "PolicyName": "PipelineEventsRoleDefaultPolicyFF4FCCE0", + "PolicyName": "pipelinePipeline22F2A91DEventsRoleDefaultPolicyEED1010F", "Roles": [ { - "Ref": "PipelineEventsRole46BEEA7C" + "Ref": "pipelinePipeline22F2A91DEventsRole048D7F59" } ] } @@ -360,15 +360,15 @@ }, ":", { - "Ref": "PipelineC660917D" + "Ref": "pipelinePipeline22F2A91DEB5D089B" } ] ] }, - "Id": "Pipeline", + "Id": "pipelineeventspipelinePipeline22F2A91DFBB66895", "RoleArn": { "Fn::GetAtt": [ - "PipelineEventsRole46BEEA7C", + "pipelinePipeline22F2A91DEventsRole048D7F59", "Arn" ] } diff --git a/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts b/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts index 9885b68dcfbfd..e26094f0354f8 100644 --- a/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts @@ -175,9 +175,9 @@ test("Can use Fargate taskdef as EventRule target", () => { }, InputTransformer: { InputPathsMap: { - f1: "$.detail.event" + "detail-event": "$.detail.event" }, - InputTemplate: "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"command\":[\"echo\",]}]}" + InputTemplate: "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"command\":[\"echo\",]}]}" }, RoleArn: { "Fn::GetAtt": ["TaskDefEventsRoleFB3B67B8", "Arn"] }, Id: taskDefinition.node.uniqueId 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 89ed874307235..6426b7c4089aa 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 @@ -1122,7 +1122,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "TaskDef-on-EcsCluster", + "Id": "awsecsintegecsTaskDef8DD0C801", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ 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 efe8c37519fa8..f1582b411a944 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 @@ -609,7 +609,7 @@ "Arn" ] }, - "Id": "TaskDef-on-EcsCluster", + "Id": "awsecsintegfargateTaskDef8878AF94", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -645,7 +645,7 @@ } ] }, - "physicalResourceId": "TaskDef-on-EcsCluster" + "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" }, "Update": { "service": "CloudWatchEvents", @@ -686,7 +686,7 @@ "Arn" ] }, - "Id": "TaskDef-on-EcsCluster", + "Id": "awsecsintegfargateTaskDef8878AF94", "EcsParameters": { "TaskDefinitionArn": { "Ref": "TaskDef54694570" @@ -722,7 +722,7 @@ } ] }, - "physicalResourceId": "TaskDef-on-EcsCluster" + "physicalResourceId": "awsecsintegfargateTaskDef8878AF94" } } }, @@ -933,7 +933,7 @@ "Ref": "TaskDef54694570" } }, - "Id": "TaskDef-on-EcsCluster", + "Id": "awsecsintegfargateTaskDef8878AF94", "Input": "{\"containerOverrides\":[{\"name\":\"TheContainer\",\"environment\":[{\"name\":\"I_WAS_TRIGGERED\",\"value\":\"From CloudWatch Events\"}]}]}", "RoleArn": { "Fn::GetAtt": [ From d81c9913925f829a04b377eef1df33ff9eadd49f Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Sun, 16 Jun 2019 12:12:33 +0200 Subject: [PATCH 14/15] Update expectations of lambda sns and sqs --- .../aws-events-targets/test/lambda/integ.events.expected.json | 4 ++-- .../test/sns/integ.sns-event-rule-target.expected.json | 2 +- .../test/sqs/integ.sqs-event-rule-target.expected.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json index 9e2df8005f1c4..3d99700f4739d 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json @@ -111,7 +111,7 @@ "Arn" ] }, - "Id": "MyFunc" + "Id": "lambdaeventsMyFunc910E580F" } ] } @@ -129,7 +129,7 @@ "Arn" ] }, - "Id": "MyFunc" + "Id": "lambdaeventsMyFunc910E580F" } ] } diff --git a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json index e7113875c4cea..2c8279ffca762 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json @@ -49,7 +49,7 @@ "Arn": { "Ref": "MyTopic86869434" }, - "Id": "MyTopic" + "Id": "awscdksnseventtargetMyTopicB7575CD8" } ] } diff --git a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json index db63b390de3d0..b56bcd5f6bfe0 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json @@ -13,7 +13,7 @@ "Arn" ] }, - "Id": "MyQueue" + "Id": "awscdksqseventtargetMyQueueF7EBF3AE" } ] } From 981a7d768c6ff89d20cefb1c4f1d2ec9e50139ab Mon Sep 17 00:00:00 2001 From: Matteo Madeddu Date: Sun, 16 Jun 2019 13:35:37 +0200 Subject: [PATCH 15/15] Update expectations in @aws-cdk/aws-codepipeline-actions/ --- ...teg.lambda-deployed-through-codepipeline.lit.expected.json | 4 ++-- .../test/integ.lambda-pipeline.expected.json | 2 +- ....pipeline-code-build-multiple-inputs-outputs.expected.json | 2 +- .../test/integ.pipeline-code-commit.expected.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json index 62e5d3dd609dd..bb1f382803b72 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json @@ -679,7 +679,7 @@ ] ] }, - "Id": "pipelinePipeline22F2A91D", + "Id": "PipelineStackPipeline9DB740AF", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", @@ -751,7 +751,7 @@ ] ] }, - "Id": "pipelinePipeline22F2A91D", + "Id": "PipelineStackPipeline9DB740AF", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json index 907c4c0ae27f1..8503cc4ad4a51 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json @@ -444,7 +444,7 @@ ] ] }, - "Id": "pipelinePipeline22F2A91D", + "Id": "awscdkcodepipelinelambdaPipeline87A4B3D3", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json index 23503d5012ec0..e5da37a432750 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json @@ -61,7 +61,7 @@ ] ] }, - "Id": "pipelinePipeline22F2A91D", + "Id": "awscdkcodepipelinecodebuildmultipleinputsoutputsPipeline314D3A85", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json index 1a852bd060cc4..3f81805f2d38f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json @@ -61,7 +61,7 @@ ] ] }, - "Id": "pipelinePipeline22F2A91D", + "Id": "awscdkcodepipelinecodecommitPipelineF780CA18", "RoleArn": { "Fn::GetAtt": [ "PipelineEventsRole46BEEA7C",