Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into rmuller/contributin…
Browse files Browse the repository at this point in the history
…g-md
  • Loading branch information
RomainMuller committed Nov 26, 2018
2 parents 0481a21 + 10b7092 commit e4fc2e2
Show file tree
Hide file tree
Showing 23 changed files with 317 additions and 142 deletions.
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ manually executed (paste output to the PR description)
### Title and description

- [ ] __Change type__: Title is prefixed with change type:
* `fix(module): <title>` bug fix (_patch_)
* `feat(module): <title>` feature/capability (_minor_)
* `chore(module): <title> ` won't appear in changelog
* `build(module): <title>` won't appear in changelog
* `fix(module): <title>` bug fix (_patch_)
* `feat(module): <title>` feature/capability (_minor_)
* `chore(module): <title> ` won't appear in changelog
* `build(module): <title>` won't appear in changelog
- [ ] __Title format__: Title uses lower case and doesn't end with a period
- [ ] __Breaking change?__: Last paragraph of description is: `BREAKING
CHANGE: <describe exactly what changed and how to achieve similar behavior +
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ In order to enable efficient collaboration over design documents, the following
1. Open an issue describing the requirements and constraints the design must satisfy
+ Provide a clear list of use-cases that the design intends to address
2. Open a pull request with a Markdown document describing the proposed design. The document should be placed in the
`designs` directory at the root of the repository.
`design` directory at the root of the repository.
+ Design discussions are tracked using the comment stream of the pull request
+ The design document will be merged in and retained as if it were code

Expand Down
2 changes: 1 addition & 1 deletion examples/cdk-examples-typescript/advanced-usage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PolicyExample extends cdk.Stack {
// here's how to create an IAM Role with an assume policy for the Lambda
// service principal.
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('lambda.amazon.aws.com')
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com')
});

// when you call `addToPolicy`, a default policy is defined and attached
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ export class CloudFrontWebDistribution extends cdk.Construct implements route53.
defaultRootObject: props.defaultRootObject !== undefined ? props.defaultRootObject : "index.html",
httpVersion: props.httpVersion || HttpVersion.HTTP2,
priceClass: props.priceClass || PriceClass.PriceClass100,
ipv6Enabled: props.enableIpV6 || true,
ipv6Enabled: (props.enableIpV6 !== undefined) ? props.enableIpV6 : true,
// tslint:disable-next-line:max-line-length
customErrorResponses: props.errorConfigurations, // TODO: validation : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-errorcachingminttl
webAclId: props.webACLId,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"Resources": {
"Bucket83908E77": {
"Type": "AWS::S3::Bucket"
},
"MyDistributionCFDistributionDE147309": {
"Type": "AWS::CloudFront::Distribution",
"Properties": {
"DistributionConfig": {
"CacheBehaviors": [],
"DefaultCacheBehavior": {
"AllowedMethods": [
"GET",
"HEAD"
],
"CachedMethods": [
"GET",
"HEAD"
],
"ForwardedValues": {
"Cookies": {
"Forward": "none"
},
"QueryString": false
},
"TargetOriginId": "origin1",
"ViewerProtocolPolicy": "redirect-to-https"
},
"DefaultRootObject": "index.html",
"Enabled": true,
"HttpVersion": "http2",
"IPV6Enabled": false,
"Origins": [
{
"DomainName": {
"Fn::GetAtt": [
"Bucket83908E77",
"DomainName"
]
},
"Id": "origin1",
"S3OriginConfig": {}
}
],
"PriceClass": "PriceClass_100",
"ViewerCertificate": {
"CloudFrontDefaultCertificate": true
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

import s3 = require('@aws-cdk/aws-s3');
import cdk = require('@aws-cdk/cdk');
import cloudfront = require('../lib');

const app = new cdk.App();

const stack = new cdk.Stack(app, 'aws-cdk-cloudfront');

const sourceBucket = new s3.Bucket(stack, 'Bucket');

new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribution', {
originConfigs: [
{
s3OriginSource: {
s3BucketSource: sourceBucket
},
behaviors : [ {isDefaultBehavior: true}]
}
],
enableIpV6: false
});

app.run();
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-ec2/lib/security-group-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ export class IcmpPing implements IPortRange {
return {
ipProtocol: Protocol.Icmp,
fromPort: 8,
toPort: -1
};
}

Expand Down
84 changes: 72 additions & 12 deletions packages/@aws-cdk/aws-ec2/test/integ.vpc.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@
},
"MyVpcPublicSubnet1DefaultRoute95FDF9EB": {
"Type": "AWS::EC2::Route",
"DependsOn": [
"MyVpcVPCGW488ACE0D"
],
"Properties": {
"RouteTableId": {
"Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4"
Expand All @@ -78,7 +75,10 @@
"GatewayId": {
"Ref": "MyVpcIGW5C4A4F63"
}
}
},
"DependsOn": [
"MyVpcVPCGW488ACE0D"
]
},
"MyVpcPublicSubnet1EIP096967CB": {
"Type": "AWS::EC2::EIP",
Expand Down Expand Up @@ -158,9 +158,6 @@
},
"MyVpcPublicSubnet2DefaultRoute052936F6": {
"Type": "AWS::EC2::Route",
"DependsOn": [
"MyVpcVPCGW488ACE0D"
],
"Properties": {
"RouteTableId": {
"Ref": "MyVpcPublicSubnet2RouteTable1DF17386"
Expand All @@ -169,7 +166,10 @@
"GatewayId": {
"Ref": "MyVpcIGW5C4A4F63"
}
}
},
"DependsOn": [
"MyVpcVPCGW488ACE0D"
]
},
"MyVpcPublicSubnet2EIP8CCBA239": {
"Type": "AWS::EC2::EIP",
Expand Down Expand Up @@ -249,9 +249,6 @@
},
"MyVpcPublicSubnet3DefaultRoute3A83AB36": {
"Type": "AWS::EC2::Route",
"DependsOn": [
"MyVpcVPCGW488ACE0D"
],
"Properties": {
"RouteTableId": {
"Ref": "MyVpcPublicSubnet3RouteTable15028F08"
Expand All @@ -260,7 +257,10 @@
"GatewayId": {
"Ref": "MyVpcIGW5C4A4F63"
}
}
},
"DependsOn": [
"MyVpcVPCGW488ACE0D"
]
},
"MyVpcPublicSubnet3EIPC5ACADAB": {
"Type": "AWS::EC2::EIP",
Expand Down Expand Up @@ -495,6 +495,66 @@
"Ref": "MyVpcIGW5C4A4F63"
}
}
},
"SGADB53937": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "aws-cdk-ec2-vpc/SG",
"SecurityGroupEgress": [
{
"CidrIp": "0.0.0.0/0",
"Description": "Allow all outbound traffic by default",
"IpProtocol": "-1"
}
],
"SecurityGroupIngress": [
{
"CidrIp": "0.0.0.0/0",
"Description": "from 0.0.0.0/0:ICMP PING",
"FromPort": 8,
"IpProtocol": "icmp",
"ToPort": -1
},
{
"CidrIp": "0.0.0.0/0",
"Description": "from 0.0.0.0/0:ICMP Type 128",
"FromPort": 128,
"IpProtocol": "icmp",
"ToPort": -1
},
{
"CidrIp": "0.0.0.0/0",
"Description": "from 0.0.0.0/0:ALL ICMP",
"FromPort": -1,
"IpProtocol": "icmp",
"ToPort": -1
},
{
"CidrIp": "0.0.0.0/0",
"Description": "from 0.0.0.0/0:UDP ALL PORTS",
"FromPort": 0,
"IpProtocol": "udp",
"ToPort": 65535
},
{
"CidrIp": "0.0.0.0/0",
"Description": "from 0.0.0.0/0:UDP 123",
"FromPort": 123,
"IpProtocol": "udp",
"ToPort": 123
},
{
"CidrIp": "0.0.0.0/0",
"Description": "from 0.0.0.0/0:UDP 800-801",
"FromPort": 800,
"IpProtocol": "udp",
"ToPort": 801
}
],
"VpcId": {
"Ref": "MyVpcF9F0CA6F"
}
}
}
}
}
25 changes: 20 additions & 5 deletions packages/@aws-cdk/aws-ec2/test/integ.vpc.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import { App, Stack } from '@aws-cdk/cdk';
import { VpcNetwork } from '../lib';
import cdk = require('@aws-cdk/cdk');
import ec2 = require('../lib');

const app = new App();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-ec2-vpc');

const stack = new Stack(app, 'aws-cdk-ec2-vpc');
const vpc = new ec2.VpcNetwork(stack, 'MyVpc');

new VpcNetwork(stack, 'MyVpc');
// Test Security Group Rules
const sg = new ec2.SecurityGroup(stack, 'SG', { vpc });

const rules = [
new ec2.IcmpPing(),
new ec2.IcmpAllTypeCodes(128),
new ec2.IcmpAllTypesAndCodes(),
new ec2.UdpAllPorts(),
new ec2.UdpPort(123),
new ec2.UdpPortRange(800, 801),
];

for (const rule of rules) {
sg.addIngressRule(new ec2.AnyIPv4(), rule);
}

app.run();
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-s3-deployment/lambda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cd ${staging}
# Must use --prefix to because --target cannot be used on
# platforms that have a default --prefix set.
pip3 install --ignore-installed --prefix ${piptemp} -r ${staging}/requirements.txt
mv ${piptemp}/lib/python*/site-packages/* .
mv ${piptemp}/lib/python*/*-packages/* .

# create archive
zip -qr ${bundle_out} .
Expand Down
58 changes: 0 additions & 58 deletions packages/@aws-cdk/cx-api/lib/cxapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,64 +103,6 @@ export const DEFAULT_ACCOUNT_CONTEXT_KEY = 'aws:cdk:toolkit:default-account';
*/
export const DEFAULT_REGION_CONTEXT_KEY = 'aws:cdk:toolkit:default-region';

export const ASSET_METADATA = 'aws:cdk:asset';

export interface FileAssetMetadataEntry {
/**
* Requested packaging style
*/
packaging: 'zip' | 'file';

/**
* Path on disk to the asset
*/
path: string;

/**
* Logical identifier for the asset
*/
id: string;

/**
* Name of parameter where S3 bucket should be passed in
*/
s3BucketParameter: string;

/**
* Name of parameter where S3 key should be passed in
*/
s3KeyParameter: string;
}

export interface ContainerImageAssetMetadataEntry {
/**
* Type of asset
*/
packaging: 'container-image';

/**
* Path on disk to the asset
*/
path: string;

/**
* Logical identifier for the asset
*/
id: string;

/**
* Name of the parameter that takes the repository name
*/
repositoryParameter: string;

/**
* Name of the parameter that takes the tag
*/
tagParameter: string;
}

export type AssetMetadataEntry = FileAssetMetadataEntry | ContainerImageAssetMetadataEntry;

/**
* Metadata key used to print INFO-level messages by the toolkit when an app is syntheized.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/cx-api/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './context/hosted-zone';
export * from './context/vpc';
export * from './context/ssm-parameter';
export * from './context/availability-zones';
export * from './metadata/assets';
Loading

0 comments on commit e4fc2e2

Please sign in to comment.