From 8852f07e4baed05d16888869de040c98248190c1 Mon Sep 17 00:00:00 2001 From: Ivan Barlog Date: Thu, 7 Nov 2024 20:16:32 +0100 Subject: [PATCH] issue #32018 add integration test and snapshots --- .../cdk.out | 2 +- ...cloudfront-function-url-origin.assets.json | 6 ++-- ...oudfront-function-url-origin.template.json | 19 +++++++++++- .../integ.json | 2 +- .../manifest.json | 12 +++++-- ...efaultTestDeployAssert6BBA15BA.assets.json | 2 +- .../tree.json | 31 +++++++++++++++++-- .../test/integ.function-url-origin.ts | 2 +- 8 files changed, 63 insertions(+), 13 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/cdk.out index 1f0068d32659a..c6e612584e352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.assets.json index a912697d800b4..26164cb0132cc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { - "9a6c172119a86bf65d38c8185c145afbebd67b5e50d54fca1f3c2229b41cdcd0": { + "fd1a6e94d45dd797d39d6467ba752b74065516dc194992d865602bfae07af113": { "source": { "path": "integ-cloudfront-function-url-origin.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9a6c172119a86bf65d38c8185c145afbebd67b5e50d54fca1f3c2229b41cdcd0.json", + "objectKey": "fd1a6e94d45dd797d39d6467ba752b74065516dc194992d865602bfae07af113.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-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.template.json index f3b95cb007d78..b92d1169d821c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ-cloudfront-function-url-origin.template.json @@ -76,6 +76,17 @@ "Principal": "*" } }, + "OriginAccessControl": { + "Type": "AWS::CloudFront::OriginAccessControl", + "Properties": { + "OriginAccessControlConfig": { + "Name": "sample", + "OriginAccessControlOriginType": "lambda", + "SigningBehavior": "always", + "SigningProtocol": "sigv4" + } + } + }, "Distribution830FAC52": { "Type": "AWS::CloudFront::Distribution", "Properties": { @@ -113,7 +124,13 @@ } ] }, - "Id": "integcloudfrontfunctionurloriginDistributionOrigin19836FF4B" + "Id": "integcloudfrontfunctionurloriginDistributionOrigin19836FF4B", + "OriginAccessControlId": { + "Fn::GetAtt": [ + "OriginAccessControl", + "Id" + ] + } } ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ.json index 146e82f912b8d..a3443b51573f6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "38.0.1", "testCases": { "rest-api-origin/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/manifest.json index fe34de633eada..0740fa92072fa 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "38.0.1", "artifacts": { "integ-cloudfront-function-url-origin.assets": { "type": "cdk:asset-manifest", @@ -16,9 +16,10 @@ "templateFile": "integ-cloudfront-function-url-origin.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "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}/9a6c172119a86bf65d38c8185c145afbebd67b5e50d54fca1f3c2229b41cdcd0.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fd1a6e94d45dd797d39d6467ba752b74065516dc194992d865602bfae07af113.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -58,6 +59,12 @@ "data": "MyFunctioninvokefunctionurl171A3163" } ], + "/integ-cloudfront-function-url-origin/OriginAccessControl": [ + { + "type": "aws:cdk:logicalId", + "data": "OriginAccessControl" + } + ], "/integ-cloudfront-function-url-origin/Distribution/Resource": [ { "type": "aws:cdk:logicalId", @@ -94,6 +101,7 @@ "templateFile": "restapioriginDefaultTestDeployAssert6BBA15BA.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "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}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/restapioriginDefaultTestDeployAssert6BBA15BA.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/restapioriginDefaultTestDeployAssert6BBA15BA.assets.json index 5e494c6aa6b59..cae94617dcdb5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/restapioriginDefaultTestDeployAssert6BBA15BA.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/restapioriginDefaultTestDeployAssert6BBA15BA.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/tree.json index 9de612a777a06..f964373a710b1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.js.snapshot/tree.json @@ -151,6 +151,25 @@ "version": "0.0.0" } }, + "OriginAccessControl": { + "id": "OriginAccessControl", + "path": "integ-cloudfront-function-url-origin/OriginAccessControl", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudFront::OriginAccessControl", + "aws:cdk:cloudformation:props": { + "originAccessControlConfig": { + "name": "sample", + "originAccessControlOriginType": "lambda", + "signingBehavior": "always", + "signingProtocol": "sigv4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudfront.CfnOriginAccessControl", + "version": "0.0.0" + } + }, "Distribution": { "id": "Distribution", "path": "integ-cloudfront-function-url-origin/Distribution", @@ -160,7 +179,7 @@ "path": "integ-cloudfront-function-url-origin/Distribution/Origin1", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "Resource": { @@ -195,6 +214,12 @@ "TLSv1.2" ], "originProtocolPolicy": "https-only" + }, + "originAccessControlId": { + "Fn::GetAtt": [ + "OriginAccessControl", + "Id" + ] } } ], @@ -256,7 +281,7 @@ "path": "rest-api-origin/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -302,7 +327,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.ts index f9dbb3bd17d76..de9b99fc776c5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.function-url-origin.ts @@ -20,7 +20,7 @@ const fnUrl = fn.addFunctionUrl({ const oac = new cloudfront.CfnOriginAccessControl( stack, - 'HandlerOriginAccessControl', + 'OriginAccessControl', { originAccessControlConfig: { name: 'sample',