forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With this change, the `Vpc` construct gains a new constructor prop, `availabilityZones`, which gives more control over AZs than the existing `maxAzs` prop. closes aws#5847
- Loading branch information
Showing
9 changed files
with
806 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as ec2 from '../lib'; | ||
|
||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'aws-cdk-ec2-vpc-azs'); | ||
|
||
new ec2.Vpc(stack, 'MyVpc', { | ||
availabilityZones: [stack.availabilityZones[1]], | ||
}); | ||
|
||
app.synth(); |
19 changes: 19 additions & 0 deletions
19
packages/@aws-cdk/aws-ec2/test/vpc-azs.integ.snapshot/aws-cdk-ec2-vpc-azs.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "20.0.0", | ||
"files": { | ||
"77e3ec18ea13d0b9b35f46a46f01b621e0df5c75fdad25fb81a3ffef3a6f1a17": { | ||
"source": { | ||
"path": "aws-cdk-ec2-vpc-azs.template.json", | ||
"packaging": "file" | ||
}, | ||
"destinations": { | ||
"current_account-current_region": { | ||
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", | ||
"objectKey": "77e3ec18ea13d0b9b35f46a46f01b621e0df5c75fdad25fb81a3ffef3a6f1a17.json", | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" | ||
} | ||
} | ||
} | ||
}, | ||
"dockerImages": {} | ||
} |
214 changes: 214 additions & 0 deletions
214
packages/@aws-cdk/aws-ec2/test/vpc-azs.integ.snapshot/aws-cdk-ec2-vpc-azs.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
{ | ||
"Resources": { | ||
"MyVpcF9F0CA6F": { | ||
"Type": "AWS::EC2::VPC", | ||
"Properties": { | ||
"CidrBlock": "10.0.0.0/16", | ||
"EnableDnsHostnames": true, | ||
"EnableDnsSupport": true, | ||
"InstanceTenancy": "default", | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPublicSubnet1SubnetF6608456": { | ||
"Type": "AWS::EC2::Subnet", | ||
"Properties": { | ||
"VpcId": { | ||
"Ref": "MyVpcF9F0CA6F" | ||
}, | ||
"AvailabilityZone": { | ||
"Fn::Select": [ | ||
1, | ||
{ | ||
"Fn::GetAZs": "" | ||
} | ||
] | ||
}, | ||
"CidrBlock": "10.0.0.0/17", | ||
"MapPublicIpOnLaunch": true, | ||
"Tags": [ | ||
{ | ||
"Key": "aws-cdk:subnet-name", | ||
"Value": "Public" | ||
}, | ||
{ | ||
"Key": "aws-cdk:subnet-type", | ||
"Value": "Public" | ||
}, | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc/PublicSubnet1" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPublicSubnet1RouteTableC46AB2F4": { | ||
"Type": "AWS::EC2::RouteTable", | ||
"Properties": { | ||
"VpcId": { | ||
"Ref": "MyVpcF9F0CA6F" | ||
}, | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc/PublicSubnet1" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB": { | ||
"Type": "AWS::EC2::SubnetRouteTableAssociation", | ||
"Properties": { | ||
"RouteTableId": { | ||
"Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" | ||
}, | ||
"SubnetId": { | ||
"Ref": "MyVpcPublicSubnet1SubnetF6608456" | ||
} | ||
} | ||
}, | ||
"MyVpcPublicSubnet1DefaultRoute95FDF9EB": { | ||
"Type": "AWS::EC2::Route", | ||
"Properties": { | ||
"RouteTableId": { | ||
"Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" | ||
}, | ||
"DestinationCidrBlock": "0.0.0.0/0", | ||
"GatewayId": { | ||
"Ref": "MyVpcIGW5C4A4F63" | ||
} | ||
}, | ||
"DependsOn": [ | ||
"MyVpcVPCGW488ACE0D" | ||
] | ||
}, | ||
"MyVpcPublicSubnet1EIP096967CB": { | ||
"Type": "AWS::EC2::EIP", | ||
"Properties": { | ||
"Domain": "vpc", | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc/PublicSubnet1" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPublicSubnet1NATGatewayAD3400C1": { | ||
"Type": "AWS::EC2::NatGateway", | ||
"Properties": { | ||
"SubnetId": { | ||
"Ref": "MyVpcPublicSubnet1SubnetF6608456" | ||
}, | ||
"AllocationId": { | ||
"Fn::GetAtt": [ | ||
"MyVpcPublicSubnet1EIP096967CB", | ||
"AllocationId" | ||
] | ||
}, | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc/PublicSubnet1" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPrivateSubnet1Subnet5057CF7E": { | ||
"Type": "AWS::EC2::Subnet", | ||
"Properties": { | ||
"VpcId": { | ||
"Ref": "MyVpcF9F0CA6F" | ||
}, | ||
"AvailabilityZone": { | ||
"Fn::Select": [ | ||
1, | ||
{ | ||
"Fn::GetAZs": "" | ||
} | ||
] | ||
}, | ||
"CidrBlock": "10.0.128.0/17", | ||
"MapPublicIpOnLaunch": false, | ||
"Tags": [ | ||
{ | ||
"Key": "aws-cdk:subnet-name", | ||
"Value": "Private" | ||
}, | ||
{ | ||
"Key": "aws-cdk:subnet-type", | ||
"Value": "Private" | ||
}, | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc/PrivateSubnet1" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPrivateSubnet1RouteTable8819E6E2": { | ||
"Type": "AWS::EC2::RouteTable", | ||
"Properties": { | ||
"VpcId": { | ||
"Ref": "MyVpcF9F0CA6F" | ||
}, | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc/PrivateSubnet1" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcPrivateSubnet1RouteTableAssociation56D38C7E": { | ||
"Type": "AWS::EC2::SubnetRouteTableAssociation", | ||
"Properties": { | ||
"RouteTableId": { | ||
"Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" | ||
}, | ||
"SubnetId": { | ||
"Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" | ||
} | ||
} | ||
}, | ||
"MyVpcPrivateSubnet1DefaultRouteA8CDE2FA": { | ||
"Type": "AWS::EC2::Route", | ||
"Properties": { | ||
"RouteTableId": { | ||
"Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" | ||
}, | ||
"DestinationCidrBlock": "0.0.0.0/0", | ||
"NatGatewayId": { | ||
"Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1" | ||
} | ||
} | ||
}, | ||
"MyVpcIGW5C4A4F63": { | ||
"Type": "AWS::EC2::InternetGateway", | ||
"Properties": { | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "aws-cdk-ec2-vpc-azs/MyVpc" | ||
} | ||
] | ||
} | ||
}, | ||
"MyVpcVPCGW488ACE0D": { | ||
"Type": "AWS::EC2::VPCGatewayAttachment", | ||
"Properties": { | ||
"VpcId": { | ||
"Ref": "MyVpcF9F0CA6F" | ||
}, | ||
"InternetGatewayId": { | ||
"Ref": "MyVpcIGW5C4A4F63" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"20.0.0"} |
14 changes: 14 additions & 0 deletions
14
packages/@aws-cdk/aws-ec2/test/vpc-azs.integ.snapshot/integ.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"version": "20.0.0", | ||
"testCases": { | ||
"integ.vpc-azs": { | ||
"stacks": [ | ||
"aws-cdk-ec2-vpc-azs" | ||
], | ||
"diffAssets": false, | ||
"stackUpdateWorkflow": true | ||
} | ||
}, | ||
"synthContext": {}, | ||
"enableLookups": false | ||
} |
Oops, something went wrong.