From 17211d0e4bdc7479b82b3b5cd85c7f924d62ec0a Mon Sep 17 00:00:00 2001 From: Matthew Hawkins Date: Thu, 14 Mar 2024 21:43:14 -0700 Subject: [PATCH] Added new integ test --- ...efaultTestDeployAssert1621E45D.assets.json | 19 + ...aultTestDeployAssert1621E45D.template.json | 36 ++ ...aws-appconfig-multi-config-env.assets.json | 19 + ...s-appconfig-multi-config-env.template.json | 156 ++++++++ .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 161 +++++++++ .../tree.json | 334 ++++++++++++++++++ .../test/integ.multi-config-env.ts | 44 +++ 9 files changed, 782 insertions(+) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets.json new file mode 100644 index 0000000000000..bcfd14bc7d20a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.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-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.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-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.assets.json new file mode 100644 index 0000000000000..6b8622f47adc9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "ebc42c894086c85ac3a2ea694b62aa368f6bc0556f3fe3f0a2edb2b93d5d8d74": { + "source": { + "path": "aws-appconfig-multi-config-env.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ebc42c894086c85ac3a2ea694b62aa368f6bc0556f3fe3f0a2edb2b93d5d8d74.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-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.template.json new file mode 100644 index 0000000000000..410942d6012ec --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/aws-appconfig-multi-config-env.template.json @@ -0,0 +1,156 @@ +{ + "Resources": { + "MyApplicationForEnv1F597ED9": { + "Type": "AWS::AppConfig::Application", + "Properties": { + "Name": "awsappconfigmulticonfigenv-MyApplicationForEnv-1EE3EA95" + } + }, + "MultiConfigEnvironment5F41B747": { + "Type": "AWS::AppConfig::Environment", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "Name": "awsappconfigmulticonfigenv-MultiConfigEnvironment-59525230" + } + }, + "QuickDeploymentStrategy980252EC": { + "Type": "AWS::AppConfig::DeploymentStrategy", + "Properties": { + "DeploymentDurationInMinutes": 1, + "GrowthFactor": 50, + "GrowthType": "LINEAR", + "Name": "awsappconfigmulticonfigenv-QuickDeploymentStrategy-CAB72574", + "ReplicateTo": "NONE" + } + }, + "MyFirstConfigConfigurationProfileAB11F87A": { + "Type": "AWS::AppConfig::ConfigurationProfile", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "LocationUri": "hosted", + "Name": "awsappconfigmulticonfigenv-MyFirstConfig-2FF7CAAB" + } + }, + "MyFirstConfig117AFBAC": { + "Type": "AWS::AppConfig::HostedConfigurationVersion", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "ConfigurationProfileId": { + "Ref": "MyFirstConfigConfigurationProfileAB11F87A" + }, + "Content": "first config content", + "ContentType": "application/octet-stream" + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "MyFirstConfigDeployment5AEBAD52B8EE4": { + "Type": "AWS::AppConfig::Deployment", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "ConfigurationProfileId": { + "Ref": "MyFirstConfigConfigurationProfileAB11F87A" + }, + "ConfigurationVersion": { + "Ref": "MyFirstConfig117AFBAC" + }, + "DeploymentStrategyId": { + "Ref": "QuickDeploymentStrategy980252EC" + }, + "EnvironmentId": { + "Ref": "MultiConfigEnvironment5F41B747" + } + } + }, + "MySecondConfigConfigurationProfileD0CC1BAA": { + "Type": "AWS::AppConfig::ConfigurationProfile", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "LocationUri": "hosted", + "Name": "awsappconfigmulticonfigenv-MySecondConfig-4F837809" + } + }, + "MySecondConfig28DEBAC4": { + "Type": "AWS::AppConfig::HostedConfigurationVersion", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "ConfigurationProfileId": { + "Ref": "MySecondConfigConfigurationProfileD0CC1BAA" + }, + "Content": "second config content", + "ContentType": "application/octet-stream" + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "MySecondConfigDeployment5AEBAD1470BE4": { + "Type": "AWS::AppConfig::Deployment", + "Properties": { + "ApplicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "ConfigurationProfileId": { + "Ref": "MySecondConfigConfigurationProfileD0CC1BAA" + }, + "ConfigurationVersion": { + "Ref": "MySecondConfig28DEBAC4" + }, + "DeploymentStrategyId": { + "Ref": "QuickDeploymentStrategy980252EC" + }, + "EnvironmentId": { + "Ref": "MultiConfigEnvironment5F41B747" + } + }, + "DependsOn": [ + "MyFirstConfigDeployment5AEBAD52B8EE4" + ] + } + }, + "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-appconfig/test/integ.multi-config-env.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/integ.json new file mode 100644 index 0000000000000..aa013d97752d6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "appconfig-multi-config-env/DefaultTest": { + "stacks": [ + "aws-appconfig-multi-config-env" + ], + "assertionStack": "appconfig-multi-config-env/DefaultTest/DeployAssert", + "assertionStackName": "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/manifest.json new file mode 100644 index 0000000000000..22a3fbb12bb74 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/manifest.json @@ -0,0 +1,161 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-appconfig-multi-config-env.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-appconfig-multi-config-env.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-appconfig-multi-config-env": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-appconfig-multi-config-env.template.json", + "terminationProtection": false, + "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}/ebc42c894086c85ac3a2ea694b62aa368f6bc0556f3fe3f0a2edb2b93d5d8d74.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-appconfig-multi-config-env.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": [ + "aws-appconfig-multi-config-env.assets" + ], + "metadata": { + "/aws-appconfig-multi-config-env/MyApplicationForEnv/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyApplicationForEnv1F597ED9" + } + ], + "/aws-appconfig-multi-config-env/MultiConfigEnvironment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MultiConfigEnvironment5F41B747" + } + ], + "/aws-appconfig-multi-config-env/QuickDeploymentStrategy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "QuickDeploymentStrategy980252EC" + } + ], + "/aws-appconfig-multi-config-env/MyFirstConfig/ConfigurationProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFirstConfigConfigurationProfileAB11F87A" + } + ], + "/aws-appconfig-multi-config-env/MyFirstConfig/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFirstConfig117AFBAC" + } + ], + "/aws-appconfig-multi-config-env/MyFirstConfig/Deployment5AEBA": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFirstConfigDeployment5AEBAD52B8EE4" + } + ], + "/aws-appconfig-multi-config-env/MySecondConfig/ConfigurationProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "MySecondConfigConfigurationProfileD0CC1BAA" + } + ], + "/aws-appconfig-multi-config-env/MySecondConfig/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MySecondConfig28DEBAC4" + } + ], + "/aws-appconfig-multi-config-env/MySecondConfig/Deployment5AEBA": [ + { + "type": "aws:cdk:logicalId", + "data": "MySecondConfigDeployment5AEBAD1470BE4" + } + ], + "/aws-appconfig-multi-config-env/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-appconfig-multi-config-env/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-appconfig-multi-config-env" + }, + "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.template.json", + "terminationProtection": false, + "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": [ + "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.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": [ + "appconfigmulticonfigenvDefaultTestDeployAssert1621E45D.assets" + ], + "metadata": { + "/appconfig-multi-config-env/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/appconfig-multi-config-env/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "appconfig-multi-config-env/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-appconfig/test/integ.multi-config-env.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/tree.json new file mode 100644 index 0000000000000..93e0497afe1a4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.js.snapshot/tree.json @@ -0,0 +1,334 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-appconfig-multi-config-env": { + "id": "aws-appconfig-multi-config-env", + "path": "aws-appconfig-multi-config-env", + "children": { + "MyApplicationForEnv": { + "id": "MyApplicationForEnv", + "path": "aws-appconfig-multi-config-env/MyApplicationForEnv", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-appconfig-multi-config-env/MyApplicationForEnv/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::Application", + "aws:cdk:cloudformation:props": { + "name": "awsappconfigmulticonfigenv-MyApplicationForEnv-1EE3EA95" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "MultiConfigEnvironment": { + "id": "MultiConfigEnvironment", + "path": "aws-appconfig-multi-config-env/MultiConfigEnvironment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-appconfig-multi-config-env/MultiConfigEnvironment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::Environment", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "name": "awsappconfigmulticonfigenv-MultiConfigEnvironment-59525230" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "QuickDeploymentStrategy": { + "id": "QuickDeploymentStrategy", + "path": "aws-appconfig-multi-config-env/QuickDeploymentStrategy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-appconfig-multi-config-env/QuickDeploymentStrategy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::DeploymentStrategy", + "aws:cdk:cloudformation:props": { + "deploymentDurationInMinutes": 1, + "growthFactor": 50, + "growthType": "LINEAR", + "name": "awsappconfigmulticonfigenv-QuickDeploymentStrategy-CAB72574", + "replicateTo": "NONE" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "MyFirstConfig": { + "id": "MyFirstConfig", + "path": "aws-appconfig-multi-config-env/MyFirstConfig", + "children": { + "ConfigurationProfile": { + "id": "ConfigurationProfile", + "path": "aws-appconfig-multi-config-env/MyFirstConfig/ConfigurationProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::ConfigurationProfile", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "locationUri": "hosted", + "name": "awsappconfigmulticonfigenv-MyFirstConfig-2FF7CAAB" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-appconfig-multi-config-env/MyFirstConfig/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::HostedConfigurationVersion", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "configurationProfileId": { + "Ref": "MyFirstConfigConfigurationProfileAB11F87A" + }, + "content": "first config content", + "contentType": "application/octet-stream" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Deployment5AEBA": { + "id": "Deployment5AEBA", + "path": "aws-appconfig-multi-config-env/MyFirstConfig/Deployment5AEBA", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::Deployment", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "configurationProfileId": { + "Ref": "MyFirstConfigConfigurationProfileAB11F87A" + }, + "configurationVersion": { + "Ref": "MyFirstConfig117AFBAC" + }, + "deploymentStrategyId": { + "Ref": "QuickDeploymentStrategy980252EC" + }, + "environmentId": { + "Ref": "MultiConfigEnvironment5F41B747" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "MySecondConfig": { + "id": "MySecondConfig", + "path": "aws-appconfig-multi-config-env/MySecondConfig", + "children": { + "ConfigurationProfile": { + "id": "ConfigurationProfile", + "path": "aws-appconfig-multi-config-env/MySecondConfig/ConfigurationProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::ConfigurationProfile", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "locationUri": "hosted", + "name": "awsappconfigmulticonfigenv-MySecondConfig-4F837809" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-appconfig-multi-config-env/MySecondConfig/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::HostedConfigurationVersion", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "configurationProfileId": { + "Ref": "MySecondConfigConfigurationProfileD0CC1BAA" + }, + "content": "second config content", + "contentType": "application/octet-stream" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Deployment5AEBA": { + "id": "Deployment5AEBA", + "path": "aws-appconfig-multi-config-env/MySecondConfig/Deployment5AEBA", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppConfig::Deployment", + "aws:cdk:cloudformation:props": { + "applicationId": { + "Ref": "MyApplicationForEnv1F597ED9" + }, + "configurationProfileId": { + "Ref": "MySecondConfigConfigurationProfileD0CC1BAA" + }, + "configurationVersion": { + "Ref": "MySecondConfig28DEBAC4" + }, + "deploymentStrategyId": { + "Ref": "QuickDeploymentStrategy980252EC" + }, + "environmentId": { + "Ref": "MultiConfigEnvironment5F41B747" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-appconfig-multi-config-env/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-appconfig-multi-config-env/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "appconfig-multi-config-env": { + "id": "appconfig-multi-config-env", + "path": "appconfig-multi-config-env", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "appconfig-multi-config-env/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "appconfig-multi-config-env/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "appconfig-multi-config-env/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "appconfig-multi-config-env/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "appconfig-multi-config-env/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.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.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.ts new file mode 100644 index 0000000000000..bcacbd18d326e --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.multi-config-env.ts @@ -0,0 +1,44 @@ +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import { App, Duration, Stack } from 'aws-cdk-lib'; +import { Application, ConfigurationContent, DeploymentStrategy, Environment, HostedConfiguration, RolloutStrategy } from 'aws-cdk-lib/aws-appconfig'; + +/** + * Test case: + * - Single Environment + * - Two Configurations + * - Both have non-zero deployment duration + * + * If this was done via the L1 constructs alone, Cfn would fail due to + * violating AppConfig's simultaneous deployment rule. + */ + +const app = new App(); +const stack = new Stack(app, 'aws-appconfig-multi-config-env'); +const application = new Application(stack, 'MyApplicationForEnv'); +const env = new Environment(stack, 'MultiConfigEnvironment', { + application, +}); +const deploymentStrategy = new DeploymentStrategy(stack, 'QuickDeploymentStrategy', + { + rolloutStrategy: RolloutStrategy.linear({ + deploymentDuration: Duration.minutes(1), + growthFactor: 50, + }), + }); + +new HostedConfiguration(stack, 'MyFirstConfig', { + application, + content: ConfigurationContent.fromInline('first config content'), + deploymentStrategy, + deployTo: [env], +}); +new HostedConfiguration(stack, 'MySecondConfig', { + application, + content: ConfigurationContent.fromInline('second config content'), + deploymentStrategy, + deployTo: [env], +}); + +new IntegTest(app, 'appconfig-multi-config-env', { + testCases: [stack], +});