From c159086153c3af42dfb89fbb7f5deab0d36afc43 Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Mon, 18 Jul 2022 06:50:22 +0000 Subject: [PATCH 1/9] feat(cloud9)\!: support imageId when creating Cloud9 environment BREAKING CHANGE: imageId is now a required parameter for Cloud9 environments. Any stack without this parameter will fail. --- packages/@aws-cdk/aws-cloud9/README.md | 20 ++++++++++- .../@aws-cdk/aws-cloud9/lib/environment.ts | 32 +++++++++++++++++- .../test/cloud9.environment.test.ts | 33 ++++++++++++++++--- .../@aws-cdk/aws-cloud9/test/integ.cloud9.ts | 1 + .../aws-cloud9/test/integ.connection-type.ts | 1 + 5 files changed, 81 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-cloud9/README.md b/packages/@aws-cdk/aws-cloud9/README.md index 86b38e3944cd3..324a2c7a27fd1 100644 --- a/packages/@aws-cdk/aws-cloud9/README.md +++ b/packages/@aws-cdk/aws-cloud9/README.md @@ -42,13 +42,14 @@ EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment ```ts // create a cloud9 ec2 environment in a new VPC const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3}); -new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc }); +new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc }, imageId: cloud9.ImageId.AMAZON_LINUX_2,); // or create the cloud9 environment in the default VPC with specific instanceType const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); new cloud9.Ec2Environment(this, 'Cloud9Env2', { vpc: defaultVpc, instanceType: new ec2.InstanceType('t3.large'), + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // or specify in a different subnetSelection @@ -57,12 +58,28 @@ const c9env = new cloud9.Ec2Environment(this, 'Cloud9Env3', { subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT, }, + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // print the Cloud9 IDE URL in the output new CfnOutput(this, 'URL', { value: c9env.ideUrl }); ``` +## Specifying EC2 AMI + +Use `imageId` to specify the EC2 AMI image to be used: + +```ts +import * as cloud9 from '@aws-cdk/aws-cloud9'; + +const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); +new cloud9.Ec2Environment(this, 'Cloud9Env2', { + vpc: defaultVpc, + instanceType: new ec2.InstanceType('t3.large'), + imageId: cloud9.ImageId.UBUNTU_18_04, +}); +``` + ## Cloning Repositories Use `clonedRepositories` to clone one or multiple AWS Codecommit repositories into the environment: @@ -86,5 +103,6 @@ new cloud9.Ec2Environment(this, 'C9Env', { cloud9.CloneRepository.fromCodeCommit(repoNew, '/src/new-repo'), cloud9.CloneRepository.fromCodeCommit(repoExisting, '/src/existing-repo'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); ``` diff --git a/packages/@aws-cdk/aws-cloud9/lib/environment.ts b/packages/@aws-cdk/aws-cloud9/lib/environment.ts index ed269cbc64a63..65d1ba8469c51 100644 --- a/packages/@aws-cdk/aws-cloud9/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9/lib/environment.ts @@ -29,7 +29,7 @@ export interface IEc2Environment extends cdk.IResource { */ export enum ConnectionType { /** - * Conect through SSH + * Connect through SSH */ CONNECT_SSH = 'CONNECT_SSH', /** @@ -38,6 +38,24 @@ export enum ConnectionType { CONNECT_SSM = 'CONNECT_SSM' } +/** + * The image ID used for creating an Amazon EC2 environment. + */ +export enum ImageId { + /** + * Create using Amazon Linux 1 + */ + AMAZON_LINUX_1 = 'amazonlinux-1-x86_64', + /** + * Create using Amazon Linux 2 + */ + AMAZON_LINUX_2 = 'amazonlinux-2-x86_64', + /** + * Create using Ubunut 18.04 + */ + UBUNTU_18_04 = 'ubuntu-18.04-x86_64' +} + /** * Properties for Ec2Environment */ @@ -93,6 +111,13 @@ export interface Ec2EnvironmentProps { * @default - CONNECT_SSH */ readonly connectionType?: ConnectionType + + /** + * The image ID used for creating an Amazon EC2 environment. + * + * Valid values are: AMAZON_LINUX, AMAZON_LINUX_2, and UBUNTU_18_04 + */ + readonly imageId: ImageId } /** @@ -152,6 +177,10 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { throw new Error('no subnetSelection specified and no public subnet found in the vpc, please specify subnetSelection'); } + if (!props.imageId) { + throw new Error('No imageId specified, please specify imageId'); + } + const vpcSubnets = props.subnetSelection ?? { subnetType: ec2.SubnetType.PUBLIC }; const c9env = new CfnEnvironmentEC2(this, 'Resource', { name: props.ec2EnvironmentName, @@ -163,6 +192,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { pathComponent: r.pathComponent, })) : undefined, connectionType: props.connectionType ?? ConnectionType.CONNECT_SSH, + imageId: props.imageId, }); this.environmentId = c9env.ref; this.ec2EnvironmentArn = c9env.getAtt('Arn').toString(); diff --git a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts index 687a93d4fb786..f54b4a19505a8 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts @@ -3,7 +3,7 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; import * as cloud9 from '../lib'; -import { ConnectionType } from '../lib'; +import { ConnectionType, ImageId } from '../lib'; let stack: cdk.Stack; let vpc: ec2.IVpc; @@ -13,20 +13,24 @@ beforeEach(() => { vpc = new ec2.Vpc(stack, 'VPC'); }); -test('create resource correctly with only vpc provide', () => { +test('create resource correctly with only vpc and imageId provided', () => { // WHEN - new cloud9.Ec2Environment(stack, 'C9Env', { vpc }); + new cloud9.Ec2Environment(stack, 'C9Env', { + vpc, + imageId: cloud9.ImageId.AMAZON_LINUX_2, + }); // THEN Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); }); -test('create resource correctly with both vpc and subnetSelectio', () => { +test('create resource correctly with vpc, imageId, and subnetSelection', () => { // WHEN new cloud9.Ec2Environment(stack, 'C9Env', { vpc, subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT, }, + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // THEN Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); @@ -44,6 +48,7 @@ test('create correctly with instanceType specified', () => { new cloud9.Ec2Environment(stack, 'C9Env', { vpc, instanceType: ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE), + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // THEN Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); @@ -66,6 +71,7 @@ test('throw error when subnetSelection not specified and the provided VPC has no new cloud9.Ec2Environment(stack, 'C9Env', { vpc: privateOnlyVpc, instanceType: ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE), + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); }).toThrow(/no subnetSelection specified and no public subnet found in the vpc, please specify subnetSelection/); }); @@ -79,6 +85,7 @@ test('can use CodeCommit repositories', () => { clonedRepositories: [ cloud9.CloneRepository.fromCodeCommit(repo, '/src'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { @@ -115,6 +122,7 @@ test.each([ new cloud9.Ec2Environment(stack, 'C9Env', { vpc, connectionType, + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { @@ -122,4 +130,21 @@ test.each([ ConnectionType: expected, SubnetId: Match.anyValue(), }); +}); + +test.each([ + [ImageId.AMAZON_LINUX_1, 'amazonlinux-1-x86_64'], + [ImageId.AMAZON_LINUX_2, 'amazonlinux-2-x86_64'], + [ImageId.UBUNTU_18_04, 'ubuntu-18.04-x86_64'], +])('has image ID property (%s)', (imageId, expected) => { + new cloud9.Ec2Environment(stack, 'C9Env', { + vpc, + imageId: imageId, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { + InstanceType: Match.anyValue(), + ImageId: expected, + SubnetId: Match.anyValue(), + }); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts b/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts index 0975a83603262..2081084a9ed33 100644 --- a/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts +++ b/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts @@ -25,6 +25,7 @@ export class Cloud9Env extends cdk.Stack { clonedRepositories: [ cloud9.CloneRepository.fromCodeCommit(repo, '/foo'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); new cdk.CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts b/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts index 98fb65e2649f0..56aa648577ff0 100644 --- a/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts +++ b/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts @@ -27,6 +27,7 @@ export class Cloud9Env extends cdk.Stack { clonedRepositories: [ cloud9.CloneRepository.fromCodeCommit(repo, '/foo'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); new cdk.CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); From 016becdc4bf89412450e38c48819519f45b04af2 Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Mon, 18 Jul 2022 06:50:22 +0000 Subject: [PATCH 2/9] feat(cloud9): support imageId when creating Cloud9 environment BREAKING CHANGE: imageId is now a required parameter for Cloud9 environments. Any stack without this parameter will fail. --- packages/@aws-cdk/aws-cloud9/README.md | 20 ++++++++++- .../@aws-cdk/aws-cloud9/lib/environment.ts | 32 +++++++++++++++++- .../test/cloud9.environment.test.ts | 33 ++++++++++++++++--- .../@aws-cdk/aws-cloud9/test/integ.cloud9.ts | 1 + .../aws-cloud9/test/integ.connection-type.ts | 1 + 5 files changed, 81 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-cloud9/README.md b/packages/@aws-cdk/aws-cloud9/README.md index 86b38e3944cd3..324a2c7a27fd1 100644 --- a/packages/@aws-cdk/aws-cloud9/README.md +++ b/packages/@aws-cdk/aws-cloud9/README.md @@ -42,13 +42,14 @@ EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment ```ts // create a cloud9 ec2 environment in a new VPC const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3}); -new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc }); +new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc }, imageId: cloud9.ImageId.AMAZON_LINUX_2,); // or create the cloud9 environment in the default VPC with specific instanceType const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); new cloud9.Ec2Environment(this, 'Cloud9Env2', { vpc: defaultVpc, instanceType: new ec2.InstanceType('t3.large'), + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // or specify in a different subnetSelection @@ -57,12 +58,28 @@ const c9env = new cloud9.Ec2Environment(this, 'Cloud9Env3', { subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT, }, + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // print the Cloud9 IDE URL in the output new CfnOutput(this, 'URL', { value: c9env.ideUrl }); ``` +## Specifying EC2 AMI + +Use `imageId` to specify the EC2 AMI image to be used: + +```ts +import * as cloud9 from '@aws-cdk/aws-cloud9'; + +const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); +new cloud9.Ec2Environment(this, 'Cloud9Env2', { + vpc: defaultVpc, + instanceType: new ec2.InstanceType('t3.large'), + imageId: cloud9.ImageId.UBUNTU_18_04, +}); +``` + ## Cloning Repositories Use `clonedRepositories` to clone one or multiple AWS Codecommit repositories into the environment: @@ -86,5 +103,6 @@ new cloud9.Ec2Environment(this, 'C9Env', { cloud9.CloneRepository.fromCodeCommit(repoNew, '/src/new-repo'), cloud9.CloneRepository.fromCodeCommit(repoExisting, '/src/existing-repo'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); ``` diff --git a/packages/@aws-cdk/aws-cloud9/lib/environment.ts b/packages/@aws-cdk/aws-cloud9/lib/environment.ts index ed269cbc64a63..65d1ba8469c51 100644 --- a/packages/@aws-cdk/aws-cloud9/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9/lib/environment.ts @@ -29,7 +29,7 @@ export interface IEc2Environment extends cdk.IResource { */ export enum ConnectionType { /** - * Conect through SSH + * Connect through SSH */ CONNECT_SSH = 'CONNECT_SSH', /** @@ -38,6 +38,24 @@ export enum ConnectionType { CONNECT_SSM = 'CONNECT_SSM' } +/** + * The image ID used for creating an Amazon EC2 environment. + */ +export enum ImageId { + /** + * Create using Amazon Linux 1 + */ + AMAZON_LINUX_1 = 'amazonlinux-1-x86_64', + /** + * Create using Amazon Linux 2 + */ + AMAZON_LINUX_2 = 'amazonlinux-2-x86_64', + /** + * Create using Ubunut 18.04 + */ + UBUNTU_18_04 = 'ubuntu-18.04-x86_64' +} + /** * Properties for Ec2Environment */ @@ -93,6 +111,13 @@ export interface Ec2EnvironmentProps { * @default - CONNECT_SSH */ readonly connectionType?: ConnectionType + + /** + * The image ID used for creating an Amazon EC2 environment. + * + * Valid values are: AMAZON_LINUX, AMAZON_LINUX_2, and UBUNTU_18_04 + */ + readonly imageId: ImageId } /** @@ -152,6 +177,10 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { throw new Error('no subnetSelection specified and no public subnet found in the vpc, please specify subnetSelection'); } + if (!props.imageId) { + throw new Error('No imageId specified, please specify imageId'); + } + const vpcSubnets = props.subnetSelection ?? { subnetType: ec2.SubnetType.PUBLIC }; const c9env = new CfnEnvironmentEC2(this, 'Resource', { name: props.ec2EnvironmentName, @@ -163,6 +192,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { pathComponent: r.pathComponent, })) : undefined, connectionType: props.connectionType ?? ConnectionType.CONNECT_SSH, + imageId: props.imageId, }); this.environmentId = c9env.ref; this.ec2EnvironmentArn = c9env.getAtt('Arn').toString(); diff --git a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts index 687a93d4fb786..f54b4a19505a8 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts @@ -3,7 +3,7 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; import * as cloud9 from '../lib'; -import { ConnectionType } from '../lib'; +import { ConnectionType, ImageId } from '../lib'; let stack: cdk.Stack; let vpc: ec2.IVpc; @@ -13,20 +13,24 @@ beforeEach(() => { vpc = new ec2.Vpc(stack, 'VPC'); }); -test('create resource correctly with only vpc provide', () => { +test('create resource correctly with only vpc and imageId provided', () => { // WHEN - new cloud9.Ec2Environment(stack, 'C9Env', { vpc }); + new cloud9.Ec2Environment(stack, 'C9Env', { + vpc, + imageId: cloud9.ImageId.AMAZON_LINUX_2, + }); // THEN Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); }); -test('create resource correctly with both vpc and subnetSelectio', () => { +test('create resource correctly with vpc, imageId, and subnetSelection', () => { // WHEN new cloud9.Ec2Environment(stack, 'C9Env', { vpc, subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT, }, + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // THEN Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); @@ -44,6 +48,7 @@ test('create correctly with instanceType specified', () => { new cloud9.Ec2Environment(stack, 'C9Env', { vpc, instanceType: ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE), + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // THEN Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); @@ -66,6 +71,7 @@ test('throw error when subnetSelection not specified and the provided VPC has no new cloud9.Ec2Environment(stack, 'C9Env', { vpc: privateOnlyVpc, instanceType: ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE), + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); }).toThrow(/no subnetSelection specified and no public subnet found in the vpc, please specify subnetSelection/); }); @@ -79,6 +85,7 @@ test('can use CodeCommit repositories', () => { clonedRepositories: [ cloud9.CloneRepository.fromCodeCommit(repo, '/src'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { @@ -115,6 +122,7 @@ test.each([ new cloud9.Ec2Environment(stack, 'C9Env', { vpc, connectionType, + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { @@ -122,4 +130,21 @@ test.each([ ConnectionType: expected, SubnetId: Match.anyValue(), }); +}); + +test.each([ + [ImageId.AMAZON_LINUX_1, 'amazonlinux-1-x86_64'], + [ImageId.AMAZON_LINUX_2, 'amazonlinux-2-x86_64'], + [ImageId.UBUNTU_18_04, 'ubuntu-18.04-x86_64'], +])('has image ID property (%s)', (imageId, expected) => { + new cloud9.Ec2Environment(stack, 'C9Env', { + vpc, + imageId: imageId, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { + InstanceType: Match.anyValue(), + ImageId: expected, + SubnetId: Match.anyValue(), + }); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts b/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts index 0975a83603262..2081084a9ed33 100644 --- a/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts +++ b/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts @@ -25,6 +25,7 @@ export class Cloud9Env extends cdk.Stack { clonedRepositories: [ cloud9.CloneRepository.fromCodeCommit(repo, '/foo'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); new cdk.CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts b/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts index 98fb65e2649f0..56aa648577ff0 100644 --- a/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts +++ b/packages/@aws-cdk/aws-cloud9/test/integ.connection-type.ts @@ -27,6 +27,7 @@ export class Cloud9Env extends cdk.Stack { clonedRepositories: [ cloud9.CloneRepository.fromCodeCommit(repo, '/foo'), ], + imageId: cloud9.ImageId.AMAZON_LINUX_2, }); new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); new cdk.CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); From 5059e05f7203d0d0c21c6022b32fd27212bdb8cd Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Mon, 18 Jul 2022 07:22:54 +0000 Subject: [PATCH 3/9] feat(cloud9): added integration test for imageId --- .../C9Stack.assets.json | 19 + .../C9Stack.template.json | 427 +++++++++++ .../test/cdk-integ.out.image-id/cdk.out | 1 + .../test/cdk-integ.out.image-id/manifest.json | 202 ++++++ .../test/cdk-integ.out.image-id/tree.json | 671 ++++++++++++++++++ .../aws-cloud9/test/integ.image-id.ts | 28 + 6 files changed, 1348 insertions(+) create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.assets.json create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.template.json create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cdk.out create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json create mode 100644 packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.assets.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.assets.json new file mode 100644 index 0000000000000..09f754a31bd38 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "20.0.0", + "files": { + "f9e7c320234302f703a47f0be7da188a1e91f7863c71a04835efd508d926216c": { + "source": { + "path": "C9Stack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f9e7c320234302f703a47f0be7da188a1e91f7863c71a04835efd508d926216c.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/test/cdk-integ.out.image-id/C9Stack.template.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.template.json new file mode 100644 index 0000000000000..f8edd13a6f341 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.template.json @@ -0,0 +1,427 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "C9Stack/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": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9Stack/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": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "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": "C9Stack/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9Stack/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": "C9Stack/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9Stack/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": "C9Stack/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "C9Stack/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": "C9Stack/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "C9EnvF05FC3BE": { + "Type": "AWS::Cloud9::EnvironmentEC2", + "Properties": { + "InstanceType": "t2.micro", + "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/test/cdk-integ.out.image-id/cdk.out b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cdk.out new file mode 100644 index 0000000000000..588d7b269d34f --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cdk.out @@ -0,0 +1 @@ +{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json new file mode 100644 index 0000000000000..a85bd5b612a13 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json @@ -0,0 +1,202 @@ +{ + "version": "20.0.0", + "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "C9Stack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "C9Stack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "C9Stack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "C9Stack.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}/f9e7c320234302f703a47f0be7da188a1e91f7863c71a04835efd508d926216c.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "C9Stack.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": [ + "C9Stack.assets" + ], + "metadata": { + "/C9Stack/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/C9Stack/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/C9Stack/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/C9Stack/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/C9Stack/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/C9Stack/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/C9Stack/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/C9Stack/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/C9Stack/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/C9Stack/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/C9Stack/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/C9Stack/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/C9Stack/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/C9Stack/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/C9Stack/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/C9Stack/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/C9Stack/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/C9Stack/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/C9Stack/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/C9Stack/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/C9Stack/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/C9Stack/C9Env/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "C9EnvF05FC3BE" + } + ], + "/C9Stack/URL": [ + { + "type": "aws:cdk:logicalId", + "data": "URL" + } + ], + "/C9Stack/ARN": [ + { + "type": "aws:cdk:logicalId", + "data": "ARN" + } + ], + "/C9Stack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/C9Stack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "C9Stack" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json new file mode 100644 index 0000000000000..1bafeb1ae8cf0 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json @@ -0,0 +1,671 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.33" + } + }, + "C9Stack": { + "id": "C9Stack", + "path": "C9Stack", + "children": { + "VPC": { + "id": "VPC", + "path": "C9Stack/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "C9Stack/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": "C9Stack/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "C9Stack/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9Stack/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": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9Stack/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9Stack/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9Stack/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/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9Stack/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/aws-ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "C9Stack/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "C9Stack/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": "C9Stack/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "C9Stack/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9Stack/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": "C9Stack/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9Stack/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9Stack/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9Stack/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9Stack/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/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9Stack/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/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "C9Stack/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9Stack/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": "C9Stack/VPC/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9Stack/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9Stack/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9Stack/VPC/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9Stack/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/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9Stack/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/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "C9Stack/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "C9Stack/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": "C9Stack/VPC/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "C9Stack/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "C9Stack/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "C9Stack/VPC/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "C9Stack/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/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "C9Stack/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/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "C9Stack/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "C9Stack/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "C9Stack/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "C9Env": { + "id": "C9Env", + "path": "C9Stack/C9Env", + "children": { + "Resource": { + "id": "Resource", + "path": "C9Stack/C9Env/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Cloud9::EnvironmentEC2", + "aws:cdk:cloudformation:props": { + "instanceType": "t2.micro", + "connectionType": "CONNECT_SSH", + "imageId": "amazonlinux-2-x86_64", + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloud9.CfnEnvironmentEC2", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloud9.Ec2Environment", + "version": "0.0.0" + } + }, + "URL": { + "id": "URL", + "path": "C9Stack/URL", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "ARN": { + "id": "ARN", + "path": "C9Stack/ARN", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts b/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts new file mode 100644 index 0000000000000..3791c11ec55ba --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts @@ -0,0 +1,28 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as cdk from '@aws-cdk/core'; +import * as constructs from 'constructs'; +import * as cloud9 from '../lib'; +import { ImageId } 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', { + maxAzs: 2, + natGateways: 1, + }); + + // create a cloud9 ec2 environment in a new VPC + const c9env = new cloud9.Ec2Environment(this, 'C9Env', { + vpc, + imageId: 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(); + +new Cloud9Env(app, 'C9Stack'); From 2b9f7c547f3c05ba766844475741429054e1e4ce Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Tue, 19 Jul 2022 00:25:45 +0000 Subject: [PATCH 4/9] updated readme parameter error --- packages/@aws-cdk/aws-cloud9/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloud9/README.md b/packages/@aws-cdk/aws-cloud9/README.md index 324a2c7a27fd1..ec7fc58a29a0b 100644 --- a/packages/@aws-cdk/aws-cloud9/README.md +++ b/packages/@aws-cdk/aws-cloud9/README.md @@ -42,7 +42,7 @@ EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment ```ts // create a cloud9 ec2 environment in a new VPC const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3}); -new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc }, imageId: cloud9.ImageId.AMAZON_LINUX_2,); +new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc, imageId: cloud9.ImageId.AMAZON_LINUX_2, }); // or create the cloud9 environment in the default VPC with specific instanceType const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); From 41a578815e15f4e10e542ff84223c0e49b5735fc Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Tue, 19 Jul 2022 00:27:37 +0000 Subject: [PATCH 5/9] removed Amazon Linux 1 option from ImageId --- packages/@aws-cdk/aws-cloud9/lib/environment.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-cloud9/lib/environment.ts b/packages/@aws-cdk/aws-cloud9/lib/environment.ts index 65d1ba8469c51..b05a6bf821a9a 100644 --- a/packages/@aws-cdk/aws-cloud9/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9/lib/environment.ts @@ -42,10 +42,6 @@ export enum ConnectionType { * The image ID used for creating an Amazon EC2 environment. */ export enum ImageId { - /** - * Create using Amazon Linux 1 - */ - AMAZON_LINUX_1 = 'amazonlinux-1-x86_64', /** * Create using Amazon Linux 2 */ @@ -115,7 +111,7 @@ export interface Ec2EnvironmentProps { /** * The image ID used for creating an Amazon EC2 environment. * - * Valid values are: AMAZON_LINUX, AMAZON_LINUX_2, and UBUNTU_18_04 + * Valid values are: AMAZON_LINUX_2, and UBUNTU_18_04 */ readonly imageId: ImageId } From f45bed2987d278d754b3b208e3dfa1c339c7718f Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Tue, 19 Jul 2022 01:31:30 +0000 Subject: [PATCH 6/9] updated existing integ test snapshots to expect amazon-linux-2 image id updated image-id integ test to use integTest package --- packages/@aws-cdk/aws-cloud9/package.json | 2 +- ...aultTestDeployAssert7D293EEE.template.json | 1 + .../cloud9-imageid-integ.template.json | 393 ++++++++++++++++++ .../test/cdk-integ.out.image-id/integ.json | 11 + .../test/cdk-integ.out.image-id/manifest.json | 101 ++--- .../test/cdk-integ.out.image-id/tree.json | 134 +++--- .../test/cloud9.environment.test.ts | 1 - .../C9Stack.template.json | 1 + .../C9Stack.template.json | 1 + .../aws-cloud9/test/integ.image-id.ts | 21 +- 10 files changed, 543 insertions(+), 123 deletions(-) create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cloud9-imageid-integ.template.json create mode 100644 packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/integ.json diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index 293f0e0edac25..fab081be1e4e8 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -83,8 +83,8 @@ "@aws-cdk/assertions": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", - "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", + "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2" }, diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json new file mode 100644 index 0000000000000..9e26dfeeb6e64 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cloud9-imageid-integ.template.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cloud9-imageid-integ.template.json new file mode 100644 index 0000000000000..42cbd9d847a8d --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cloud9-imageid-integ.template.json @@ -0,0 +1,393 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "cloud9-imageid-integ/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": "cloud9-imageid-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cloud9-imageid-integ/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": "cloud9-imageid-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "cloud9-imageid-integ/VPC/PublicSubnet1" + } + ] + } + }, + "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": "cloud9-imageid-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cloud9-imageid-integ/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": "cloud9-imageid-integ/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cloud9-imageid-integ/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": "cloud9-imageid-integ/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cloud9-imageid-integ/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": "cloud9-imageid-integ/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "C9EnvF05FC3BE": { + "Type": "AWS::Cloud9::EnvironmentEC2", + "Properties": { + "InstanceType": "t2.micro", + "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" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/integ.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/integ.json new file mode 100644 index 0000000000000..f6d6e3d426687 --- /dev/null +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/integ.json @@ -0,0 +1,11 @@ +{ + "version": "20.0.0", + "testCases": { + "ImageIdInteg/DefaultTest": { + "stacks": [ + "cloud9-imageid-integ" + ], + "assertionStack": "ImageIdIntegDefaultTestDeployAssert7D293EEE" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json index a85bd5b612a13..c677555979349 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json @@ -7,196 +7,169 @@ "file": "tree.json" } }, - "C9Stack.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "C9Stack.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "C9Stack": { + "cloud9-imageid-integ": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "C9Stack.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}/f9e7c320234302f703a47f0be7da188a1e91f7863c71a04835efd508d926216c.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "C9Stack.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" - } + "templateFile": "cloud9-imageid-integ.template.json", + "validateOnSynth": false }, - "dependencies": [ - "C9Stack.assets" - ], "metadata": { - "/C9Stack/VPC/Resource": [ + "/cloud9-imageid-integ/VPC/Resource": [ { "type": "aws:cdk:logicalId", "data": "VPCB9E5F0B4" } ], - "/C9Stack/VPC/PublicSubnet1/Subnet": [ + "/cloud9-imageid-integ/VPC/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1SubnetB4246D30" } ], - "/C9Stack/VPC/PublicSubnet1/RouteTable": [ + "/cloud9-imageid-integ/VPC/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1RouteTableFEE4B781" } ], - "/C9Stack/VPC/PublicSubnet1/RouteTableAssociation": [ + "/cloud9-imageid-integ/VPC/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" } ], - "/C9Stack/VPC/PublicSubnet1/DefaultRoute": [ + "/cloud9-imageid-integ/VPC/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1DefaultRoute91CEF279" } ], - "/C9Stack/VPC/PublicSubnet1/EIP": [ + "/cloud9-imageid-integ/VPC/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1EIP6AD938E8" } ], - "/C9Stack/VPC/PublicSubnet1/NATGateway": [ + "/cloud9-imageid-integ/VPC/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1NATGatewayE0556630" } ], - "/C9Stack/VPC/PublicSubnet2/Subnet": [ + "/cloud9-imageid-integ/VPC/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2Subnet74179F39" } ], - "/C9Stack/VPC/PublicSubnet2/RouteTable": [ + "/cloud9-imageid-integ/VPC/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2RouteTable6F1A15F1" } ], - "/C9Stack/VPC/PublicSubnet2/RouteTableAssociation": [ + "/cloud9-imageid-integ/VPC/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2RouteTableAssociation5A808732" } ], - "/C9Stack/VPC/PublicSubnet2/DefaultRoute": [ + "/cloud9-imageid-integ/VPC/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2DefaultRouteB7481BBA" } ], - "/C9Stack/VPC/PrivateSubnet1/Subnet": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1Subnet8BCA10E0" } ], - "/C9Stack/VPC/PrivateSubnet1/RouteTable": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1RouteTableBE8A6027" } ], - "/C9Stack/VPC/PrivateSubnet1/RouteTableAssociation": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" } ], - "/C9Stack/VPC/PrivateSubnet1/DefaultRoute": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" } ], - "/C9Stack/VPC/PrivateSubnet2/Subnet": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2SubnetCFCDAA7A" } ], - "/C9Stack/VPC/PrivateSubnet2/RouteTable": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2RouteTable0A19E10E" } ], - "/C9Stack/VPC/PrivateSubnet2/RouteTableAssociation": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" } ], - "/C9Stack/VPC/PrivateSubnet2/DefaultRoute": [ + "/cloud9-imageid-integ/VPC/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" } ], - "/C9Stack/VPC/IGW": [ + "/cloud9-imageid-integ/VPC/IGW": [ { "type": "aws:cdk:logicalId", "data": "VPCIGWB7E252D3" } ], - "/C9Stack/VPC/VPCGW": [ + "/cloud9-imageid-integ/VPC/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "VPCVPCGW99B986DC" } ], - "/C9Stack/C9Env/Resource": [ + "/cloud9-imageid-integ/C9Env/Resource": [ { "type": "aws:cdk:logicalId", "data": "C9EnvF05FC3BE" } ], - "/C9Stack/URL": [ + "/cloud9-imageid-integ/URL": [ { "type": "aws:cdk:logicalId", "data": "URL" } ], - "/C9Stack/ARN": [ + "/cloud9-imageid-integ/ARN": [ { "type": "aws:cdk:logicalId", "data": "ARN" } - ], - "/C9Stack/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/C9Stack/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } ] }, - "displayName": "C9Stack" + "displayName": "cloud9-imageid-integ" + }, + "ImageIdIntegDefaultTestDeployAssert7D293EEE": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json", + "validateOnSynth": false + }, + "displayName": "ImageIdInteg/DefaultTest/DeployAssert" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json index 1bafeb1ae8cf0..d4257f4cb3ed2 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json +++ b/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json @@ -12,17 +12,17 @@ "version": "10.1.33" } }, - "C9Stack": { - "id": "C9Stack", - "path": "C9Stack", + "cloud9-imageid-integ": { + "id": "cloud9-imageid-integ", + "path": "cloud9-imageid-integ", "children": { "VPC": { "id": "VPC", - "path": "C9Stack/VPC", + "path": "cloud9-imageid-integ/VPC", "children": { "Resource": { "id": "Resource", - "path": "C9Stack/VPC/Resource", + "path": "cloud9-imageid-integ/VPC/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -33,7 +33,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC" + "value": "cloud9-imageid-integ/VPC" } ] } @@ -45,11 +45,11 @@ }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "C9Stack/VPC/PublicSubnet1", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "C9Stack/VPC/PublicSubnet1/Subnet", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -77,7 +77,7 @@ }, { "key": "Name", - "value": "C9Stack/VPC/PublicSubnet1" + "value": "cloud9-imageid-integ/VPC/PublicSubnet1" } ] } @@ -89,7 +89,7 @@ }, "Acl": { "id": "Acl", - "path": "C9Stack/VPC/PublicSubnet1/Acl", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -97,7 +97,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9Stack/VPC/PublicSubnet1/RouteTable", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -107,7 +107,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC/PublicSubnet1" + "value": "cloud9-imageid-integ/VPC/PublicSubnet1" } ] } @@ -119,7 +119,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9Stack/VPC/PublicSubnet1/RouteTableAssociation", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -138,7 +138,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9Stack/VPC/PublicSubnet1/DefaultRoute", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -158,7 +158,7 @@ }, "EIP": { "id": "EIP", - "path": "C9Stack/VPC/PublicSubnet1/EIP", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -166,7 +166,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC/PublicSubnet1" + "value": "cloud9-imageid-integ/VPC/PublicSubnet1" } ] } @@ -178,7 +178,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "C9Stack/VPC/PublicSubnet1/NATGateway", + "path": "cloud9-imageid-integ/VPC/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -194,7 +194,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC/PublicSubnet1" + "value": "cloud9-imageid-integ/VPC/PublicSubnet1" } ] } @@ -212,11 +212,11 @@ }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "C9Stack/VPC/PublicSubnet2", + "path": "cloud9-imageid-integ/VPC/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "C9Stack/VPC/PublicSubnet2/Subnet", + "path": "cloud9-imageid-integ/VPC/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -244,7 +244,7 @@ }, { "key": "Name", - "value": "C9Stack/VPC/PublicSubnet2" + "value": "cloud9-imageid-integ/VPC/PublicSubnet2" } ] } @@ -256,7 +256,7 @@ }, "Acl": { "id": "Acl", - "path": "C9Stack/VPC/PublicSubnet2/Acl", + "path": "cloud9-imageid-integ/VPC/PublicSubnet2/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -264,7 +264,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9Stack/VPC/PublicSubnet2/RouteTable", + "path": "cloud9-imageid-integ/VPC/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -274,7 +274,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC/PublicSubnet2" + "value": "cloud9-imageid-integ/VPC/PublicSubnet2" } ] } @@ -286,7 +286,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9Stack/VPC/PublicSubnet2/RouteTableAssociation", + "path": "cloud9-imageid-integ/VPC/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -305,7 +305,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9Stack/VPC/PublicSubnet2/DefaultRoute", + "path": "cloud9-imageid-integ/VPC/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -331,11 +331,11 @@ }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "C9Stack/VPC/PrivateSubnet1", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "C9Stack/VPC/PrivateSubnet1/Subnet", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -363,7 +363,7 @@ }, { "key": "Name", - "value": "C9Stack/VPC/PrivateSubnet1" + "value": "cloud9-imageid-integ/VPC/PrivateSubnet1" } ] } @@ -375,7 +375,7 @@ }, "Acl": { "id": "Acl", - "path": "C9Stack/VPC/PrivateSubnet1/Acl", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet1/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -383,7 +383,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9Stack/VPC/PrivateSubnet1/RouteTable", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -393,7 +393,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC/PrivateSubnet1" + "value": "cloud9-imageid-integ/VPC/PrivateSubnet1" } ] } @@ -405,7 +405,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9Stack/VPC/PrivateSubnet1/RouteTableAssociation", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -424,7 +424,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9Stack/VPC/PrivateSubnet1/DefaultRoute", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -450,11 +450,11 @@ }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "C9Stack/VPC/PrivateSubnet2", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "C9Stack/VPC/PrivateSubnet2/Subnet", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -482,7 +482,7 @@ }, { "key": "Name", - "value": "C9Stack/VPC/PrivateSubnet2" + "value": "cloud9-imageid-integ/VPC/PrivateSubnet2" } ] } @@ -494,7 +494,7 @@ }, "Acl": { "id": "Acl", - "path": "C9Stack/VPC/PrivateSubnet2/Acl", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet2/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -502,7 +502,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "C9Stack/VPC/PrivateSubnet2/RouteTable", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -512,7 +512,7 @@ "tags": [ { "key": "Name", - "value": "C9Stack/VPC/PrivateSubnet2" + "value": "cloud9-imageid-integ/VPC/PrivateSubnet2" } ] } @@ -524,7 +524,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "C9Stack/VPC/PrivateSubnet2/RouteTableAssociation", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -543,7 +543,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "C9Stack/VPC/PrivateSubnet2/DefaultRoute", + "path": "cloud9-imageid-integ/VPC/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -569,14 +569,14 @@ }, "IGW": { "id": "IGW", - "path": "C9Stack/VPC/IGW", + "path": "cloud9-imageid-integ/VPC/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "C9Stack/VPC" + "value": "cloud9-imageid-integ/VPC" } ] } @@ -588,7 +588,7 @@ }, "VPCGW": { "id": "VPCGW", - "path": "C9Stack/VPC/VPCGW", + "path": "cloud9-imageid-integ/VPC/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { @@ -613,11 +613,11 @@ }, "C9Env": { "id": "C9Env", - "path": "C9Stack/C9Env", + "path": "cloud9-imageid-integ/C9Env", "children": { "Resource": { "id": "Resource", - "path": "C9Stack/C9Env/Resource", + "path": "cloud9-imageid-integ/C9Env/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Cloud9::EnvironmentEC2", "aws:cdk:cloudformation:props": { @@ -642,7 +642,7 @@ }, "URL": { "id": "URL", - "path": "C9Stack/URL", + "path": "cloud9-imageid-integ/URL", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -650,7 +650,7 @@ }, "ARN": { "id": "ARN", - "path": "C9Stack/ARN", + "path": "cloud9-imageid-integ/ARN", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -661,6 +661,42 @@ "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "ImageIdInteg": { + "id": "ImageIdInteg", + "path": "ImageIdInteg", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "ImageIdInteg/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "ImageIdInteg/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.33" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "ImageIdInteg/DefaultTest/DeployAssert", + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts index f54b4a19505a8..fb2f3bed3ef01 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts @@ -133,7 +133,6 @@ test.each([ }); test.each([ - [ImageId.AMAZON_LINUX_1, 'amazonlinux-1-x86_64'], [ImageId.AMAZON_LINUX_2, 'amazonlinux-2-x86_64'], [ImageId.UBUNTU_18_04, 'ubuntu-18.04-x86_64'], ])('has image ID property (%s)', (imageId, expected) => { diff --git a/packages/@aws-cdk/aws-cloud9/test/cloud9.integ.snapshot/C9Stack.template.json b/packages/@aws-cdk/aws-cloud9/test/cloud9.integ.snapshot/C9Stack.template.json index 5fdf4618385ec..1a092ba57bbf1 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cloud9.integ.snapshot/C9Stack.template.json +++ b/packages/@aws-cdk/aws-cloud9/test/cloud9.integ.snapshot/C9Stack.template.json @@ -361,6 +361,7 @@ "Type": "AWS::Cloud9::EnvironmentEC2", "Properties": { "ConnectionType": "CONNECT_SSH", + "ImageId": "amazonlinux-2-x86_64", "InstanceType": "t2.micro", "Repositories": [ { diff --git a/packages/@aws-cdk/aws-cloud9/test/connection-type.integ.snapshot/C9Stack.template.json b/packages/@aws-cdk/aws-cloud9/test/connection-type.integ.snapshot/C9Stack.template.json index 2e3163332b034..2633ca59ff48a 100644 --- a/packages/@aws-cdk/aws-cloud9/test/connection-type.integ.snapshot/C9Stack.template.json +++ b/packages/@aws-cdk/aws-cloud9/test/connection-type.integ.snapshot/C9Stack.template.json @@ -361,6 +361,7 @@ "Type": "AWS::Cloud9::EnvironmentEC2", "Properties": { "ConnectionType": "CONNECT_SSM", + "ImageId": "amazonlinux-2-x86_64", "InstanceType": "t2.micro", "Repositories": [ { diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts b/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts index 3791c11ec55ba..50f16ee857ade 100644 --- a/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts +++ b/packages/@aws-cdk/aws-cloud9/test/integ.image-id.ts @@ -1,11 +1,12 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { Stack, App, StackProps, CfnOutput } from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import { Construct } from 'constructs'; import * as cloud9 from '../lib'; import { ImageId } from '../lib'; -export class Cloud9Env extends cdk.Stack { - constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { +class Cloud9Env extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const vpc = new ec2.Vpc(this, 'VPC', { @@ -18,11 +19,15 @@ export class Cloud9Env extends cdk.Stack { vpc, imageId: ImageId.AMAZON_LINUX_2, }); - new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl }); - new cdk.CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); + new CfnOutput(this, 'URL', { value: c9env.ideUrl }); + new CfnOutput(this, 'ARN', { value: c9env.ec2EnvironmentArn }); } } -const app = new cdk.App(); +const app = new App(); -new Cloud9Env(app, 'C9Stack'); +new integ.IntegTest(app, 'ImageIdInteg', { + testCases: [new Cloud9Env(app, 'cloud9-imageid-integ')], +}); + +app.synth(); \ No newline at end of file From c0e1701d9e231013752351c3537df7dfc14b190f Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Tue, 19 Jul 2022 05:10:38 +0000 Subject: [PATCH 7/9] added integ-tests line to devdependencies to allow for new integ test to be run --- packages/@aws-cdk/aws-cloud9/package.json | 1 + .../C9Stack.assets.json | 0 .../C9Stack.template.json | 0 .../ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json | 0 .../{cdk-integ.out.image-id => image-id.integ.snapshot}/cdk.out | 0 .../cloud9-imageid-integ.template.json | 0 .../integ.json | 0 .../manifest.json | 0 .../tree.json | 0 9 files changed, 1 insertion(+) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/C9Stack.assets.json (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/C9Stack.template.json (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/cdk.out (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/cloud9-imageid-integ.template.json (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/integ.json (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/manifest.json (100%) rename packages/@aws-cdk/aws-cloud9/test/{cdk-integ.out.image-id => image-id.integ.snapshot}/tree.json (100%) diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index fab081be1e4e8..c52e71087c1e2 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -86,6 +86,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@types/jest": "^27.5.2" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.assets.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/C9Stack.assets.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.assets.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/C9Stack.assets.json diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.template.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/C9Stack.template.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/C9Stack.template.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/C9Stack.template.json diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/ImageIdIntegDefaultTestDeployAssert7D293EEE.template.json diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cdk.out b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/cdk.out similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cdk.out rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/cdk.out diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cloud9-imageid-integ.template.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/cloud9-imageid-integ.template.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/cloud9-imageid-integ.template.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/cloud9-imageid-integ.template.json diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/integ.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/integ.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/integ.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/integ.json diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/manifest.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/manifest.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/manifest.json diff --git a/packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json b/packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/tree.json similarity index 100% rename from packages/@aws-cdk/aws-cloud9/test/cdk-integ.out.image-id/tree.json rename to packages/@aws-cdk/aws-cloud9/test/image-id.integ.snapshot/tree.json From 1c146bd4b328370a70c993644857b27ac5ddab3e Mon Sep 17 00:00:00 2001 From: Kendra Neil <53584728+TheRealAmazonKendra@users.noreply.github.com> Date: Mon, 18 Jul 2022 23:45:40 -0700 Subject: [PATCH 8/9] Update README.md --- packages/@aws-cdk/aws-cloud9/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/@aws-cdk/aws-cloud9/README.md b/packages/@aws-cdk/aws-cloud9/README.md index ec7fc58a29a0b..facf3c68a8ed3 100644 --- a/packages/@aws-cdk/aws-cloud9/README.md +++ b/packages/@aws-cdk/aws-cloud9/README.md @@ -70,8 +70,6 @@ new CfnOutput(this, 'URL', { value: c9env.ideUrl }); Use `imageId` to specify the EC2 AMI image to be used: ```ts -import * as cloud9 from '@aws-cdk/aws-cloud9'; - const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true }); new cloud9.Ec2Environment(this, 'Cloud9Env2', { vpc: defaultVpc, From c80c735a58cd242401448fd4dad716932be10e12 Mon Sep 17 00:00:00 2001 From: Sean Beath Date: Tue, 19 Jul 2022 06:49:35 +0000 Subject: [PATCH 9/9] removed comment on valid imageid --- packages/@aws-cdk/aws-cloud9/lib/environment.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloud9/lib/environment.ts b/packages/@aws-cdk/aws-cloud9/lib/environment.ts index b05a6bf821a9a..b987320d92717 100644 --- a/packages/@aws-cdk/aws-cloud9/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9/lib/environment.ts @@ -111,7 +111,6 @@ export interface Ec2EnvironmentProps { /** * The image ID used for creating an Amazon EC2 environment. * - * Valid values are: AMAZON_LINUX_2, and UBUNTU_18_04 */ readonly imageId: ImageId }