diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.assets.json index 6968282119ceb..106268b0f976a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.assets.json @@ -1,7 +1,7 @@ { "version": "36.0.0", "files": { - "b1390a5f843d7508bec6d19884338f36f34ac9ca5d1b6e1de9d01cf72d46d441": { + "14fdbf9da76c6d2a9fd9d7ecce1e6fb899d1bd67a967d68ab86428209e729203": { "source": { "path": "SNSTopicPolicyStack.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b1390a5f843d7508bec6d19884338f36f34ac9ca5d1b6e1de9d01cf72d46d441.json", + "objectKey": "14fdbf9da76c6d2a9fd9d7ecce1e6fb899d1bd67a967d68ab86428209e729203.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-topic-policy.js.snapshot/SNSTopicPolicyStack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.template.json index d35fe17973ff5..c6af60e302553 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/SNSTopicPolicyStack.template.json @@ -31,9 +31,7 @@ } }, "Effect": "Deny", - "Principal": { - "AWS": "*" - }, + "Principal": "*", "Resource": { "Ref": "TopicBFC7AF6E" }, @@ -80,9 +78,7 @@ } }, "Effect": "Deny", - "Principal": { - "AWS": "*" - }, + "Principal": "*", "Resource": { "Ref": "TopicAddPolicy7DB03706" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/manifest.json index 6081b9fa42f29..1c70ea54b89c0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/manifest.json @@ -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}/b1390a5f843d7508bec6d19884338f36f34ac9ca5d1b6e1de9d01cf72d46d441.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/14fdbf9da76c6d2a9fd9d7ecce1e6fb899d1bd67a967d68ab86428209e729203.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -49,10 +49,7 @@ "/SNSTopicPolicyStack/TopicAddPolicy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TopicAddPolicy7DB03706", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "TopicAddPolicy7DB03706" } ], "/SNSTopicPolicyStack/TopicAddPolicy/Policy/Resource": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/tree.json index 08e55c985c294..f65edb84ed63b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-topic-policy.js.snapshot/tree.json @@ -64,9 +64,7 @@ } }, "Effect": "Deny", - "Principal": { - "AWS": "*" - }, + "Principal": "*", "Resource": { "Ref": "TopicBFC7AF6E" }, @@ -143,9 +141,7 @@ } }, "Effect": "Deny", - "Principal": { - "AWS": "*" - }, + "Principal": "*", "Resource": { "Ref": "TopicAddPolicy7DB03706" }, diff --git a/packages/aws-cdk-lib/aws-sns/lib/policy.ts b/packages/aws-cdk-lib/aws-sns/lib/policy.ts index e60aa5b5d2880..2d663b733fa90 100644 --- a/packages/aws-cdk-lib/aws-sns/lib/policy.ts +++ b/packages/aws-cdk-lib/aws-sns/lib/policy.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CfnTopicPolicy } from './sns.generated'; import { ITopic } from './topic-base'; -import { AnyPrincipal, Effect, PolicyDocument, PolicyStatement } from '../../aws-iam'; +import { Effect, PolicyDocument, PolicyStatement, StarPrincipal } from '../../aws-iam'; import { Resource } from '../../core'; /** @@ -84,7 +84,7 @@ export class TopicPolicy extends Resource { conditions: { Bool: { 'aws:SecureTransport': 'false' }, }, - principals: [new AnyPrincipal()], + principals: [new StarPrincipal()], }); } } diff --git a/packages/aws-cdk-lib/aws-sns/lib/topic-base.ts b/packages/aws-cdk-lib/aws-sns/lib/topic-base.ts index 81f08f5d6ea6b..3f9d042eeca00 100644 --- a/packages/aws-cdk-lib/aws-sns/lib/topic-base.ts +++ b/packages/aws-cdk-lib/aws-sns/lib/topic-base.ts @@ -169,7 +169,7 @@ export abstract class TopicBase extends Resource implements ITopic { conditions: { Bool: { 'aws:SecureTransport': 'false' }, }, - principals: [new iam.AnyPrincipal()], + principals: [new iam.StarPrincipal()], }); } diff --git a/packages/aws-cdk-lib/aws-sns/test/sns.test.ts b/packages/aws-cdk-lib/aws-sns/test/sns.test.ts index 228c3e8d1fde8..25da0e0388f0e 100644 --- a/packages/aws-cdk-lib/aws-sns/test/sns.test.ts +++ b/packages/aws-cdk-lib/aws-sns/test/sns.test.ts @@ -224,7 +224,7 @@ describe('Topic', () => { 'aws:SecureTransport': 'false', }, }, - 'Principal': { 'AWS': '*' }, + 'Principal': '*', }, ], }, @@ -353,7 +353,7 @@ describe('Topic', () => { 'aws:SecureTransport': 'false', }, }, - 'Principal': { 'AWS': '*' }, + 'Principal': '*', }, ], 'Version': '2012-10-17',