Skip to content

Commit

Permalink
Merge branch 'master' into pr/import-batch-name
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Sep 30, 2020
2 parents f605baa + 44c1f20 commit 405b742
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ const igwId = vpc.internetGatewayId;

For a VPC with only `ISOLATED` subnets, this value will be undefined.

This is only supported for VPC's created in the stack - currently you're
unable to get the ID for imported VPC's. To do that you'd have to specifically
This is only supported for VPCs created in the stack - currently you're
unable to get the ID for imported VPCs. To do that you'd have to specifically
look up the Internet Gateway by name, which would require knowing the name
beforehand.

Expand Down Expand Up @@ -700,7 +700,7 @@ ec2.CloudFormationInit.fromElements(
### Bastion Hosts

A bastion host functions as an instance used to access servers and resources in a VPC without open up the complete VPC on a network level.
You can use bastion hosts using a standard SSH connection targetting port 22 on the host. As an alternative, you can connect the SSH connection
You can use bastion hosts using a standard SSH connection targeting port 22 on the host. As an alternative, you can connect the SSH connection
feature of AWS Systems Manager Session Manager, which does not need an opened security group. (https://aws.amazon.com/about-aws/whats-new/2019/07/session-manager-launches-tunneling-support-for-ssh-and-scp/)

A default bastion host for use via SSM can be configured like:
Expand Down
22 changes: 22 additions & 0 deletions packages/@aws-cdk/aws-ec2/lib/instance-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,28 @@ export enum InstanceClass {
*/
C5N = 'c5n',

/**
* Compute optimized instances for high performance computing, 6th generation with Graviton2 processors
*/
COMPUTE6_GRAVITON2 = 'c6g',

/**
* Compute optimized instances for high performance computing, 6th generation with Graviton2 processors
*/
C6G = 'c6g',

/**
* Compute optimized instances for high performance computing, 6th generation with Graviton2 processors
* and local NVME drive
*/
COMPUTE6_GRAVITON2_NVME_DRIVE = 'c6gd',

/**
* Compute optimized instances for high performance computing, 6th generation with Graviton2 processors
* and local NVME drive
*/
C6GD = 'c6gd',

/**
* Storage-optimized instances, 2nd generation
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2/test/instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ nodeunitShim({
new Instance(stack, 'Instance', {
vpc,
machineImage: new AmazonLinuxImage(),
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.LARGE),
instanceType: InstanceType.of(InstanceClass.COMPUTE6_GRAVITON2, InstanceSize.LARGE),
});

// THEN
cdkExpect(stack).to(haveResource('AWS::EC2::Instance', {
InstanceType: 't3.large',
InstanceType: 'c6g.large',
}));

test.done();
Expand Down
1 change: 1 addition & 0 deletions packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class CloudAssembly {

public async selectStacks(selectors: string[], options: SelectStacksOptions): Promise<StackCollection> {
selectors = selectors.filter(s => s != null); // filter null/undefined
selectors = [...new Set(selectors)]; // make them unique

const stacks = this.assembly.stacks;
if (stacks.length === 0) {
Expand Down
13 changes: 13 additions & 0 deletions packages/aws-cdk/test/api/cloud-assembly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ test('select behavior: single', async () => {
.rejects.toThrow('Since this app includes more than a single stack, specify which stacks to use (wildcards are supported)');
});

test('select behavior: repeat', async () => {
// GIVEN
const cxasm = await testCloudAssembly();

// WHEN
const x = await cxasm.selectStacks(['withouterrors', 'withouterrors'], {
defaultBehavior: DefaultSelection.AllStacks,
});

// THEN
expect(x.stackCount).toBe(1);
});

async function testCloudAssembly({ env }: { env?: string, versionReporting?: boolean } = {}) {
const cloudExec = new MockCloudExecutable({
stacks: [{
Expand Down

0 comments on commit 405b742

Please sign in to comment.