diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip rename to packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip index e6cb898734b43..90a8a2a6e2615 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.assets.json index baf8030e93628..db36212774284 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2": { "source": { @@ -15,15 +15,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } @@ -85,7 +85,7 @@ } } }, - "ba18bfbb3384019a2c62e3de7deb433f76c43587d1a01a4ead4d30e466252748": { + "ac34a7f17e810848983abb8bddee14270b95a3d960fa3d8aa51bad606a23c8c0": { "source": { "path": "aws-cdk-nested-stack-in-product-stack.template.json", "packaging": "file" @@ -93,7 +93,7 @@ "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "ba18bfbb3384019a2c62e3de7deb433f76c43587d1a01a4ead4d30e466252748.json", + "objectKey": "ac34a7f17e810848983abb8bddee14270b95a3d960fa3d8aa51bad606a23c8c0.json", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.template.json index 3fd77a619a44a..354f8a3602b44 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/aws-cdk-nested-stack-in-product-stack.template.json @@ -6,7 +6,7 @@ "BucketName": "asset-bucket-12345678-test-region", "Tags": [ { - "Key": "aws-cdk:cr-owned:cea6ac02", + "Key": "aws-cdk:cr-owned:2278d920", "Value": "true" } ] @@ -14,17 +14,17 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "AssetsBucketDeploymentAwsCliLayer9BCEE17F": { + "AssetBucketProductAssetsDeploymentAwsCliLayerB57A37F8": { "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } }, - "AssetsBucketDeploymentCustomResource283760D6": { + "AssetBucketProductAssetsDeploymentCustomResource4B59DD1D": { "Type": "Custom::CDKBucketDeployment", "Properties": { "ServiceToken": { @@ -51,6 +51,7 @@ "DestinationBucketName": { "Ref": "AssetBucket1D025086" }, + "RetainOnDelete": true, "Extract": false, "Prune": false }, @@ -190,7 +191,7 @@ "Handler": "index.handler", "Layers": [ { - "Ref": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "Ref": "AssetBucketProductAssetsDeploymentAwsCliLayerB57A37F8" } ], "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/awscdknestedstackinproductstackintegDefaultTestDeployAssert7C8849C0.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/awscdknestedstackinproductstackintegDefaultTestDeployAssert7C8849C0.assets.json index 696be5f910518..62ab62e68d027 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/awscdknestedstackinproductstackintegDefaultTestDeployAssert7C8849C0.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/awscdknestedstackinproductstackintegDefaultTestDeployAssert7C8849C0.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/cdk.out index f0b901e7c06e5..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/integ.json index 48aba0d654541..6003b71fdf5a5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "testCases": { "aws-cdk-nested-stack-in-product-stack-integ/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/manifest.json index 6d1d4bf874c4a..73cc245e439b2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "artifacts": { "aws-cdk-nested-stack-in-product-stack.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/ba18bfbb3384019a2c62e3de7deb433f76c43587d1a01a4ead4d30e466252748.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/ac34a7f17e810848983abb8bddee14270b95a3d960fa3d8aa51bad606a23c8c0.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -39,16 +39,16 @@ "data": "AssetBucket1D025086" } ], - "/aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/AwsCliLayer/Resource": [ + "/aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "data": "AssetBucketProductAssetsDeploymentAwsCliLayerB57A37F8" } ], - "/aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/CustomResource/Default": [ + "/aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/CustomResource/Default": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentCustomResource283760D6" + "data": "AssetBucketProductAssetsDeploymentCustomResource4B59DD1D" } ], "/aws-cdk-nested-stack-in-product-stack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [ @@ -86,6 +86,24 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "AssetsBucketDeploymentAwsCliLayer9BCEE17F": [ + { + "type": "aws:cdk:logicalId", + "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "AssetsBucketDeploymentCustomResource283760D6": [ + { + "type": "aws:cdk:logicalId", + "data": "AssetsBucketDeploymentCustomResource283760D6", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "aws-cdk-nested-stack-in-product-stack" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/tree.json index 4e261d4df0978..a9facde46a56f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.nested-stack-in-product-stack.js.snapshot/tree.json @@ -21,7 +21,7 @@ "bucketName": "asset-bucket-12345678-test-region", "tags": [ { - "key": "aws-cdk:cr-owned:cea6ac02", + "key": "aws-cdk:cr-owned:2278d920", "value": "true" } ] @@ -31,6 +31,96 @@ "fqn": "aws-cdk-lib.aws_s3.CfnBucket", "version": "0.0.0" } + }, + "ProductAssetsDeployment": { + "id": "ProductAssetsDeployment", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment", + "children": { + "AwsCliLayer": { + "id": "AwsCliLayer", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/AwsCliLayer", + "children": { + "Code": { + "id": "Code", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/AwsCliLayer/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", + "aws:cdk:cloudformation:props": { + "content": { + "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "description": "/opt/awscli/aws" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", + "version": "0.0.0" + } + }, + "CustomResourceHandler": { + "id": "CustomResourceHandler", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/CustomResourceHandler", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "CustomResource": { + "id": "CustomResource", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/CustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-nested-stack-in-product-stack/AssetBucket/ProductAssetsDeployment/CustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", + "version": "0.0.0" + } } }, "constructInfo": { @@ -324,7 +414,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "ParentAssetBucket": { @@ -341,96 +431,6 @@ "version": "0.0.0" } }, - "AssetsBucketDeployment": { - "id": "AssetsBucketDeployment", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment", - "children": { - "AwsCliLayer": { - "id": "AwsCliLayer", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/AwsCliLayer", - "children": { - "Code": { - "id": "Code", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/AwsCliLayer/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/AwsCliLayer/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/AwsCliLayer/Code/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/AwsCliLayer/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", - "aws:cdk:cloudformation:props": { - "content": { - "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" - }, - "description": "/opt/awscli/aws" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", - "version": "0.0.0" - } - }, - "CustomResourceHandler": { - "id": "CustomResourceHandler", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/CustomResourceHandler", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", - "version": "0.0.0" - } - }, - "CustomResource": { - "id": "CustomResource", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/CustomResource", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-nested-stack-in-product-stack/AssetsBucketDeployment/CustomResource/Default", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.CustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", - "version": "0.0.0" - } - }, "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": { "id": "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", "path": "aws-cdk-nested-stack-in-product-stack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", @@ -641,7 +641,7 @@ "handler": "index.handler", "layers": [ { - "Ref": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "Ref": "AssetBucketProductAssetsDeploymentAwsCliLayerB57A37F8" } ], "role": { @@ -736,7 +736,7 @@ "path": "aws-cdk-nested-stack-in-product-stack-integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -782,7 +782,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329/index.js new file mode 100644 index 0000000000000..74b746be8e47f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329/index.js @@ -0,0 +1 @@ +"use strict";var f=Object.create;var c=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var o in e)c(t,o,{get:e[o],enumerable:!0})},l=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!P.call(t,s)&&s!==o&&c(t,s,{get:()=>e[s],enumerable:!(r=C(e,s))||r.enumerable});return t};var p=(t,e,o)=>(o=t!=null?f(A(t)):{},l(e||!t||!t.__esModule?c(o,"default",{value:t,enumerable:!0}):o,t)),k=t=>l(c({},"__esModule",{value:!0}),t);var N={};L(N,{autoDeleteHandler:()=>g,handler:()=>O});module.exports=k(N);var i=require("@aws-sdk/client-s3");var R=p(require("https")),y=p(require("url")),a={sendHttpRequest:b,log:B,includeStackTraces:!0,userHandlerIndex:"./index"},m="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",D="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";function h(t){return async(e,o)=>{let r={...e,ResponseURL:"..."};if(a.log(JSON.stringify(r,void 0,2)),e.RequestType==="Delete"&&e.PhysicalResourceId===m){a.log("ignoring DELETE event caused by a failed CREATE event"),await u("SUCCESS",e);return}try{let s=await t(r,o),n=T(e,s);await u("SUCCESS",n)}catch(s){let n={...e,Reason:a.includeStackTraces?s.stack:s.message};n.PhysicalResourceId||(e.RequestType==="Create"?(a.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),n.PhysicalResourceId=m):a.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(e)}`)),await u("FAILED",n)}}}function T(t,e={}){let o=e.PhysicalResourceId??t.PhysicalResourceId??t.RequestId;if(t.RequestType==="Delete"&&o!==t.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${t.PhysicalResourceId}" to "${e.PhysicalResourceId}" during deletion`);return{...t,...e,PhysicalResourceId:o}}async function u(t,e){let o={Status:t,Reason:e.Reason??t,StackId:e.StackId,RequestId:e.RequestId,PhysicalResourceId:e.PhysicalResourceId||D,LogicalResourceId:e.LogicalResourceId,NoEcho:e.NoEcho,Data:e.Data};a.log("submit response to cloudformation",o);let r=JSON.stringify(o),s=y.parse(e.ResponseURL),n={hostname:s.hostname,path:s.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(r,"utf8")}};await x({attempts:5,sleep:1e3},a.sendHttpRequest)(n,r)}async function b(t,e){return new Promise((o,r)=>{try{let s=R.request(t,n=>o());s.on("error",r),s.write(e),s.end()}catch(s){r(s)}})}function B(t,...e){console.log(t,...e)}function x(t,e){return async(...o)=>{let r=t.attempts,s=t.sleep;for(;;)try{return await e(...o)}catch(n){if(r--<=0)throw n;await H(Math.floor(Math.random()*s)),s*=2}}}async function H(t){return new Promise(e=>setTimeout(e,t))}var E="aws-cdk:auto-delete-objects",d=new i.S3({}),O=h(g);async function g(t){switch(t.RequestType){case"Create":return;case"Update":return F(t);case"Delete":return I(t.ResourceProperties?.BucketName)}}async function F(t){let e=t,o=e.OldResourceProperties?.BucketName,r=e.ResourceProperties?.BucketName;if(r!=null&&o!=null&&r!==o)return I(o)}async function S(t){let e=await d.listObjectVersions({Bucket:t}),o=[...e.Versions??[],...e.DeleteMarkers??[]];if(o.length===0)return;let r=o.map(s=>({Key:s.Key,VersionId:s.VersionId}));await d.deleteObjects({Bucket:t,Delete:{Objects:r}}),e?.IsTruncated&&await S(t)}async function I(t){if(!t)throw new Error("No BucketName was provided.");try{if(!await _(t)){console.log(`Bucket does not have '${E}' tag, skipping cleaning.`);return}await S(t)}catch(e){if(e instanceof i.S3ServiceException&&e.name==="NoSuchBucket"){console.log(`Bucket '${t}' does not exist.`);return}throw e}}async function _(t){return(await d.getBucketTagging({Bucket:t})).TagSet?.some(o=>o.Key===E&&o.Value==="true")}0&&(module.exports={autoDeleteHandler,handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c/index.js deleted file mode 100644 index b9e3b71c939ea..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var C=Object.create;var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var s in e)c(t,s,{get:e[s],enumerable:!0})},d=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of w(e))!P.call(t,o)&&o!==s&&c(t,o,{get:()=>e[o],enumerable:!(r=f(e,o))||r.enumerable});return t};var l=(t,e,s)=>(s=t!=null?C(A(t)):{},d(e||!t||!t.__esModule?c(s,"default",{value:t,enumerable:!0}):s,t)),k=t=>d(c({},"__esModule",{value:!0}),t);var _={};L(_,{autoDeleteHandler:()=>g,handler:()=>O});module.exports=k(_);var h=require("@aws-sdk/client-s3");var m=l(require("https")),R=l(require("url")),a={sendHttpRequest:T,log:B,includeStackTraces:!0,userHandlerIndex:"./index"},p="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",D="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";function y(t){return async(e,s)=>{let r={...e,ResponseURL:"..."};if(a.log(JSON.stringify(r,void 0,2)),e.RequestType==="Delete"&&e.PhysicalResourceId===p){a.log("ignoring DELETE event caused by a failed CREATE event"),await i("SUCCESS",e);return}try{let o=await t(r,s),n=b(e,o);await i("SUCCESS",n)}catch(o){let n={...e,Reason:a.includeStackTraces?o.stack:o.message};n.PhysicalResourceId||(e.RequestType==="Create"?(a.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),n.PhysicalResourceId=p):a.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(e)}`)),await i("FAILED",n)}}}function b(t,e={}){let s=e.PhysicalResourceId??t.PhysicalResourceId??t.RequestId;if(t.RequestType==="Delete"&&s!==t.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${t.PhysicalResourceId}" to "${e.PhysicalResourceId}" during deletion`);return{...t,...e,PhysicalResourceId:s}}async function i(t,e){let s={Status:t,Reason:e.Reason??t,StackId:e.StackId,RequestId:e.RequestId,PhysicalResourceId:e.PhysicalResourceId||D,LogicalResourceId:e.LogicalResourceId,NoEcho:e.NoEcho,Data:e.Data};a.log("submit response to cloudformation",s);let r=JSON.stringify(s),o=R.parse(e.ResponseURL),n={hostname:o.hostname,path:o.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(r,"utf8")}};await x({attempts:5,sleep:1e3},a.sendHttpRequest)(n,r)}async function T(t,e){return new Promise((s,r)=>{try{let o=m.request(t,n=>s());o.on("error",r),o.write(e),o.end()}catch(o){r(o)}})}function B(t,...e){console.log(t,...e)}function x(t,e){return async(...s)=>{let r=t.attempts,o=t.sleep;for(;;)try{return await e(...s)}catch(n){if(r--<=0)throw n;await H(Math.floor(Math.random()*o)),o*=2}}}async function H(t){return new Promise(e=>setTimeout(e,t))}var E="aws-cdk:auto-delete-objects",u=new h.S3({}),O=y(g);async function g(t){switch(t.RequestType){case"Create":return;case"Update":return F(t);case"Delete":return S(t.ResourceProperties?.BucketName)}}async function F(t){let e=t,s=e.OldResourceProperties?.BucketName,r=e.ResourceProperties?.BucketName;if(r!=null&&s!=null&&r!==s)return S(s)}async function I(t){let e=await u.listObjectVersions({Bucket:t}),s=[...e.Versions??[],...e.DeleteMarkers??[]];if(s.length===0)return;let r=s.map(o=>({Key:o.Key,VersionId:o.VersionId}));await u.deleteObjects({Bucket:t,Delete:{Objects:r}}),e?.IsTruncated&&await I(t)}async function S(t){if(!t)throw new Error("No BucketName was provided.");if(!await N(t)){process.stdout.write(`Bucket does not have '${E}' tag, skipping cleaning. -`);return}try{await I(t)}catch(e){if(e.code!=="NoSuchBucket")throw e}}async function N(t){return(await u.getBucketTagging({Bucket:t})).TagSet?.some(s=>s.Key===E&&s.Value==="true")}0&&(module.exports={autoDeleteHandler,handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip rename to packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip index e6cb898734b43..90a8a2a6e2615 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/cdk.out index f0b901e7c06e5..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.assets.json index b0e720775fc66..28c8b67371223 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.assets.json @@ -1,15 +1,15 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { - "89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c": { + "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329": { "source": { - "path": "asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c", + "path": "asset.216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329", "packaging": "zip" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c.zip", + "objectKey": "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } @@ -29,15 +29,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } @@ -127,7 +127,7 @@ } } }, - "c4239d78dadb1df96f422c009e2d47614f81f2fd128f77af128992279f4336c7": { + "3a1f73ce8920482906dfe134236554e5d197d4950ebced7968d7478a30e47bfd": { "source": { "path": "integ-servicecatalog-product-encrypted-asset.template.json", "packaging": "file" @@ -135,7 +135,7 @@ "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "c4239d78dadb1df96f422c009e2d47614f81f2fd128f77af128992279f4336c7.json", + "objectKey": "3a1f73ce8920482906dfe134236554e5d197d4950ebced7968d7478a30e47bfd.json", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.template.json index 68a9ff341e506..7dd684ea07754 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ-servicecatalog-product-encrypted-asset.template.json @@ -78,7 +78,7 @@ "Value": "true" }, { - "Key": "aws-cdk:cr-owned:173c1279", + "Key": "aws-cdk:cr-owned:d060b5bf", "Value": "true" } ] @@ -242,6 +242,53 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82": { + "Type": "AWS::Lambda::LayerVersion", + "Properties": { + "Content": { + "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "Description": "/opt/awscli/aws" + } + }, + "TestAssetBucketProductAssetsDeploymentCustomResource5F81E30F": { + "Type": "Custom::CDKBucketDeployment", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", + "Arn" + ] + }, + "SourceBucketNames": [ + "cdk-hnb659fds-assets-12345678-test-region", + "cdk-hnb659fds-assets-12345678-test-region" + ], + "SourceObjectKeys": [ + "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", + "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" + ], + "SourceMarkers": [ + {}, + {} + ], + "DestinationBucketName": { + "Ref": "TestAssetBucket9434EFAE" + }, + "RetainOnDelete": true, + "Extract": false, + "Prune": false, + "SystemMetadata": { + "sse": "aws:kms", + "sse-kms-key-id": { + "Ref": "KmsKey46693ADD" + } + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": { "Type": "AWS::IAM::Role", "Properties": { @@ -269,7 +316,7 @@ "Properties": { "Code": { "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "S3Key": "89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c.zip" + "S3Key": "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329.zip" }, "Timeout": 900, "MemorySize": 128, @@ -298,52 +345,6 @@ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" ] }, - "AssetsBucketDeploymentAwsCliLayer9BCEE17F": { - "Type": "AWS::Lambda::LayerVersion", - "Properties": { - "Content": { - "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" - }, - "Description": "/opt/awscli/aws" - } - }, - "AssetsBucketDeploymentCustomResource283760D6": { - "Type": "Custom::CDKBucketDeployment", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", - "Arn" - ] - }, - "SourceBucketNames": [ - "cdk-hnb659fds-assets-12345678-test-region", - "cdk-hnb659fds-assets-12345678-test-region" - ], - "SourceObjectKeys": [ - "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", - "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" - ], - "SourceMarkers": [ - {}, - {} - ], - "DestinationBucketName": { - "Ref": "TestAssetBucket9434EFAE" - }, - "Extract": false, - "Prune": false, - "SystemMetadata": { - "sse": "aws:kms", - "sse-kms-key-id": { - "Ref": "KmsKey46693ADD" - } - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": { "Type": "AWS::IAM::Role", "Properties": { @@ -493,7 +494,7 @@ "Handler": "index.handler", "Layers": [ { - "Ref": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "Ref": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" } ], "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ.json index 2057962d0bd26..2954f91f0cebf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integ.json @@ -1,6 +1,6 @@ { "enableLookups": true, - "version": "32.0.0", + "version": "34.0.0", "testCases": { "integ-product-encrypted-asset/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integproductencryptedassetDefaultTestDeployAssertCD64745E.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integproductencryptedassetDefaultTestDeployAssertCD64745E.assets.json index 9658105f05d6e..09babe8a050c9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integproductencryptedassetDefaultTestDeployAssertCD64745E.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/integproductencryptedassetDefaultTestDeployAssertCD64745E.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/manifest.json index 8e7a9e5357cd1..cb243ebead11c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "artifacts": { "integ-servicecatalog-product-encrypted-asset.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/c4239d78dadb1df96f422c009e2d47614f81f2fd128f77af128992279f4336c7.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/3a1f73ce8920482906dfe134236554e5d197d4950ebced7968d7478a30e47bfd.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -69,31 +69,28 @@ "data": "TestAssetBucketAutoDeleteObjectsCustomResource5A0F8F22" } ], - "/integ-servicecatalog-product-encrypted-asset/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ + "/integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" + "data": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" } ], - "/integ-servicecatalog-product-encrypted-asset/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler": [ + "/integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/CustomResource/Default": [ { "type": "aws:cdk:logicalId", - "data": "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F" + "data": "TestAssetBucketProductAssetsDeploymentCustomResource5F81E30F" } ], - "/integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/AwsCliLayer/Resource": [ + "/integ-servicecatalog-product-encrypted-asset/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" } ], - "/integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/CustomResource/Default": [ + "/integ-servicecatalog-product-encrypted-asset/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentCustomResource283760D6" + "data": "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F" } ], "/integ-servicecatalog-product-encrypted-asset/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [ @@ -137,6 +134,24 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "AssetsBucketDeploymentAwsCliLayer9BCEE17F": [ + { + "type": "aws:cdk:logicalId", + "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "AssetsBucketDeploymentCustomResource283760D6": [ + { + "type": "aws:cdk:logicalId", + "data": "AssetsBucketDeploymentCustomResource283760D6", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "integ-servicecatalog-product-encrypted-asset" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/tree.json index a0b626f7dc59c..18148b2fc76d9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.encrypted.asset.js.snapshot/tree.json @@ -175,7 +175,7 @@ "value": "true" }, { - "key": "aws-cdk:cr-owned:173c1279", + "key": "aws-cdk:cr-owned:d060b5bf", "value": "true" } ] @@ -358,6 +358,96 @@ "fqn": "aws-cdk-lib.CustomResource", "version": "0.0.0" } + }, + "ProductAssetsDeployment": { + "id": "ProductAssetsDeployment", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment", + "children": { + "AwsCliLayer": { + "id": "AwsCliLayer", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer", + "children": { + "Code": { + "id": "Code", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", + "aws:cdk:cloudformation:props": { + "content": { + "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "description": "/opt/awscli/aws" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", + "version": "0.0.0" + } + }, + "CustomResourceHandler": { + "id": "CustomResourceHandler", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/CustomResourceHandler", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "CustomResource": { + "id": "CustomResource", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/CustomResource", + "children": { + "Default": { + "id": "Default", + "path": "integ-servicecatalog-product-encrypted-asset/TestAssetBucket/ProductAssetsDeployment/CustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", + "version": "0.0.0" + } } }, "constructInfo": { @@ -717,96 +807,6 @@ "version": "0.0.0" } }, - "AssetsBucketDeployment": { - "id": "AssetsBucketDeployment", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment", - "children": { - "AwsCliLayer": { - "id": "AwsCliLayer", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/AwsCliLayer", - "children": { - "Code": { - "id": "Code", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/AwsCliLayer/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/AwsCliLayer/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/AwsCliLayer/Code/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/AwsCliLayer/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", - "aws:cdk:cloudformation:props": { - "content": { - "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" - }, - "description": "/opt/awscli/aws" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", - "version": "0.0.0" - } - }, - "CustomResourceHandler": { - "id": "CustomResourceHandler", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/CustomResourceHandler", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", - "version": "0.0.0" - } - }, - "CustomResource": { - "id": "CustomResource", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/CustomResource", - "children": { - "Default": { - "id": "Default", - "path": "integ-servicecatalog-product-encrypted-asset/AssetsBucketDeployment/CustomResource/Default", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.CustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", - "version": "0.0.0" - } - }, "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": { "id": "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", "path": "integ-servicecatalog-product-encrypted-asset/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", @@ -1033,7 +1033,7 @@ "handler": "index.handler", "layers": [ { - "Ref": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "Ref": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" } ], "role": { @@ -1061,13 +1061,13 @@ "id": "TestProduct", "path": "integ-servicecatalog-product-encrypted-asset/TestProduct", "children": { - "Template29445a0ba87d": { - "id": "Template29445a0ba87d", - "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template29445a0ba87d", + "Templatecfae0edd2da0": { + "id": "Templatecfae0edd2da0", + "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Templatecfae0edd2da0", "children": { "Stage": { "id": "Stage", - "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template29445a0ba87d/Stage", + "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Templatecfae0edd2da0/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1075,7 +1075,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template29445a0ba87d/AssetBucket", + "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Templatecfae0edd2da0/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1087,13 +1087,13 @@ "version": "0.0.0" } }, - "Template2c1881ac7bbc": { - "id": "Template2c1881ac7bbc", - "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template2c1881ac7bbc", + "Template15761d1255cb": { + "id": "Template15761d1255cb", + "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template15761d1255cb", "children": { "Stage": { "id": "Stage", - "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template2c1881ac7bbc/Stage", + "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template15761d1255cb/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1101,7 +1101,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template2c1881ac7bbc/AssetBucket", + "path": "integ-servicecatalog-product-encrypted-asset/TestProduct/Template15761d1255cb/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1235,7 +1235,7 @@ "path": "integ-product-encrypted-asset/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -1281,7 +1281,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out index f0b901e7c06e5..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json index 433fd6146fcf9..92e4ca9d3ad97 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329": { "source": { @@ -127,7 +127,7 @@ } } }, - "f5a791f351854d993630f5f1a1b8fbae212a52e79d63c5e00b07904358073d78": { + "bd12c7f790793f4a31caf7daefab56b06bf0d587972f0dfb3e9817f9ce169b64": { "source": { "path": "integ-servicecatalog-product.template.json", "packaging": "file" @@ -135,7 +135,7 @@ "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "f5a791f351854d993630f5f1a1b8fbae212a52e79d63c5e00b07904358073d78.json", + "objectKey": "bd12c7f790793f4a31caf7daefab56b06bf0d587972f0dfb3e9817f9ce169b64.json", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json index 18b890405c235..111088e0a9c87 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json @@ -30,7 +30,7 @@ "Value": "true" }, { - "Key": "aws-cdk:cr-owned:3caa27f4", + "Key": "aws-cdk:cr-owned:f2fec642", "Value": "true" } ] @@ -108,6 +108,47 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82": { + "Type": "AWS::Lambda::LayerVersion", + "Properties": { + "Content": { + "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "Description": "/opt/awscli/aws" + } + }, + "TestAssetBucketProductAssetsDeploymentCustomResource5F81E30F": { + "Type": "Custom::CDKBucketDeployment", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", + "Arn" + ] + }, + "SourceBucketNames": [ + "cdk-hnb659fds-assets-12345678-test-region", + "cdk-hnb659fds-assets-12345678-test-region" + ], + "SourceObjectKeys": [ + "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", + "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" + ], + "SourceMarkers": [ + {}, + {} + ], + "DestinationBucketName": { + "Ref": "TestAssetBucket9434EFAE" + }, + "RetainOnDelete": true, + "Extract": false, + "Prune": false + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": { "Type": "AWS::IAM::Role", "Properties": { @@ -164,46 +205,6 @@ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" ] }, - "AssetsBucketDeploymentAwsCliLayer9BCEE17F": { - "Type": "AWS::Lambda::LayerVersion", - "Properties": { - "Content": { - "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" - }, - "Description": "/opt/awscli/aws" - } - }, - "AssetsBucketDeploymentCustomResource283760D6": { - "Type": "Custom::CDKBucketDeployment", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", - "Arn" - ] - }, - "SourceBucketNames": [ - "cdk-hnb659fds-assets-12345678-test-region", - "cdk-hnb659fds-assets-12345678-test-region" - ], - "SourceObjectKeys": [ - "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", - "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" - ], - "SourceMarkers": [ - {}, - {} - ], - "DestinationBucketName": { - "Ref": "TestAssetBucket9434EFAE" - }, - "Extract": false, - "Prune": false - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": { "Type": "AWS::IAM::Role", "Properties": { @@ -337,7 +338,7 @@ "Handler": "index.handler", "Layers": [ { - "Ref": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "Ref": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" } ], "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json index a5ec5b0717d9a..ab538098055b5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json @@ -1,6 +1,6 @@ { "enableLookups": true, - "version": "32.0.0", + "version": "34.0.0", "testCases": { "integ-product/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json index 6df18e1a1fe54..c10809229e848 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json index ff2b2c9c86631..4c44b74d58749 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "artifacts": { "integ-servicecatalog-product.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/f5a791f351854d993630f5f1a1b8fbae212a52e79d63c5e00b07904358073d78.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/bd12c7f790793f4a31caf7daefab56b06bf0d587972f0dfb3e9817f9ce169b64.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -63,28 +63,28 @@ "data": "TestAssetBucketAutoDeleteObjectsCustomResource5A0F8F22" } ], - "/integ-servicecatalog-product/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ + "/integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" + "data": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" } ], - "/integ-servicecatalog-product/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler": [ + "/integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/CustomResource/Default": [ { "type": "aws:cdk:logicalId", - "data": "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F" + "data": "TestAssetBucketProductAssetsDeploymentCustomResource5F81E30F" } ], - "/integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer/Resource": [ + "/integ-servicecatalog-product/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "data": "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" } ], - "/integ-servicecatalog-product/AssetsBucketDeployment/CustomResource/Default": [ + "/integ-servicecatalog-product/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentCustomResource283760D6" + "data": "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F" } ], "/integ-servicecatalog-product/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [ @@ -128,6 +128,24 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "AssetsBucketDeploymentAwsCliLayer9BCEE17F": [ + { + "type": "aws:cdk:logicalId", + "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "AssetsBucketDeploymentCustomResource283760D6": [ + { + "type": "aws:cdk:logicalId", + "data": "AssetsBucketDeploymentCustomResource283760D6", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "integ-servicecatalog-product" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json index cc99a4de19106..c69efd68bb688 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json @@ -111,7 +111,7 @@ "value": "true" }, { - "key": "aws-cdk:cr-owned:3caa27f4", + "key": "aws-cdk:cr-owned:f2fec642", "value": "true" } ] @@ -208,6 +208,96 @@ "fqn": "aws-cdk-lib.CustomResource", "version": "0.0.0" } + }, + "ProductAssetsDeployment": { + "id": "ProductAssetsDeployment", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment", + "children": { + "AwsCliLayer": { + "id": "AwsCliLayer", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer", + "children": { + "Code": { + "id": "Code", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", + "aws:cdk:cloudformation:props": { + "content": { + "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "description": "/opt/awscli/aws" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", + "version": "0.0.0" + } + }, + "CustomResourceHandler": { + "id": "CustomResourceHandler", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/CustomResourceHandler", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "CustomResource": { + "id": "CustomResource", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/CustomResource", + "children": { + "Default": { + "id": "Default", + "path": "integ-servicecatalog-product/TestAssetBucket/ProductAssetsDeployment/CustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", + "version": "0.0.0" + } } }, "constructInfo": { @@ -567,96 +657,6 @@ "version": "0.0.0" } }, - "AssetsBucketDeployment": { - "id": "AssetsBucketDeployment", - "path": "integ-servicecatalog-product/AssetsBucketDeployment", - "children": { - "AwsCliLayer": { - "id": "AwsCliLayer", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer", - "children": { - "Code": { - "id": "Code", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer/Code/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", - "aws:cdk:cloudformation:props": { - "content": { - "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" - }, - "description": "/opt/awscli/aws" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", - "version": "0.0.0" - } - }, - "CustomResourceHandler": { - "id": "CustomResourceHandler", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/CustomResourceHandler", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", - "version": "0.0.0" - } - }, - "CustomResource": { - "id": "CustomResource", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/CustomResource", - "children": { - "Default": { - "id": "Default", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/CustomResource/Default", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.CustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", - "version": "0.0.0" - } - }, "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": { "id": "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", "path": "integ-servicecatalog-product/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", @@ -867,7 +867,7 @@ "handler": "index.handler", "layers": [ { - "Ref": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "Ref": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" } ], "role": { @@ -895,13 +895,13 @@ "id": "TestProduct", "path": "integ-servicecatalog-product/TestProduct", "children": { - "Template29445a0ba87d": { - "id": "Template29445a0ba87d", - "path": "integ-servicecatalog-product/TestProduct/Template29445a0ba87d", + "Templatecfae0edd2da0": { + "id": "Templatecfae0edd2da0", + "path": "integ-servicecatalog-product/TestProduct/Templatecfae0edd2da0", "children": { "Stage": { "id": "Stage", - "path": "integ-servicecatalog-product/TestProduct/Template29445a0ba87d/Stage", + "path": "integ-servicecatalog-product/TestProduct/Templatecfae0edd2da0/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -909,7 +909,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-servicecatalog-product/TestProduct/Template29445a0ba87d/AssetBucket", + "path": "integ-servicecatalog-product/TestProduct/Templatecfae0edd2da0/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -921,13 +921,13 @@ "version": "0.0.0" } }, - "Template2c1881ac7bbc": { - "id": "Template2c1881ac7bbc", - "path": "integ-servicecatalog-product/TestProduct/Template2c1881ac7bbc", + "Template15761d1255cb": { + "id": "Template15761d1255cb", + "path": "integ-servicecatalog-product/TestProduct/Template15761d1255cb", "children": { "Stage": { "id": "Stage", - "path": "integ-servicecatalog-product/TestProduct/Template2c1881ac7bbc/Stage", + "path": "integ-servicecatalog-product/TestProduct/Template15761d1255cb/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -935,7 +935,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-servicecatalog-product/TestProduct/Template2c1881ac7bbc/AssetBucket", + "path": "integ-servicecatalog-product/TestProduct/Template15761d1255cb/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1069,7 +1069,7 @@ "path": "integ-product/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -1115,7 +1115,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/cdk.out new file mode 100644 index 0000000000000..2313ab5436501 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ-servicecatalog-two-products.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ-servicecatalog-two-products.assets.json new file mode 100644 index 0000000000000..27a41f66d0c7f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ-servicecatalog-two-products.assets.json @@ -0,0 +1,118 @@ +{ + "version": "34.0.0", + "files": { + "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329": { + "source": { + "path": "asset.216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329", + "packaging": "zip" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329.zip", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2": { + "source": { + "path": "asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2", + "packaging": "zip" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { + "source": { + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", + "packaging": "file" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd": { + "source": { + "path": "asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd", + "packaging": "zip" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d": { + "source": { + "path": "asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d", + "packaging": "zip" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "e3d02db86c0d1baccd824dbe984b3e37153502d8511f859c5664c716dc4ca3c9": { + "source": { + "path": "integservicecatalogtwoproductsMyProductStack16958D9C5.product.template.json", + "packaging": "file" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "e3d02db86c0d1baccd824dbe984b3e37153502d8511f859c5664c716dc4ca3c9.json", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "ff5d7c5889c1c3e06b0d5ec1e9cae941ed44715b96e8872c9b2eb2af322cf4d3": { + "source": { + "path": "integservicecatalogtwoproductsMyProductStack25090BCC2.product.template.json", + "packaging": "file" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "ff5d7c5889c1c3e06b0d5ec1e9cae941ed44715b96e8872c9b2eb2af322cf4d3.json", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + }, + "118bb0d8b24fb56ba65a7e9f4608e7880ac2a3dbd6f12c159a9e12bc8a199f74": { + "source": { + "path": "integ-servicecatalog-two-products.template.json", + "packaging": "file" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "118bb0d8b24fb56ba65a7e9f4608e7880ac2a3dbd6f12c159a9e12bc8a199f74.json", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ-servicecatalog-two-products.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ-servicecatalog-two-products.template.json new file mode 100644 index 0000000000000..210e736e5ff95 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ-servicecatalog-two-products.template.json @@ -0,0 +1,447 @@ +{ + "Resources": { + "TestPortfolio4AC794EB": { + "Type": "AWS::ServiceCatalog::Portfolio", + "Properties": { + "AcceptLanguage": "en", + "Description": "This is our Service Catalog Portfolio", + "DisplayName": "TestPortfolio", + "ProviderName": "TestProvider" + } + }, + "TestPortfolioPortfolioProductAssociation0cb6a303fbbc243F6859": { + "Type": "AWS::ServiceCatalog::PortfolioProductAssociation", + "Properties": { + "PortfolioId": { + "Ref": "TestPortfolio4AC794EB" + }, + "ProductId": { + "Ref": "Product133E85955" + } + } + }, + "TestPortfolioPortfolioProductAssociation8b0f551963a9D7EBBBF3": { + "Type": "AWS::ServiceCatalog::PortfolioProductAssociation", + "Properties": { + "PortfolioId": { + "Ref": "TestPortfolio4AC794EB" + }, + "ProductId": { + "Ref": "Product2828D9765" + } + } + }, + "TestAssetBucket9434EFAE": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "product-stack-asset-bucket-12345678-test-region", + "Tags": [ + { + "Key": "aws-cdk:auto-delete-objects", + "Value": "true" + }, + { + "Key": "aws-cdk:cr-owned:8a3b3620", + "Value": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TestAssetBucketPolicy62167ACB": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "TestAssetBucket9434EFAE" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + } + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "TestAssetBucketAutoDeleteObjectsCustomResource5A0F8F22": { + "Type": "Custom::S3AutoDeleteObjects", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", + "Arn" + ] + }, + "BucketName": { + "Ref": "TestAssetBucket9434EFAE" + } + }, + "DependsOn": [ + "TestAssetBucketPolicy62167ACB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82": { + "Type": "AWS::Lambda::LayerVersion", + "Properties": { + "Content": { + "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "Description": "/opt/awscli/aws" + } + }, + "TestAssetBucketProductAssetsDeploymentCustomResource5F81E30F": { + "Type": "Custom::CDKBucketDeployment", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", + "Arn" + ] + }, + "SourceBucketNames": [ + "cdk-hnb659fds-assets-12345678-test-region", + "cdk-hnb659fds-assets-12345678-test-region" + ], + "SourceObjectKeys": [ + "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", + "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" + ], + "SourceMarkers": [ + {}, + {} + ], + "DestinationBucketName": { + "Ref": "TestAssetBucket9434EFAE" + }, + "RetainOnDelete": true, + "Extract": false, + "Prune": false + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ] + } + }, + "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "S3Key": "216218e507a977a1bb3592f29c1a62ab3e0a9eb25569109a395315638e154329.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Description": { + "Fn::Join": [ + "", + [ + "Lambda function for auto-deleting objects in ", + { + "Ref": "TestAssetBucket9434EFAE" + }, + " S3 bucket." + ] + ] + } + }, + "DependsOn": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" + ] + }, + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::cdk-hnb659fds-assets-12345678-test-region" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::cdk-hnb659fds-assets-12345678-test-region/*" + ] + ] + } + ] + }, + { + "Action": [ + "s3:Abort*", + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", + "Roles": [ + { + "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265" + } + ] + } + }, + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip" + }, + "Environment": { + "Variables": { + "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" + } + }, + "Handler": "index.handler", + "Layers": [ + { + "Ref": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" + } + ], + "Role": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", + "Arn" + ] + }, + "Runtime": "python3.9", + "Timeout": 900 + }, + "DependsOn": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265" + ] + }, + "Product133E85955": { + "Type": "AWS::ServiceCatalog::CloudFormationProduct", + "Properties": { + "Name": "Prod 1", + "Owner": "Owner 1", + "ProvisioningArtifactParameters": [ + { + "DisableTemplateValidation": false, + "Info": { + "LoadTemplateFromURL": { + "Fn::Sub": "https://s3.test-region.${AWS::URLSuffix}/cdk-hnb659fds-assets-12345678-test-region/e3d02db86c0d1baccd824dbe984b3e37153502d8511f859c5664c716dc4ca3c9.json" + } + }, + "Name": "v1" + } + ] + } + }, + "Product2828D9765": { + "Type": "AWS::ServiceCatalog::CloudFormationProduct", + "Properties": { + "Name": "Prod 2", + "Owner": "Owner 2", + "ProvisioningArtifactParameters": [ + { + "DisableTemplateValidation": false, + "Info": { + "LoadTemplateFromURL": { + "Fn::Sub": "https://s3.test-region.${AWS::URLSuffix}/cdk-hnb659fds-assets-12345678-test-region/ff5d7c5889c1c3e06b0d5ec1e9cae941ed44715b96e8872c9b2eb2af322cf4d3.json" + } + }, + "Name": "v1" + } + ] + } + } + }, + "Outputs": { + "PortfolioId": { + "Value": { + "Ref": "TestPortfolio4AC794EB" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ.json new file mode 100644 index 0000000000000..f515e48bdcf4d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integ.json @@ -0,0 +1,15 @@ +{ + "enableLookups": true, + "version": "34.0.0", + "testCases": { + "integ-product/DefaultTest": { + "stacks": [ + "integ-servicecatalog-two-products" + ], + "diffAssets": true, + "stackUpdateWorkflow": false, + "assertionStack": "integ-product/DefaultTest/DeployAssert", + "assertionStackName": "integproductDefaultTestDeployAssertEB23E2A9" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json new file mode 100644 index 0000000000000..c10809229e848 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.assets.json @@ -0,0 +1,19 @@ +{ + "version": "34.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "integproductDefaultTestDeployAssertEB23E2A9.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integproductDefaultTestDeployAssertEB23E2A9.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integservicecatalogtwoproductsMyProductStack16958D9C5.product.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integservicecatalogtwoproductsMyProductStack16958D9C5.product.template.json new file mode 100644 index 0000000000000..90d4aafcb3c08 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integservicecatalogtwoproductsMyProductStack16958D9C5.product.template.json @@ -0,0 +1,55 @@ +{ + "Resources": { + "HelloHandlerServiceRole11EF7C63": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "HelloHandler2E4FBA4D": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "product-stack-asset-bucket-12345678-test-region", + "S3Key": "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "HelloHandlerServiceRole11EF7C63", + "Arn" + ] + }, + "Runtime": "python3.9" + }, + "DependsOn": [ + "HelloHandlerServiceRole11EF7C63" + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integservicecatalogtwoproductsMyProductStack25090BCC2.product.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integservicecatalogtwoproductsMyProductStack25090BCC2.product.template.json new file mode 100644 index 0000000000000..fa9815655b5d1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/integservicecatalogtwoproductsMyProductStack25090BCC2.product.template.json @@ -0,0 +1,55 @@ +{ + "Resources": { + "HelloHandler2ServiceRole37B1402D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "HelloHandler2109B0120": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "product-stack-asset-bucket-12345678-test-region", + "S3Key": "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "HelloHandler2ServiceRole37B1402D", + "Arn" + ] + }, + "Runtime": "python3.9" + }, + "DependsOn": [ + "HelloHandler2ServiceRole37B1402D" + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/manifest.json new file mode 100644 index 0000000000000..8204c510a0aa9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/manifest.json @@ -0,0 +1,201 @@ +{ + "version": "34.0.0", + "artifacts": { + "integ-servicecatalog-two-products.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-servicecatalog-two-products.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-servicecatalog-two-products": { + "type": "aws:cloudformation:stack", + "environment": "aws://12345678/test-region", + "properties": { + "templateFile": "integ-servicecatalog-two-products.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/118bb0d8b24fb56ba65a7e9f4608e7880ac2a3dbd6f12c159a9e12bc8a199f74.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-servicecatalog-two-products.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-servicecatalog-two-products.assets" + ], + "metadata": { + "/integ-servicecatalog-two-products/TestPortfolio/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TestPortfolio4AC794EB" + } + ], + "/integ-servicecatalog-two-products/TestPortfolio/PortfolioProductAssociation0cb6a303fbbc": [ + { + "type": "aws:cdk:logicalId", + "data": "TestPortfolioPortfolioProductAssociation0cb6a303fbbc243F6859" + } + ], + "/integ-servicecatalog-two-products/TestPortfolio/PortfolioProductAssociation8b0f551963a9": [ + { + "type": "aws:cdk:logicalId", + "data": "TestPortfolioPortfolioProductAssociation8b0f551963a9D7EBBBF3" + } + ], + "/integ-servicecatalog-two-products/TestAssetBucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TestAssetBucket9434EFAE" + } + ], + "/integ-servicecatalog-two-products/TestAssetBucket/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TestAssetBucketPolicy62167ACB" + } + ], + "/integ-servicecatalog-two-products/TestAssetBucket/AutoDeleteObjectsCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "TestAssetBucketAutoDeleteObjectsCustomResource5A0F8F22" + } + ], + "/integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" + } + ], + "/integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/CustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "TestAssetBucketProductAssetsDeploymentCustomResource5F81E30F" + } + ], + "/integ-servicecatalog-two-products/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" + } + ], + "/integ-servicecatalog-two-products/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F" + } + ], + "/integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265" + } + ], + "/integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF" + } + ], + "/integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536" + } + ], + "/integ-servicecatalog-two-products/Product1/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Product133E85955" + } + ], + "/integ-servicecatalog-two-products/Product2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Product2828D9765" + } + ], + "/integ-servicecatalog-two-products/PortfolioId": [ + { + "type": "aws:cdk:logicalId", + "data": "PortfolioId" + } + ], + "/integ-servicecatalog-two-products/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-servicecatalog-two-products/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-servicecatalog-two-products" + }, + "integproductDefaultTestDeployAssertEB23E2A9.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integproductDefaultTestDeployAssertEB23E2A9.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integproductDefaultTestDeployAssertEB23E2A9": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integproductDefaultTestDeployAssertEB23E2A9.template.json", + "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}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integproductDefaultTestDeployAssertEB23E2A9.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integproductDefaultTestDeployAssertEB23E2A9.assets" + ], + "metadata": { + "/integ-product/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-product/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-product/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/tree.json new file mode 100644 index 0000000000000..be388136ec6f9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.js.snapshot/tree.json @@ -0,0 +1,997 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-servicecatalog-two-products": { + "id": "integ-servicecatalog-two-products", + "path": "integ-servicecatalog-two-products", + "children": { + "TestPortfolio": { + "id": "TestPortfolio", + "path": "integ-servicecatalog-two-products/TestPortfolio", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/TestPortfolio/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalog::Portfolio", + "aws:cdk:cloudformation:props": { + "acceptLanguage": "en", + "description": "This is our Service Catalog Portfolio", + "displayName": "TestPortfolio", + "providerName": "TestProvider" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CfnPortfolio", + "version": "0.0.0" + } + }, + "PortfolioProductAssociation0cb6a303fbbc": { + "id": "PortfolioProductAssociation0cb6a303fbbc", + "path": "integ-servicecatalog-two-products/TestPortfolio/PortfolioProductAssociation0cb6a303fbbc", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalog::PortfolioProductAssociation", + "aws:cdk:cloudformation:props": { + "portfolioId": { + "Ref": "TestPortfolio4AC794EB" + }, + "productId": { + "Ref": "Product133E85955" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CfnPortfolioProductAssociation", + "version": "0.0.0" + } + }, + "PortfolioProductAssociation8b0f551963a9": { + "id": "PortfolioProductAssociation8b0f551963a9", + "path": "integ-servicecatalog-two-products/TestPortfolio/PortfolioProductAssociation8b0f551963a9", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalog::PortfolioProductAssociation", + "aws:cdk:cloudformation:props": { + "portfolioId": { + "Ref": "TestPortfolio4AC794EB" + }, + "productId": { + "Ref": "Product2828D9765" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CfnPortfolioProductAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.Portfolio", + "version": "0.0.0" + } + }, + "TestAssetBucket": { + "id": "TestAssetBucket", + "path": "integ-servicecatalog-two-products/TestAssetBucket", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/TestAssetBucket/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": { + "bucketName": "product-stack-asset-bucket-12345678-test-region", + "tags": [ + { + "key": "aws-cdk:auto-delete-objects", + "value": "true" + }, + { + "key": "aws-cdk:cr-owned:8a3b3620", + "value": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.CfnBucket", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "integ-servicecatalog-two-products/TestAssetBucket/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/TestAssetBucket/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", + "aws:cdk:cloudformation:props": { + "bucket": { + "Ref": "TestAssetBucket9434EFAE" + }, + "policyDocument": { + "Statement": [ + { + "Action": [ + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + } + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", + "version": "0.0.0" + } + }, + "AutoDeleteObjectsCustomResource": { + "id": "AutoDeleteObjectsCustomResource", + "path": "integ-servicecatalog-two-products/TestAssetBucket/AutoDeleteObjectsCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "integ-servicecatalog-two-products/TestAssetBucket/AutoDeleteObjectsCustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + }, + "ProductAssetsDeployment": { + "id": "ProductAssetsDeployment", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment", + "children": { + "AwsCliLayer": { + "id": "AwsCliLayer", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer", + "children": { + "Code": { + "id": "Code", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/AwsCliLayer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", + "aws:cdk:cloudformation:props": { + "content": { + "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" + }, + "description": "/opt/awscli/aws" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnLayerVersion", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.lambda_layer_awscli.AwsCliLayer", + "version": "0.0.0" + } + }, + "CustomResourceHandler": { + "id": "CustomResourceHandler", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/CustomResourceHandler", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "CustomResource": { + "id": "CustomResource", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/CustomResource", + "children": { + "Default": { + "id": "Default", + "path": "integ-servicecatalog-two-products/TestAssetBucket/ProductAssetsDeployment/CustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_deployment.BucketDeployment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.Bucket", + "version": "0.0.0" + } + }, + "Custom::S3AutoDeleteObjectsCustomResourceProvider": { + "id": "Custom::S3AutoDeleteObjectsCustomResourceProvider", + "path": "integ-servicecatalog-two-products/Custom::S3AutoDeleteObjectsCustomResourceProvider", + "children": { + "Staging": { + "id": "Staging", + "path": "integ-servicecatalog-two-products/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "integ-servicecatalog-two-products/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "integ-servicecatalog-two-products/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResourceProvider", + "version": "0.0.0" + } + }, + "MyProductStack1": { + "id": "MyProductStack1", + "path": "integ-servicecatalog-two-products/MyProductStack1", + "children": { + "HelloHandler": { + "id": "HelloHandler", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/MyProductStack1/HelloHandler/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": "product-stack-asset-bucket-12345678-test-region", + "s3Key": "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "HelloHandlerServiceRole11EF7C63", + "Arn" + ] + }, + "runtime": "python3.9" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + }, + "ParentAssetBucket": { + "id": "ParentAssetBucket", + "path": "integ-servicecatalog-two-products/MyProductStack1/ParentAssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.ProductStack", + "version": "0.0.0" + } + }, + "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": { + "id": "Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::cdk-hnb659fds-assets-12345678-test-region" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::cdk-hnb659fds-assets-12345678-test-region/*" + ] + ] + } + ] + }, + { + "Action": [ + "s3:Abort*", + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TestAssetBucket9434EFAE", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", + "roles": [ + { + "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", + "s3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip" + }, + "environment": { + "variables": { + "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" + } + }, + "handler": "index.handler", + "layers": [ + { + "Ref": "TestAssetBucketProductAssetsDeploymentAwsCliLayerD1E52C82" + } + ], + "role": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", + "Arn" + ] + }, + "runtime": "python3.9", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + }, + "Product1": { + "id": "Product1", + "path": "integ-servicecatalog-two-products/Product1", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/Product1/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalog::CloudFormationProduct", + "aws:cdk:cloudformation:props": { + "name": "Prod 1", + "owner": "Owner 1", + "provisioningArtifactParameters": [ + { + "name": "v1", + "disableTemplateValidation": false, + "info": { + "LoadTemplateFromURL": { + "Fn::Sub": "https://s3.test-region.${AWS::URLSuffix}/cdk-hnb659fds-assets-12345678-test-region/e3d02db86c0d1baccd824dbe984b3e37153502d8511f859c5664c716dc4ca3c9.json" + } + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CfnCloudFormationProduct", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CloudFormationProduct", + "version": "0.0.0" + } + }, + "MyProductStack2": { + "id": "MyProductStack2", + "path": "integ-servicecatalog-two-products/MyProductStack2", + "children": { + "HelloHandler2": { + "id": "HelloHandler2", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/MyProductStack2/HelloHandler2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": "product-stack-asset-bucket-12345678-test-region", + "s3Key": "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.zip" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "HelloHandler2ServiceRole37B1402D", + "Arn" + ] + }, + "runtime": "python3.9" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + }, + "ParentAssetBucket": { + "id": "ParentAssetBucket", + "path": "integ-servicecatalog-two-products/MyProductStack2/ParentAssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.ProductStack", + "version": "0.0.0" + } + }, + "Product2": { + "id": "Product2", + "path": "integ-servicecatalog-two-products/Product2", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalog-two-products/Product2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalog::CloudFormationProduct", + "aws:cdk:cloudformation:props": { + "name": "Prod 2", + "owner": "Owner 2", + "provisioningArtifactParameters": [ + { + "name": "v1", + "disableTemplateValidation": false, + "info": { + "LoadTemplateFromURL": { + "Fn::Sub": "https://s3.test-region.${AWS::URLSuffix}/cdk-hnb659fds-assets-12345678-test-region/ff5d7c5889c1c3e06b0d5ec1e9cae941ed44715b96e8872c9b2eb2af322cf4d3.json" + } + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CfnCloudFormationProduct", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_servicecatalog.CloudFormationProduct", + "version": "0.0.0" + } + }, + "PortfolioId": { + "id": "PortfolioId", + "path": "integ-servicecatalog-two-products/PortfolioId", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-servicecatalog-two-products/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-servicecatalog-two-products/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "integ-product": { + "id": "integ-product", + "path": "integ-product", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "integ-product/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "integ-product/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "integ-product/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-product/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-product/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.ts new file mode 100644 index 0000000000000..f66f6b6060301 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.two-products.ts @@ -0,0 +1,101 @@ +import * as path from 'path'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import * as s3 from 'aws-cdk-lib/aws-s3'; +import * as cdk from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as servicecatalog from 'aws-cdk-lib/aws-servicecatalog'; +import { ProductStackProps } from 'aws-cdk-lib/aws-servicecatalog'; +import { Construct } from 'constructs'; + +/* + See integ.product.ts for instructions on how to test successful deployments by hand + */ + +class PortfolioStack extends cdk.Stack { + constructor(scope: Construct, id: string, props: cdk.StackProps) { + super(scope, id, props); + + const portfolio = new servicecatalog.Portfolio(this, 'TestPortfolio', { + displayName: 'TestPortfolio', + providerName: 'TestProvider', + description: 'This is our Service Catalog Portfolio', + messageLanguage: servicecatalog.MessageLanguage.EN, + }); + + const testAssetBucket = new s3.Bucket(this, 'TestAssetBucket', { + bucketName: `product-stack-asset-bucket-${this.account}-${this.region}`, + removalPolicy: cdk.RemovalPolicy.DESTROY, + autoDeleteObjects: true, + }); + + portfolio.addProduct(new servicecatalog.CloudFormationProduct(this, 'Product1', { + productName: 'Prod 1', + owner: 'Owner 1', + productVersions: [{ + productVersionName: 'v1', + cloudFormationTemplate: servicecatalog.CloudFormationTemplate.fromProductStack( + new TestAssetProductStack1(this, 'MyProductStack1', { + assetBucket: testAssetBucket, + }), + ), + }], + })); + + portfolio.addProduct(new servicecatalog.CloudFormationProduct(this, 'Product2', { + productName: 'Prod 2', + owner: 'Owner 2', + productVersions: [{ + productVersionName: 'v1', + cloudFormationTemplate: servicecatalog.CloudFormationTemplate.fromProductStack( + new TestAssetProductStack2(this, 'MyProductStack2', { + assetBucket: testAssetBucket, + }), + ), + }], + })); + + new cdk.CfnOutput(this, 'PortfolioId', { value: portfolio.portfolioId }); + } +} + +class TestAssetProductStack1 extends servicecatalog.ProductStack { + constructor(scope: any, id: string, props?: ProductStackProps) { + super(scope, id, props); + + new lambda.Function(this, 'HelloHandler', { + runtime: lambda.Runtime.PYTHON_3_9, + code: lambda.Code.fromAsset(path.join(__dirname, './assets')), + handler: 'index.handler', + }); + } +} + +class TestAssetProductStack2 extends servicecatalog.ProductStack { + constructor(scope: any, id: string, props?: ProductStackProps) { + super(scope, id, props); + + new lambda.Function(this, 'HelloHandler2', { + runtime: lambda.Runtime.PYTHON_3_9, + code: lambda.Code.fromAsset(path.join(__dirname, './assetsv2')), + handler: 'index.handler', + }); + } +} + +const app = new cdk.App(); +const stack = new PortfolioStack(app, 'integ-servicecatalog-two-products', { + env: { + account: process.env.CDK_INTEG_ACCOUNT ?? process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_INTEG_REGION ?? process.env.CDK_DEFAULT_REGION, + }, +}); + +new IntegTest(app, 'integ-product', { + testCases: [stack], + diffAssets: true, + enableLookups: true, + stackUpdateWorkflow: false, +}); + +app.synth(); + diff --git a/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts b/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts index 2d05c28498b54..bb30678dcb525 100644 --- a/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts @@ -519,7 +519,10 @@ export class BucketDeployment extends Construct { * deployment.addSource(s3deploy.Source.asset('./another-asset')); */ public addSource(source: ISource): void { - this.sources.push(source.bind(this, { handlerRole: this.handlerRole })); + const config = source.bind(this, { handlerRole: this.handlerRole }); + if (!this.sources.some((c) => sourceConfigEqual(cdk.Stack.of(this), c, config))) { + this.sources.push(config); + } } private renderUniqueId(memoryLimit?: number, ephemeralStorageSize?: cdk.Size, vpc?: ec2.IVpc) { @@ -869,3 +872,10 @@ export interface UserDefinedObjectMetadata { */ readonly [key: string]: string; } + +function sourceConfigEqual(stack: cdk.Stack, a: SourceConfig, b: SourceConfig) { + return ( + JSON.stringify(stack.resolve(a.bucket.bucketName)) === JSON.stringify(stack.resolve(b.bucket.bucketName)) + && a.zipObjectKey === b.zipObjectKey + && a.markers === undefined && b.markers === undefined); +} \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-servicecatalog/lib/private/product-stack-synthesizer.ts b/packages/aws-cdk-lib/aws-servicecatalog/lib/private/product-stack-synthesizer.ts index 72056d174de21..8ccfce748b4bc 100644 --- a/packages/aws-cdk-lib/aws-servicecatalog/lib/private/product-stack-synthesizer.ts +++ b/packages/aws-cdk-lib/aws-servicecatalog/lib/private/product-stack-synthesizer.ts @@ -43,7 +43,6 @@ export class ProductStackSynthesizer extends cdk.StackSynthesizer { private readonly assetBucket?: IBucket; private readonly serverSideEncryption? : ServerSideEncryption; private readonly serverSideEncryptionAwsKmsKeyId? : string; - private bucketDeployment?: BucketDeployment; private parentAssetBucket?: IBucket; constructor(props: ProductStackSynthesizerProps) { @@ -52,6 +51,11 @@ export class ProductStackSynthesizer extends cdk.StackSynthesizer { this.assetBucket = props.assetBucket; this.serverSideEncryption = props.serverSideEncryption; this.serverSideEncryptionAwsKmsKeyId = props.serverSideEncryptionAwsKmsKeyId; + + if (this.assetBucket && !cdk.Resource.isOwnedResource(this.assetBucket)) { + cdk.Annotations.of(this.parentStack).addWarningV2('@aws-cdk/aws-servicecatalog:assetsManuallyAddBucketPermissions', '[WARNING] Bucket Policy Permissions cannot be added to' + + ' referenced Bucket. Please make sure your bucket has the correct permissions'); + } } public addFileAsset(asset: cdk.FileAssetSource): cdk.FileAssetLocation { @@ -59,6 +63,7 @@ export class ProductStackSynthesizer extends cdk.StackSynthesizer { throw new Error('An Asset Bucket must be provided to use Assets'); } + // This assumes all assets added to the parent stack's synthesizer go into the same bucket. const location = this.parentStack.synthesizer.addFileAsset(asset); if (!this.parentAssetBucket) { this.parentAssetBucket = Bucket.fromBucketName(this.boundStack, 'ParentAssetBucket', location.bucketName); @@ -73,22 +78,20 @@ export class ProductStackSynthesizer extends cdk.StackSynthesizer { throw new Error('A SSE_KMS encryption must be enabled if you provide KMS Key'); } - if (!this.bucketDeployment) { - if (!cdk.Resource.isOwnedResource(this.assetBucket)) { - cdk.Annotations.of(this.parentStack).addWarningV2('@aws-cdk/aws-servicecatalog:assetsManuallyAddBucketPermissions', '[WARNING] Bucket Policy Permissions cannot be added to' + - ' referenced Bucket. Please make sure your bucket has the correct permissions'); - } - this.bucketDeployment = new BucketDeployment(this.parentStack, 'AssetsBucketDeployment', { + // Multiple Products deploying into the same bucket will use the same 'BucketDeployment' construct. + const deploymentScope = this.assetBucket; + const deploymentCid = 'ProductAssetsDeployment'; + const bucketDeployment = deploymentScope.node.tryFindChild(deploymentCid) as BucketDeployment | undefined + ?? new BucketDeployment(deploymentScope, deploymentCid, { sources: [source], destinationBucket: this.assetBucket, extract: false, prune: false, + retainOnDelete: true, serverSideEncryption: this.serverSideEncryption, serverSideEncryptionAwsKmsKeyId: this.serverSideEncryptionAwsKmsKeyId, }); - } else { - this.bucketDeployment.addSource(source); - } + bucketDeployment.addSource(source); const bucketName = this.physicalNameOfBucket(this.assetBucket); if (!asset.fileName) { diff --git a/packages/aws-cdk-lib/aws-servicecatalog/test/portfolio.test.ts b/packages/aws-cdk-lib/aws-servicecatalog/test/portfolio.test.ts index 3f76f93c601c0..a7034e5e1689f 100644 --- a/packages/aws-cdk-lib/aws-servicecatalog/test/portfolio.test.ts +++ b/packages/aws-cdk-lib/aws-servicecatalog/test/portfolio.test.ts @@ -249,7 +249,7 @@ describe('Portfolio', () => { }], }, }); - }), + }); test('portfolio share with share tagOptions', () => { const shareAccountId = '012345678901'; diff --git a/packages/aws-cdk-lib/aws-servicecatalog/test/product-stack.test.ts b/packages/aws-cdk-lib/aws-servicecatalog/test/product-stack.test.ts index 0ee71cafc4126..956fa49729f56 100644 --- a/packages/aws-cdk-lib/aws-servicecatalog/test/product-stack.test.ts +++ b/packages/aws-cdk-lib/aws-servicecatalog/test/product-stack.test.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; import { Construct } from 'constructs'; -import { Template } from '../../assertions'; +import { Match, Template } from '../../assertions'; import * as kms from '../../aws-kms'; import * as lambda from '../../aws-lambda'; import * as s3 from '../../aws-s3'; @@ -26,23 +26,15 @@ describe('ProductStack', () => { test('Used defined Asset bucket in product stack with assets', () => { // GIVEN - const app = new cdk.App( - { outdir: 'cdk.out' }, - ); + const app = new cdk.App(); const mainStack = new cdk.Stack(app, 'MyStack'); const testAssetBucket = new s3.Bucket(mainStack, 'TestAssetBucket', { bucketName: 'test-asset-bucket', }); - const productStack = new servicecatalog.ProductStack(mainStack, 'MyProductStack', { + const productStack = new ProductWithAnAsset(mainStack, 'MyProductStack', { assetBucket: testAssetBucket, }); - new lambda.Function(productStack, 'HelloHandler', { - runtime: lambda.Runtime.PYTHON_3_9, - code: lambda.Code.fromAsset(path.join(__dirname, 'assets')), - handler: 'index.handler', - }); - // WHEN const assembly = app.synth(); @@ -66,16 +58,10 @@ describe('ProductStack', () => { const testAssetBucket = new s3.Bucket(mainStack, 'TestAssetBucket', { bucketName: 'test-asset-bucket', }); - const productStack = new servicecatalog.ProductStack(mainStack, 'MyProductStackAbsolutePath', { + new ProductWithAnAsset(mainStack, 'MyProductStackAbsolutePath', { assetBucket: testAssetBucket, }); - new lambda.Function(productStack, 'HelloHandler', { - runtime: lambda.Runtime.PYTHON_3_9, - code: lambda.Code.fromAsset(path.join(__dirname, 'assets')), - handler: 'index.handler', - }); - // WHEN const assembly = app.synth(); @@ -86,7 +72,6 @@ describe('ProductStack', () => { test('Used defined Asset bucket in product stack with nested assets', () => { // GIVEN const app = new cdk.App( - { outdir: 'cdk.out' }, ); const mainStack = new cdk.Stack(app, 'MyStack'); let templateFileUrl = ''; @@ -202,9 +187,7 @@ describe('ProductStack', () => { test('fails if bucketName is not specified in product stack with assets', () => { // GIVEN - const app = new cdk.App( - { outdir: 'cdk.out' }, - ); + const app = new cdk.App(); const mainStack = new cdk.Stack(app, 'MyStack'); const testAssetBucket = new s3.Bucket(mainStack, 'TestAssetBucket', { }); @@ -384,17 +367,11 @@ describe('ProductStack', () => { bucketName: 'test-asset-bucket', encryption: BucketEncryption.S3_MANAGED, }); - const productStack = new servicecatalog.ProductStack(mainStack, 'MyProductStack', { + const productStack = new ProductWithAnAsset(mainStack, 'MyProductStack', { assetBucket: testAssetBucket, serverSideEncryption: ServerSideEncryption.AES_256, }); - new lambda.Function(productStack, 'HelloHandler', { - runtime: lambda.Runtime.PYTHON_3_9, - code: lambda.Code.fromAsset(path.join(__dirname, 'assets')), - handler: 'index.handler', - }); - // WHEN const assembly = app.synth(); @@ -407,4 +384,71 @@ describe('ProductStack', () => { }, }); }); + + test('Two product stacks with assets in the same portfolio', () => { + // GIVEN + const app = new cdk.App(); + const mainStack = new cdk.Stack(app, 'MyStack'); + const testAssetBucket = new s3.Bucket(mainStack, 'TestAssetBucket', { + bucketName: 'test-asset-bucket', + encryption: BucketEncryption.S3_MANAGED, + }); + + const portfolio = new servicecatalog.Portfolio(mainStack, 'Portfolio', { + displayName: 'MyPortfolio', + providerName: 'MyProvider', + }); + + portfolio.addProduct(new servicecatalog.CloudFormationProduct(mainStack, 'Product1', { + productName: 'Prod 1', + owner: 'Owner 1', + productVersions: [{ + productVersionName: 'v1', + cloudFormationTemplate: servicecatalog.CloudFormationTemplate.fromProductStack( + new ProductWithAnAsset(mainStack, 'MyProductStack1', { + assetBucket: testAssetBucket, + }), + ), + }], + })); + portfolio.addProduct(new servicecatalog.CloudFormationProduct(mainStack, 'Product2', { + productName: 'Prod 2', + owner: 'Owner 2', + productVersions: [{ + productVersionName: 'v1', + cloudFormationTemplate: servicecatalog.CloudFormationTemplate.fromProductStack( + new ProductWithAnAsset(mainStack, 'MyProductStack2', { + assetBucket: testAssetBucket, + description: 'Just a description to make the asset definitely different', + }), + ), + }], + })); + + // WHEN + app.synth(); + + // THEN - should not throw, and there will be a single CDKBucketDeployment + const template = Template.fromStack(mainStack); + template.hasResourceProperties('Custom::CDKBucketDeployment', { + SourceObjectKeys: [ + // Don't care what the key is, as long as there is only one element in the array; both products use the exact + // same asset so it only needs to be copied once. + Match.anyValue(), + ], + }); + }); }); + +class ProductWithAnAsset extends servicecatalog.ProductStack { + constructor(scope: Construct, id: string, props: servicecatalog.ProductStackProps & { description?: string }) { + super(scope, id, props); + + new lambda.Function(this, 'HelloHandler', { + runtime: lambda.Runtime.PYTHON_3_9, + description: props.description, + code: lambda.Code.fromAsset(path.join(__dirname, 'assets')), + handler: 'index.handler', + }); + } +} \ No newline at end of file