From eca193cb963124f9752495ff1572a12b47f18691 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Mon, 15 May 2023 13:03:41 +0200 Subject: [PATCH 1/9] feat(cloud9): support setting automaticStopTimeMinutes --- packages/@aws-cdk/aws-cloud9-alpha/README.md | 12 ++++++++++++ .../@aws-cdk/aws-cloud9-alpha/lib/environment.ts | 11 +++++++++++ .../test/cloud9.environment.test.ts | 14 ++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/README.md b/packages/@aws-cdk/aws-cloud9-alpha/README.md index 984af19f0426b..a421d769f3076 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/README.md +++ b/packages/@aws-cdk/aws-cloud9-alpha/README.md @@ -134,3 +134,15 @@ new cloud9.Ec2Environment(this, 'C9Env', { owner: cloud9.Owner.user(user) }) ``` +## Auto-Hibernation +A Cloud9 environemnt can automatically start and stop the associated EC2 instance to reduce costs. + +Use `automaticStopTimeMinutes` to specify the number of minutes until the running instance is shut down after the environment was last used. + +```ts +const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); +new cloud9.Ec2Environment(this, 'Cloud9Env2', { + vpc: defaultVpc, + imageId: cloud9.ImageId.AMAZON_LINUX_2, + automaticStopTimeMinutes: 30, +}); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts b/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts index 75631762da5d8..d8d57e0b51213 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts @@ -124,6 +124,16 @@ export interface Ec2EnvironmentProps { * */ readonly imageId: ImageId + + /** + * The number of minutes until the running instance is shut down after the + * environment was last used. + * + * Setting a value of 0 means the instance will never be automatically shut down." + * + * @default - The instance will not be shut down automatically. + */ + readonly automaticStopTimeMinutes?: number } /** @@ -200,6 +210,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { })) : undefined, connectionType: props.connectionType ?? ConnectionType.CONNECT_SSH, imageId: props.imageId, + automaticStopTimeMinutes: props.automaticStopTimeMinutes, }); this.environmentId = c9env.ref; this.ec2EnvironmentArn = c9env.getAtt('Arn').toString(); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts index 465c8a947ab35..d919534b9969f 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts @@ -145,6 +145,20 @@ test('environment owner can be account root', () => { }); }); +test('can set automaticStopTimeMinutes', () => { + // WHEN + const automaticStopTimeMinutes = 30; + new cloud9.Ec2Environment(stack, 'C9Env', { + vpc, + imageId: cloud9.ImageId.AMAZON_LINUX_2, + automaticStopTimeMinutes, + }); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { + AutomaticStopTimeMinutes: automaticStopTimeMinutes, + }); +}); + test.each([ [ConnectionType.CONNECT_SSH, 'CONNECT_SSH'], [ConnectionType.CONNECT_SSM, 'CONNECT_SSM'], From 88f9f6b43e97707b597b8a3d1eb1dcd26cb7c188 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Fri, 26 May 2023 09:55:04 +0000 Subject: [PATCH 2/9] test: add integ test and snapshot --- ...9AutomaticStopTimeMinutesStack.assets.json | 19 + ...utomaticStopTimeMinutesStack.template.json | 432 ++++++++++ .../cdk.out | 1 + ...efaultTestDeployAssertBBFEEF89.assets.json | 19 + ...aultTestDeployAssertBBFEEF89.template.json | 36 + .../integ.json | 12 + .../manifest.json | 249 ++++++ .../tree.json | 742 ++++++++++++++++++ .../test/integ.automatic-stop-time-minutes.ts | 35 + 9 files changed, 1545 insertions(+) create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json new file mode 100644 index 0000000000000..565abddae9837 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "31.0.0", + "files": { + "b4ace33442eb5fb8a32765fb178c8b0cb78d32ae32217070deb47be21b72ce44": { + "source": { + "path": "C9AutomaticStopTimeMinutesStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b4ace33442eb5fb8a32765fb178c8b0cb78d32ae32217070deb47be21b72ce44.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/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json new file mode 100644 index 0000000000000..fa49d62780da5 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json @@ -0,0 +1,432 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "C9AutomaticStopTimeMinutesStack/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "C9EnvF05FC3BE": { + "Type": "AWS::Cloud9::EnvironmentEC2", + "Properties": { + "InstanceType": "t2.micro", + "AutomaticStopTimeMinutes": 30, + "ConnectionType": "CONNECT_SSH", + "ImageId": "amazonlinux-2-x86_64", + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + } + }, + "Outputs": { + "URL": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "AWS::Region" + }, + ".console.aws.amazon.com/cloud9/ide/", + { + "Ref": "C9EnvF05FC3BE" + } + ] + ] + } + }, + "ARN": { + "Value": { + "Fn::GetAtt": [ + "C9EnvF05FC3BE", + "Arn" + ] + } + } + }, + "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/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out new file mode 100644 index 0000000000000..7925065efbcc4 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"31.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json new file mode 100644 index 0000000000000..aa9ae9d1aec03 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json @@ -0,0 +1,19 @@ +{ + "version": "31.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.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/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.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/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json new file mode 100644 index 0000000000000..7c96ee7f6e18d --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "31.0.0", + "testCases": { + "cloud-9-automatic-stop-time-mintues/DefaultTest": { + "stacks": [ + "C9AutomaticStopTimeMinutesStack" + ], + "assertionStack": "cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert", + "assertionStackName": "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json new file mode 100644 index 0000000000000..79062a2d81eb2 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json @@ -0,0 +1,249 @@ +{ + "version": "31.0.0", + "artifacts": { + "C9AutomaticStopTimeMinutesStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "C9AutomaticStopTimeMinutesStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "C9AutomaticStopTimeMinutesStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "C9AutomaticStopTimeMinutesStack.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}/b4ace33442eb5fb8a32765fb178c8b0cb78d32ae32217070deb47be21b72ce44.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "C9AutomaticStopTimeMinutesStack.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": [ + "C9AutomaticStopTimeMinutesStack.assets" + ], + "metadata": { + "/C9AutomaticStopTimeMinutesStack/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/C9AutomaticStopTimeMinutesStack/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/C9AutomaticStopTimeMinutesStack/C9Env/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "C9EnvF05FC3BE" + } + ], + "/C9AutomaticStopTimeMinutesStack/URL": [ + { + "type": "aws:cdk:logicalId", + "data": "URL" + } + ], + "/C9AutomaticStopTimeMinutesStack/ARN": [ + { + "type": "aws:cdk:logicalId", + "data": "ARN" + } + ], + "/C9AutomaticStopTimeMinutesStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/C9AutomaticStopTimeMinutesStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "C9AutomaticStopTimeMinutesStack" + }, + "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.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": [ + "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.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": [ + "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets" + ], + "metadata": { + "/cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json new file mode 100644 index 0000000000000..49cc0887f35e0 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json @@ -0,0 +1,742 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "C9AutomaticStopTimeMinutesStack": { + "id": "C9AutomaticStopTimeMinutesStack", + "path": "C9AutomaticStopTimeMinutesStack", + "children": { + "VPC": { + "id": "VPC", + "path": "C9AutomaticStopTimeMinutesStack/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "C9AutomaticStopTimeMinutesStack/VPC/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "C9AutomaticStopTimeMinutesStack/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "C9AutomaticStopTimeMinutesStack/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "C9AutomaticStopTimeMinutesStack/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "C9Env": { + "id": "C9Env", + "path": "C9AutomaticStopTimeMinutesStack/C9Env", + "children": { + "Resource": { + "id": "Resource", + "path": "C9AutomaticStopTimeMinutesStack/C9Env/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Cloud9::EnvironmentEC2", + "aws:cdk:cloudformation:props": { + "instanceType": "t2.micro", + "automaticStopTimeMinutes": 30, + "connectionType": "CONNECT_SSH", + "imageId": "amazonlinux-2-x86_64", + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloud9.CfnEnvironmentEC2", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloud9-alpha.Ec2Environment", + "version": "0.0.0" + } + }, + "URL": { + "id": "URL", + "path": "C9AutomaticStopTimeMinutesStack/URL", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "ARN": { + "id": "ARN", + "path": "C9AutomaticStopTimeMinutesStack/ARN", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "C9AutomaticStopTimeMinutesStack/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "C9AutomaticStopTimeMinutesStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "cloud-9-automatic-stop-time-mintues": { + "id": "cloud-9-automatic-stop-time-mintues", + "path": "cloud-9-automatic-stop-time-mintues", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cloud-9-automatic-stop-time-mintues/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cloud-9-automatic-stop-time-mintues/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.17" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cloud-9-automatic-stop-time-mintues/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.17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts new file mode 100644 index 0000000000000..f855b60495960 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts @@ -0,0 +1,35 @@ +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as cdk from 'aws-cdk-lib'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as constructs from 'constructs'; +import * as cloud9 from '../lib'; + +export class Cloud9Env extends cdk.Stack { + constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const vpc = new ec2.Vpc(this, 'VPC', { + restrictDefaultSecurityGroup: false, + maxAzs: 2, + natGateways: 1, + }); + + // create a cloud9 ec2 environment in a new VPC + const c9env = new cloud9.Ec2Environment(this, 'C9Env', { + vpc, + automaticStopTimeMinutes: 30, + imageId: cloud9.ImageId.AMAZON_LINUX_2, + }); + new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); + new cdk.CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); + } +} + +const app = new cdk.App(); +const stack = new Cloud9Env(app, 'C9AutomaticStopTimeMinutesStack'); + +new integ.IntegTest(app, 'cloud-9-automatic-stop-time-mintues', { + testCases: [stack], +}); + +app.synth(); From d217210db4bd60a8912274dc26b678cd4e636898 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Fri, 26 May 2023 10:24:39 +0000 Subject: [PATCH 3/9] fix missing blank line --- packages/@aws-cdk/aws-cloud9-alpha/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/README.md b/packages/@aws-cdk/aws-cloud9-alpha/README.md index a421d769f3076..7ba5cfe1c5608 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/README.md +++ b/packages/@aws-cdk/aws-cloud9-alpha/README.md @@ -134,6 +134,7 @@ new cloud9.Ec2Environment(this, 'C9Env', { owner: cloud9.Owner.user(user) }) ``` + ## Auto-Hibernation A Cloud9 environemnt can automatically start and stop the associated EC2 instance to reduce costs. From 27acfc31a9c464ff0205a79f69cf050216bd2c35 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Fri, 26 May 2023 10:58:59 +0000 Subject: [PATCH 4/9] fix missing blank line --- packages/@aws-cdk/aws-cloud9-alpha/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/README.md b/packages/@aws-cdk/aws-cloud9-alpha/README.md index 7ba5cfe1c5608..f949c201ff081 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/README.md +++ b/packages/@aws-cdk/aws-cloud9-alpha/README.md @@ -136,6 +136,7 @@ new cloud9.Ec2Environment(this, 'C9Env', { ``` ## Auto-Hibernation + A Cloud9 environemnt can automatically start and stop the associated EC2 instance to reduce costs. Use `automaticStopTimeMinutes` to specify the number of minutes until the running instance is shut down after the environment was last used. From b2252e34f123f10ab56dde9bfae34d67dc499366 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Sun, 28 May 2023 18:17:57 +0000 Subject: [PATCH 5/9] Refactor: Use CDK.duration instead of number --- packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts | 4 ++-- .../@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts | 4 ++-- .../test/integ.automatic-stop-time-minutes.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts b/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts index 01c6af22139ca..a6a3b707dbbc2 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts @@ -133,7 +133,7 @@ export interface Ec2EnvironmentProps { * * @default - The instance will not be shut down automatically. */ - readonly automaticStopTimeMinutes?: number + readonly automaticStopTimeMinutes?: cdk.Duration } /** @@ -210,7 +210,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { })) : undefined, connectionType: props.connectionType ?? ConnectionType.CONNECT_SSH, imageId: props.imageId, - automaticStopTimeMinutes: props.automaticStopTimeMinutes, + automaticStopTimeMinutes: props.automaticStopTimeMinutes?.toMinutes(), }); this.environmentId = c9env.ref; this.ec2EnvironmentArn = c9env.getAtt('Arn').toString(); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts index d919534b9969f..d8780863c96f7 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts @@ -147,7 +147,7 @@ test('environment owner can be account root', () => { test('can set automaticStopTimeMinutes', () => { // WHEN - const automaticStopTimeMinutes = 30; + const automaticStopTimeMinutes = cdk.Duration.minutes(30); new cloud9.Ec2Environment(stack, 'C9Env', { vpc, imageId: cloud9.ImageId.AMAZON_LINUX_2, @@ -155,7 +155,7 @@ test('can set automaticStopTimeMinutes', () => { }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { - AutomaticStopTimeMinutes: automaticStopTimeMinutes, + AutomaticStopTimeMinutes: automaticStopTimeMinutes.toMinutes(), }); }); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts index f855b60495960..963dddba388cc 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts @@ -17,7 +17,7 @@ export class Cloud9Env extends cdk.Stack { // create a cloud9 ec2 environment in a new VPC const c9env = new cloud9.Ec2Environment(this, 'C9Env', { vpc, - automaticStopTimeMinutes: 30, + automaticStopTimeMinutes: cdk.Duration.minutes(30), imageId: cloud9.ImageId.AMAZON_LINUX_2, }); new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); From 9975b360e76831695093314b7be5230313d34b22 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Sun, 28 May 2023 19:19:20 +0000 Subject: [PATCH 6/9] fix: Use cdk.Duration in example --- packages/@aws-cdk/aws-cloud9-alpha/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/README.md b/packages/@aws-cdk/aws-cloud9-alpha/README.md index f949c201ff081..f1951eed72fa9 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/README.md +++ b/packages/@aws-cdk/aws-cloud9-alpha/README.md @@ -146,5 +146,5 @@ const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); new cloud9.Ec2Environment(this, 'Cloud9Env2', { vpc: defaultVpc, imageId: cloud9.ImageId.AMAZON_LINUX_2, - automaticStopTimeMinutes: 30, + automaticStopTimeMinutes: cdk.Duration.minutes(30), }); From 80e38a472939fbdcc8a7736b7b2c198c6345d630 Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Sun, 28 May 2023 21:37:34 +0000 Subject: [PATCH 7/9] fix: import Duration in default fixture --- packages/@aws-cdk/aws-cloud9-alpha/README.md | 2 +- packages/@aws-cdk/aws-cloud9-alpha/rosetta/default.ts-fixture | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/README.md b/packages/@aws-cdk/aws-cloud9-alpha/README.md index f1951eed72fa9..8b81c6fd54a33 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/README.md +++ b/packages/@aws-cdk/aws-cloud9-alpha/README.md @@ -146,5 +146,5 @@ const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); new cloud9.Ec2Environment(this, 'Cloud9Env2', { vpc: defaultVpc, imageId: cloud9.ImageId.AMAZON_LINUX_2, - automaticStopTimeMinutes: cdk.Duration.minutes(30), + automaticStopTimeMinutes: Duration.minutes(30), }); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-cloud9-alpha/rosetta/default.ts-fixture index d5f0a7c1464c8..03ad4fbcf20fb 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/rosetta/default.ts-fixture +++ b/packages/@aws-cdk/aws-cloud9-alpha/rosetta/default.ts-fixture @@ -1,5 +1,5 @@ // Fixture with packages imported, but nothing else -import { CfnOutput, Stack } from 'aws-cdk-lib'; +import { CfnOutput, Duration, Stack } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import * as cloud9 from '@aws-cdk/aws-cloud9-alpha'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; From 680c41e1428a73c9d027b7b0a83a4b20a1fdca1c Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Thu, 1 Jun 2023 14:15:14 +0000 Subject: [PATCH 8/9] refactor: rename from automaticStopTimeMinutes to automaticStop --- packages/@aws-cdk/aws-cloud9-alpha/README.md | 4 +- .../aws-cloud9-alpha/lib/environment.ts | 4 +- .../test/cloud9.environment.test.ts | 8 +- .../cdk.out | 1 - .../C9automaticStopStack.assets.json} | 8 +- .../C9automaticStopStack.template.json} | 24 ++-- .../integ.automatic-stop.js.snapshot/cdk.out | 1 + ...efaultTestDeployAssertBBFEEF89.assets.json | 2 +- ...aultTestDeployAssertBBFEEF89.template.json | 0 .../integ.json | 4 +- .../manifest.json | 70 ++++++------ .../tree.json | 106 +++++++++--------- ...ime-minutes.ts => integ.automatic-stop.ts} | 4 +- 13 files changed, 118 insertions(+), 118 deletions(-) delete mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json => integ.automatic-stop.js.snapshot/C9automaticStopStack.assets.json} (61%) rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json => integ.automatic-stop.js.snapshot/C9automaticStopStack.template.json} (91%) create mode 100644 packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cdk.out rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot => integ.automatic-stop.js.snapshot}/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json (96%) rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot => integ.automatic-stop.js.snapshot}/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json (100%) rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot => integ.automatic-stop.js.snapshot}/integ.json (81%) rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot => integ.automatic-stop.js.snapshot}/manifest.json (75%) rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.js.snapshot => integ.automatic-stop.js.snapshot}/tree.json (85%) rename packages/@aws-cdk/aws-cloud9-alpha/test/{integ.automatic-stop-time-minutes.ts => integ.automatic-stop.ts} (88%) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/README.md b/packages/@aws-cdk/aws-cloud9-alpha/README.md index 8b81c6fd54a33..497b932c101e4 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/README.md +++ b/packages/@aws-cdk/aws-cloud9-alpha/README.md @@ -139,12 +139,12 @@ new cloud9.Ec2Environment(this, 'C9Env', { A Cloud9 environemnt can automatically start and stop the associated EC2 instance to reduce costs. -Use `automaticStopTimeMinutes` to specify the number of minutes until the running instance is shut down after the environment was last used. +Use `automaticStop` to specify the number of minutes until the running instance is shut down after the environment was last used. ```ts const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); new cloud9.Ec2Environment(this, 'Cloud9Env2', { vpc: defaultVpc, imageId: cloud9.ImageId.AMAZON_LINUX_2, - automaticStopTimeMinutes: Duration.minutes(30), + automaticStop: Duration.minutes(30), }); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts b/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts index a6a3b707dbbc2..325dd2374102e 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts @@ -133,7 +133,7 @@ export interface Ec2EnvironmentProps { * * @default - The instance will not be shut down automatically. */ - readonly automaticStopTimeMinutes?: cdk.Duration + readonly automaticStop?: cdk.Duration } /** @@ -210,7 +210,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { })) : undefined, connectionType: props.connectionType ?? ConnectionType.CONNECT_SSH, imageId: props.imageId, - automaticStopTimeMinutes: props.automaticStopTimeMinutes?.toMinutes(), + automaticStopTimeMinutes: props.automaticStop?.toMinutes(), }); this.environmentId = c9env.ref; this.ec2EnvironmentArn = c9env.getAtt('Arn').toString(); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts index d8780863c96f7..feb5cd709fbb1 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts @@ -145,17 +145,17 @@ test('environment owner can be account root', () => { }); }); -test('can set automaticStopTimeMinutes', () => { +test('can set automaticStop', () => { // WHEN - const automaticStopTimeMinutes = cdk.Duration.minutes(30); + const automaticStop = cdk.Duration.minutes(30); new cloud9.Ec2Environment(stack, 'C9Env', { vpc, imageId: cloud9.ImageId.AMAZON_LINUX_2, - automaticStopTimeMinutes, + automaticStop, }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { - AutomaticStopTimeMinutes: automaticStopTimeMinutes.toMinutes(), + automaticStop: automaticStop.toMinutes(), }); }); diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out deleted file mode 100644 index 7925065efbcc4..0000000000000 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"31.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/C9automaticStopStack.assets.json similarity index 61% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/C9automaticStopStack.assets.json index 565abddae9837..923d6eab7313c 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.assets.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/C9automaticStopStack.assets.json @@ -1,15 +1,15 @@ { - "version": "31.0.0", + "version": "32.0.0", "files": { - "b4ace33442eb5fb8a32765fb178c8b0cb78d32ae32217070deb47be21b72ce44": { + "d302c7f90912c93bef6f8fda089adb33206a67ff3bdb6ce885b1f90a7fac7e25": { "source": { - "path": "C9AutomaticStopTimeMinutesStack.template.json", + "path": "C9automaticStopStack.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b4ace33442eb5fb8a32765fb178c8b0cb78d32ae32217070deb47be21b72ce44.json", + "objectKey": "d302c7f90912c93bef6f8fda089adb33206a67ff3bdb6ce885b1f90a7fac7e25.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/C9automaticStopStack.template.json similarity index 91% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/C9automaticStopStack.template.json index fa49d62780da5..be10fee8dffe0 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/C9AutomaticStopTimeMinutesStack.template.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/C9automaticStopStack.template.json @@ -10,7 +10,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC" + "Value": "C9automaticStopStack/VPC" } ] } @@ -42,7 +42,7 @@ }, { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "Value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -56,7 +56,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "Value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -94,7 +94,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "Value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -114,7 +114,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "Value": "C9automaticStopStack/VPC/PublicSubnet1" } ] }, @@ -150,7 +150,7 @@ }, { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + "Value": "C9automaticStopStack/VPC/PublicSubnet2" } ] } @@ -164,7 +164,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + "Value": "C9automaticStopStack/VPC/PublicSubnet2" } ] } @@ -222,7 +222,7 @@ }, { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + "Value": "C9automaticStopStack/VPC/PrivateSubnet1" } ] } @@ -236,7 +236,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + "Value": "C9automaticStopStack/VPC/PrivateSubnet1" } ] } @@ -291,7 +291,7 @@ }, { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + "Value": "C9automaticStopStack/VPC/PrivateSubnet2" } ] } @@ -305,7 +305,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + "Value": "C9automaticStopStack/VPC/PrivateSubnet2" } ] } @@ -339,7 +339,7 @@ "Tags": [ { "Key": "Name", - "Value": "C9AutomaticStopTimeMinutesStack/VPC" + "Value": "C9automaticStopStack/VPC" } ] } diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cdk.out b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cdk.out new file mode 100644 index 0000000000000..f0b901e7c06e5 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"32.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json similarity index 96% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json index aa9ae9d1aec03..c80ab71912cd5 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "32.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.template.json diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/integ.json similarity index 81% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/integ.json index 7c96ee7f6e18d..7a1cf5498f8c2 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/integ.json @@ -1,9 +1,9 @@ { - "version": "31.0.0", + "version": "32.0.0", "testCases": { "cloud-9-automatic-stop-time-mintues/DefaultTest": { "stacks": [ - "C9AutomaticStopTimeMinutesStack" + "C9automaticStopStack" ], "assertionStack": "cloud-9-automatic-stop-time-mintues/DefaultTest/DeployAssert", "assertionStackName": "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89" diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/manifest.json similarity index 75% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/manifest.json index 79062a2d81eb2..1c33fa8553e24 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/manifest.json @@ -1,27 +1,27 @@ { - "version": "31.0.0", + "version": "32.0.0", "artifacts": { - "C9AutomaticStopTimeMinutesStack.assets": { + "C9automaticStopStack.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "C9AutomaticStopTimeMinutesStack.assets.json", + "file": "C9automaticStopStack.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "C9AutomaticStopTimeMinutesStack": { + "C9automaticStopStack": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "C9AutomaticStopTimeMinutesStack.template.json", + "templateFile": "C9automaticStopStack.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}/b4ace33442eb5fb8a32765fb178c8b0cb78d32ae32217070deb47be21b72ce44.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d302c7f90912c93bef6f8fda089adb33206a67ff3bdb6ce885b1f90a7fac7e25.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "C9AutomaticStopTimeMinutesStack.assets" + "C9automaticStopStack.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -30,167 +30,167 @@ } }, "dependencies": [ - "C9AutomaticStopTimeMinutesStack.assets" + "C9automaticStopStack.assets" ], "metadata": { - "/C9AutomaticStopTimeMinutesStack/VPC/Resource": [ + "/C9automaticStopStack/VPC/Resource": [ { "type": "aws:cdk:logicalId", "data": "VPCB9E5F0B4" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/Subnet": [ + "/C9automaticStopStack/VPC/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1SubnetB4246D30" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTable": [ + "/C9automaticStopStack/VPC/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1RouteTableFEE4B781" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTableAssociation": [ + "/C9automaticStopStack/VPC/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/DefaultRoute": [ + "/C9automaticStopStack/VPC/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1DefaultRoute91CEF279" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/EIP": [ + "/C9automaticStopStack/VPC/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1EIP6AD938E8" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/NATGateway": [ + "/C9automaticStopStack/VPC/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1NATGatewayE0556630" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/Subnet": [ + "/C9automaticStopStack/VPC/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2Subnet74179F39" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTable": [ + "/C9automaticStopStack/VPC/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2RouteTable6F1A15F1" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTableAssociation": [ + "/C9automaticStopStack/VPC/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2RouteTableAssociation5A808732" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/DefaultRoute": [ + "/C9automaticStopStack/VPC/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2DefaultRouteB7481BBA" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/Subnet": [ + "/C9automaticStopStack/VPC/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1Subnet8BCA10E0" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTable": [ + "/C9automaticStopStack/VPC/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1RouteTableBE8A6027" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTableAssociation": [ + "/C9automaticStopStack/VPC/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/DefaultRoute": [ + "/C9automaticStopStack/VPC/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/Subnet": [ + "/C9automaticStopStack/VPC/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2SubnetCFCDAA7A" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTable": [ + "/C9automaticStopStack/VPC/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2RouteTable0A19E10E" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTableAssociation": [ + "/C9automaticStopStack/VPC/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/DefaultRoute": [ + "/C9automaticStopStack/VPC/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/IGW": [ + "/C9automaticStopStack/VPC/IGW": [ { "type": "aws:cdk:logicalId", "data": "VPCIGWB7E252D3" } ], - "/C9AutomaticStopTimeMinutesStack/VPC/VPCGW": [ + "/C9automaticStopStack/VPC/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "VPCVPCGW99B986DC" } ], - "/C9AutomaticStopTimeMinutesStack/C9Env/Resource": [ + "/C9automaticStopStack/C9Env/Resource": [ { "type": "aws:cdk:logicalId", "data": "C9EnvF05FC3BE" } ], - "/C9AutomaticStopTimeMinutesStack/URL": [ + "/C9automaticStopStack/URL": [ { "type": "aws:cdk:logicalId", "data": "URL" } ], - "/C9AutomaticStopTimeMinutesStack/ARN": [ + "/C9automaticStopStack/ARN": [ { "type": "aws:cdk:logicalId", "data": "ARN" } ], - "/C9AutomaticStopTimeMinutesStack/BootstrapVersion": [ + "/C9automaticStopStack/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/C9AutomaticStopTimeMinutesStack/CheckBootstrapVersion": [ + "/C9automaticStopStack/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "C9AutomaticStopTimeMinutesStack" + "displayName": "C9automaticStopStack" }, "cloud9automaticstoptimemintuesDefaultTestDeployAssertBBFEEF89.assets": { "type": "cdk:asset-manifest", diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/tree.json similarity index 85% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/tree.json index 49cc0887f35e0..a05d8f05d2c40 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "C9AutomaticStopTimeMinutesStack": { - "id": "C9AutomaticStopTimeMinutesStack", - "path": "C9AutomaticStopTimeMinutesStack", + "C9automaticStopStack": { + "id": "C9automaticStopStack", + "path": "C9automaticStopStack", "children": { "VPC": { "id": "VPC", - "path": "C9AutomaticStopTimeMinutesStack/VPC", + "path": "C9automaticStopStack/VPC", "children": { "Resource": { "id": "Resource", - "path": "C9AutomaticStopTimeMinutesStack/VPC/Resource", + "path": "C9automaticStopStack/VPC/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -25,7 +25,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC" + "value": "C9automaticStopStack/VPC" } ] } @@ -37,11 +37,11 @@ }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1", + "path": "C9automaticStopStack/VPC/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/Subnet", + "path": "C9automaticStopStack/VPC/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -69,7 +69,7 @@ }, { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -81,7 +81,7 @@ }, "Acl": { "id": "Acl", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/Acl", + "path": "C9automaticStopStack/VPC/PublicSubnet1/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -89,7 +89,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTable", + "path": "C9automaticStopStack/VPC/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -99,7 +99,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -111,7 +111,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/RouteTableAssociation", + "path": "C9automaticStopStack/VPC/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -130,7 +130,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/DefaultRoute", + "path": "C9automaticStopStack/VPC/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -150,7 +150,7 @@ }, "EIP": { "id": "EIP", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/EIP", + "path": "C9automaticStopStack/VPC/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -158,7 +158,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -170,7 +170,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1/NATGateway", + "path": "C9automaticStopStack/VPC/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -186,7 +186,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet1" + "value": "C9automaticStopStack/VPC/PublicSubnet1" } ] } @@ -204,11 +204,11 @@ }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2", + "path": "C9automaticStopStack/VPC/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/Subnet", + "path": "C9automaticStopStack/VPC/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -236,7 +236,7 @@ }, { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + "value": "C9automaticStopStack/VPC/PublicSubnet2" } ] } @@ -248,7 +248,7 @@ }, "Acl": { "id": "Acl", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/Acl", + "path": "C9automaticStopStack/VPC/PublicSubnet2/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -256,7 +256,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTable", + "path": "C9automaticStopStack/VPC/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -266,7 +266,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2" + "value": "C9automaticStopStack/VPC/PublicSubnet2" } ] } @@ -278,7 +278,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/RouteTableAssociation", + "path": "C9automaticStopStack/VPC/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -297,7 +297,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PublicSubnet2/DefaultRoute", + "path": "C9automaticStopStack/VPC/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -323,11 +323,11 @@ }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1", + "path": "C9automaticStopStack/VPC/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/Subnet", + "path": "C9automaticStopStack/VPC/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -355,7 +355,7 @@ }, { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + "value": "C9automaticStopStack/VPC/PrivateSubnet1" } ] } @@ -367,7 +367,7 @@ }, "Acl": { "id": "Acl", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/Acl", + "path": "C9automaticStopStack/VPC/PrivateSubnet1/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -375,7 +375,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTable", + "path": "C9automaticStopStack/VPC/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -385,7 +385,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1" + "value": "C9automaticStopStack/VPC/PrivateSubnet1" } ] } @@ -397,7 +397,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/RouteTableAssociation", + "path": "C9automaticStopStack/VPC/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -416,7 +416,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet1/DefaultRoute", + "path": "C9automaticStopStack/VPC/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -442,11 +442,11 @@ }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2", + "path": "C9automaticStopStack/VPC/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/Subnet", + "path": "C9automaticStopStack/VPC/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -474,7 +474,7 @@ }, { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + "value": "C9automaticStopStack/VPC/PrivateSubnet2" } ] } @@ -486,7 +486,7 @@ }, "Acl": { "id": "Acl", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/Acl", + "path": "C9automaticStopStack/VPC/PrivateSubnet2/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -494,7 +494,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTable", + "path": "C9automaticStopStack/VPC/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -504,7 +504,7 @@ "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2" + "value": "C9automaticStopStack/VPC/PrivateSubnet2" } ] } @@ -516,7 +516,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/RouteTableAssociation", + "path": "C9automaticStopStack/VPC/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -535,7 +535,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9AutomaticStopTimeMinutesStack/VPC/PrivateSubnet2/DefaultRoute", + "path": "C9automaticStopStack/VPC/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -561,14 +561,14 @@ }, "IGW": { "id": "IGW", - "path": "C9AutomaticStopTimeMinutesStack/VPC/IGW", + "path": "C9automaticStopStack/VPC/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "C9AutomaticStopTimeMinutesStack/VPC" + "value": "C9automaticStopStack/VPC" } ] } @@ -580,7 +580,7 @@ }, "VPCGW": { "id": "VPCGW", - "path": "C9AutomaticStopTimeMinutesStack/VPC/VPCGW", + "path": "C9automaticStopStack/VPC/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { @@ -605,11 +605,11 @@ }, "C9Env": { "id": "C9Env", - "path": "C9AutomaticStopTimeMinutesStack/C9Env", + "path": "C9automaticStopStack/C9Env", "children": { "Resource": { "id": "Resource", - "path": "C9AutomaticStopTimeMinutesStack/C9Env/Resource", + "path": "C9automaticStopStack/C9Env/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Cloud9::EnvironmentEC2", "aws:cdk:cloudformation:props": { @@ -635,7 +635,7 @@ }, "URL": { "id": "URL", - "path": "C9AutomaticStopTimeMinutesStack/URL", + "path": "C9automaticStopStack/URL", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -643,7 +643,7 @@ }, "ARN": { "id": "ARN", - "path": "C9AutomaticStopTimeMinutesStack/ARN", + "path": "C9automaticStopStack/ARN", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -651,7 +651,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "C9AutomaticStopTimeMinutesStack/BootstrapVersion", + "path": "C9automaticStopStack/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -659,7 +659,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "C9AutomaticStopTimeMinutesStack/CheckBootstrapVersion", + "path": "C9automaticStopStack/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -684,7 +684,7 @@ "path": "cloud-9-automatic-stop-time-mintues/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.17" + "version": "10.2.26" } }, "DeployAssert": { @@ -730,7 +730,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.17" + "version": "10.2.26" } } }, diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.ts similarity index 88% rename from packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts rename to packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.ts index 963dddba388cc..736aa942b3489 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop-time-minutes.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/integ.automatic-stop.ts @@ -17,7 +17,7 @@ export class Cloud9Env extends cdk.Stack { // create a cloud9 ec2 environment in a new VPC const c9env = new cloud9.Ec2Environment(this, 'C9Env', { vpc, - automaticStopTimeMinutes: cdk.Duration.minutes(30), + automaticStop: cdk.Duration.minutes(30), imageId: cloud9.ImageId.AMAZON_LINUX_2, }); new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); @@ -26,7 +26,7 @@ export class Cloud9Env extends cdk.Stack { } const app = new cdk.App(); -const stack = new Cloud9Env(app, 'C9AutomaticStopTimeMinutesStack'); +const stack = new Cloud9Env(app, 'C9automaticStopStack'); new integ.IntegTest(app, 'cloud-9-automatic-stop-time-mintues', { testCases: [stack], From fd01c5f1fec719193a673093cb4fdd0524c66c0e Mon Sep 17 00:00:00 2001 From: Tobias Jakubowitz Date: Thu, 1 Jun 2023 17:36:08 +0000 Subject: [PATCH 9/9] fix: cloudformation expects AutomaticStopTimeMinutes --- .../@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts index feb5cd709fbb1..41879129e907e 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9-alpha/test/cloud9.environment.test.ts @@ -155,7 +155,7 @@ test('can set automaticStop', () => { }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { - automaticStop: automaticStop.toMinutes(), + AutomaticStopTimeMinutes: automaticStop.toMinutes(), }); });