diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/lib/index.ts index 0fa56b960..de23dd844 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/lib/index.ts @@ -95,8 +95,10 @@ export class CloudFrontToMediaStore extends Construct { ], Resource: `arn:${Aws.PARTITION}:mediastore:${Aws.REGION}:${Aws.ACCOUNT_ID}:container/${Aws.STACK_NAME}/*`, Condition: { + StringEquals: { + 'aws:UserAgent': this.cloudFrontOriginAccessIdentity.originAccessIdentityName + }, Bool: { - 'aws:UserAgent': this.cloudFrontOriginAccessIdentity.originAccessIdentityName, 'aws:SecureTransport': 'true' } } diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/__snapshots__/cloudfront-mediastore.test.js.snap b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/__snapshots__/cloudfront-mediastore.test.js.snap index ee460ed8a..fb1973c85 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/__snapshots__/cloudfront-mediastore.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/__snapshots__/cloudfront-mediastore.test.js.snap @@ -285,11 +285,11 @@ Object { Object { "Ref": "AWS::StackName", }, - "/*\\",\\"Condition\\":{\\"Bool\\":{\\"aws:UserAgent\\":\\"", + "/*\\",\\"Condition\\":{\\"StringEquals\\":{\\"aws:UserAgent\\":\\"", Object { "Ref": "testcloudfrontmediastoreCloudFrontOriginAccessIdentity966405A0", }, - "\\",\\"aws:SecureTransport\\":\\"true\\"}}}]}", + "\\"},\\"Bool\\":{\\"aws:SecureTransport\\":\\"true\\"}}}]}", ], ], }, diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.default.expected.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.default.expected.json index e0aba7aac..d8f30adfe 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.default.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.default.expected.json @@ -71,11 +71,11 @@ { "Ref": "AWS::StackName" }, - "/*\",\"Condition\":{\"Bool\":{\"aws:UserAgent\":\"", + "/*\",\"Condition\":{\"StringEquals\":{\"aws:UserAgent\":\"", { "Ref": "testcloudfrontmediastoreCloudFrontOriginAccessIdentity966405A0" }, - "\",\"aws:SecureTransport\":\"true\"}}}]}" + "\"},\"Bool\":{\"aws:SecureTransport\":\"true\"}}}]}" ] ] } diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.withoutHttpSecurityHeaders.expected.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.withoutHttpSecurityHeaders.expected.json index ae0a5df0d..b33ab06ff 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.withoutHttpSecurityHeaders.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/test/integ.withoutHttpSecurityHeaders.expected.json @@ -71,11 +71,11 @@ { "Ref": "AWS::StackName" }, - "/*\",\"Condition\":{\"Bool\":{\"aws:UserAgent\":\"", + "/*\",\"Condition\":{\"StringEquals\":{\"aws:UserAgent\":\"", { "Ref": "testcloudfrontmediastoreCloudFrontOriginAccessIdentity966405A0" }, - "\",\"aws:SecureTransport\":\"true\"}}}]}" + "\"},\"Bool\":{\"aws:SecureTransport\":\"true\"}}}]}" ] ] }