diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json index 815adb808f6c1..656df9bf070f3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json @@ -1,7 +1,7 @@ { - "version": "35.0.0", + "version": "36.0.0", "files": { - "c917d5a2b2e16b9e3cd0679e1dee0539129223bcca595b66788045cc8fc23e20": { + "84b6486701fcb7260af6376837052d1a64c84a9c1c7884dc2bdcb0e9ee7b67fa": { "source": { "path": "SNSInteg.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c917d5a2b2e16b9e3cd0679e1dee0539129223bcca595b66788045cc8fc23e20.json", + "objectKey": "84b6486701fcb7260af6376837052d1a64c84a9c1c7884dc2bdcb0e9ee7b67fa.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json index 69954cad9b6b7..7851e7d2dfca2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json @@ -110,6 +110,59 @@ } ] } + }, + "MyTopic288CE2107": { + "Type": "AWS::SNS::Topic", + "Properties": { + "DisplayName": "fooDisplayName2", + "KmsMasterKeyId": { + "Fn::GetAtt": [ + "CustomKey1E6D0D07", + "Arn" + ] + }, + "TopicName": "fooTopic2" + } + }, + "PublishRoleF42F66B6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "s3.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PublishRoleDefaultPolicy9257B12D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "MyTopic288CE2107" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PublishRoleDefaultPolicy9257B12D", + "Roles": [ + { + "Ref": "PublishRoleF42F66B6" + } + ] + } } }, "Parameters": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out index c5cb2e5de6344..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"35.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json index d9fab2006a00e..72d9cc0b958b9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "35.0.0", + "version": "36.0.0", "testCases": { "integ.sns": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json index 08016c12ab007..184922a5ef9eb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "35.0.0", + "version": "36.0.0", "artifacts": { "SNSInteg.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c917d5a2b2e16b9e3cd0679e1dee0539129223bcca595b66788045cc8fc23e20.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/84b6486701fcb7260af6376837052d1a64c84a9c1c7884dc2bdcb0e9ee7b67fa.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -58,6 +58,24 @@ "data": "Policy23B91518" } ], + "/SNSInteg/MyTopic2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyTopic288CE2107" + } + ], + "/SNSInteg/PublishRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PublishRoleF42F66B6" + } + ], + "/SNSInteg/PublishRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PublishRoleDefaultPolicy9257B12D" + } + ], "/SNSInteg/BootstrapVersion": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json index c7a2a6387aacc..5873d900c6668 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json @@ -205,6 +205,129 @@ "version": "10.3.0" } }, + "MyTopic2": { + "id": "MyTopic2", + "path": "SNSInteg/MyTopic2", + "children": { + "Resource": { + "id": "Resource", + "path": "SNSInteg/MyTopic2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:props": { + "displayName": "fooDisplayName2", + "kmsMasterKeyId": { + "Fn::GetAtt": [ + "CustomKey1E6D0D07", + "Arn" + ] + }, + "topicName": "fooTopic2" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ImportedTopic": { + "id": "ImportedTopic", + "path": "SNSInteg/ImportedTopic", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "PublishRole": { + "id": "PublishRole", + "path": "SNSInteg/PublishRole", + "children": { + "ImportPublishRole": { + "id": "ImportPublishRole", + "path": "SNSInteg/PublishRole/ImportPublishRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "SNSInteg/PublishRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "s3.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "SNSInteg/PublishRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "SNSInteg/PublishRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "MyTopic288CE2107" + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "PublishRoleDefaultPolicy9257B12D", + "roles": [ + { + "Ref": "PublishRoleF42F66B6" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "SNSInteg/BootstrapVersion", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts index 0f52806e7e921..16da1d2e4c822 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts @@ -48,7 +48,7 @@ class SNSInteg extends Stack { }); const importedTopic = Topic.fromTopicArn(this, 'ImportedTopic', topic2.topicArn); - const publishRole = new Role(this, 'FeedbackRole', { + const publishRole = new Role(this, 'PublishRole', { assumedBy: new ServicePrincipal('s3.amazonaws.com'), }); importedTopic.grantPublish(publishRole);