Skip to content

Commit

Permalink
Merge branch 'master' into chore/improve-docker-bundle-performance-on…
Browse files Browse the repository at this point in the history
…-macos
  • Loading branch information
Dzhuneyt committed Jul 1, 2020
2 parents 6f0eaec + e38b692 commit 9d392a8
Show file tree
Hide file tree
Showing 33 changed files with 1,476 additions and 47 deletions.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,52 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.48.0](https://github.com/aws/aws-cdk/compare/v1.47.1...v1.48.0) (2020-07-01)


### ⚠ BREAKING CHANGES

* **stepfunctions-tasks:** `containerName` is not supported as an override anymore and has been replaced by `containerDefinition`
* **stepfunctions-tasks:** `EvaluateExpression` is now a construct representing a task state rather than an embedded property called `task`
* **backup:** existing vaults that use a generated name will be replaced but
existing recovery points won't be lost. The default vault removal policy is
`RETAIN` and if it was set to `DESTROY` the deployment will fail because
vault with recovery points cannot be deleted.

### Features

* **autoscaling:** bring your own security group ([3698f47](https://github.com/aws/aws-cdk/commit/3698f47bad970be6f3765e4f145d64f59ded4276))
* **aws-cloudwatch:** add comparison operators ([#8812](https://github.com/aws/aws-cdk/issues/8812)) ([7003a09](https://github.com/aws/aws-cdk/commit/7003a09c4cc5390c4b1c125e79d50cf7ba2c9723)), closes [#8808](https://github.com/aws/aws-cdk/issues/8808)
* **cfn-include:** add support for YAML templates ([#8746](https://github.com/aws/aws-cdk/issues/8746)) ([293a937](https://github.com/aws/aws-cdk/commit/293a937a6c24681319ae7ca210ffdd0b2ba7d88a)), closes [#8745](https://github.com/aws/aws-cdk/issues/8745)
* **cfnspec:** cloudformation spec v16.0.0 ([#8807](https://github.com/aws/aws-cdk/issues/8807)) ([4ce27f4](https://github.com/aws/aws-cdk/commit/4ce27f4195c70bd9e365ec0e0df5c0ede863bc8a))
* **cli:** support multiple verbosity levels ([#8749](https://github.com/aws/aws-cdk/issues/8749)) ([fa4196b](https://github.com/aws/aws-cdk/commit/fa4196b11a4b843af1401cbcfd3fe075986ec5c0))
* **ec2:** `Volume` construct ([#8219](https://github.com/aws/aws-cdk/issues/8219)) ([7490dee](https://github.com/aws/aws-cdk/commit/7490deef3390f024dede3da8b95bcec6140ce1be))
* **ec2:** add 6xlarge InstanceSize ([#8701](https://github.com/aws/aws-cdk/issues/8701)) ([4917c04](https://github.com/aws/aws-cdk/commit/4917c04a23852608c4c697bff02a1085fdfd4b8c))
* **ec2:** natGateways=0 disables private subnets ([#8817](https://github.com/aws/aws-cdk/issues/8817)) ([7f432ff](https://github.com/aws/aws-cdk/commit/7f432ffd2c4755bd0976c1777021dad4c7cf2e26)), closes [#4814](https://github.com/aws/aws-cdk/issues/4814)
* **efs:** Filesystem.addAccessPoint() ([#8737](https://github.com/aws/aws-cdk/issues/8737)) ([127547a](https://github.com/aws/aws-cdk/commit/127547a8d64c25fef7c330abee06fd890354afec))
* **lambda-nodejs:** external and install modules ([#8681](https://github.com/aws/aws-cdk/issues/8681)) ([401594e](https://github.com/aws/aws-cdk/commit/401594ea6cd1c9dc7c4f62ffeee95a720a0ec337)), closes [#6323](https://github.com/aws/aws-cdk/issues/6323) [#7912](https://github.com/aws/aws-cdk/issues/7912)
* **secretsmanager:** add grantUpdate method ([#8600](https://github.com/aws/aws-cdk/issues/8600)) ([4e72d1e](https://github.com/aws/aws-cdk/commit/4e72d1e9f00ff464c9e645fe55f9178e30ad44df)), closes [#8491](https://github.com/aws/aws-cdk/issues/8491)
* **stepfunctions:** class for working with Json paths to retrieve state machine data and context ([#8647](https://github.com/aws/aws-cdk/issues/8647)) ([67978a1](https://github.com/aws/aws-cdk/commit/67978a1cc92c9e7bea389e533b893efedd204c66))
* **stepfunctions-tasks:** evaluate expression as a task construct ([#8555](https://github.com/aws/aws-cdk/issues/8555)) ([83fd2ae](https://github.com/aws/aws-cdk/commit/83fd2aee6389d03cfe69260b996d7d09398bbf99))
* **stepfunctions-tasks:** task construct to call `RunJob` on ECS ([#8451](https://github.com/aws/aws-cdk/issues/8451)) ([13deb26](https://github.com/aws/aws-cdk/commit/13deb266f030a28890b5672a0c12b658d253f57e)), closes [#8610](https://github.com/aws/aws-cdk/issues/8610)


### Bug Fixes

* **apigateway:** error defining lambda integration on imported RestApi ([#8785](https://github.com/aws/aws-cdk/issues/8785)) ([05aaf42](https://github.com/aws/aws-cdk/commit/05aaf422e71e12ea6ec91ea26bfbce81ebfea7f4)), closes [#8679](https://github.com/aws/aws-cdk/issues/8679)
* **backup:** correctly validate Vault name ([#8689](https://github.com/aws/aws-cdk/issues/8689)) ([07b330c](https://github.com/aws/aws-cdk/commit/07b330cf39be2a98fbee93915f07c2c34136e105))
* **backup:** vault name may exceed 50 characters ([#8653](https://github.com/aws/aws-cdk/issues/8653)) ([d09c121](https://github.com/aws/aws-cdk/commit/d09c121e84c0c106f25a129066b0990fb237b841)), closes [#8627](https://github.com/aws/aws-cdk/issues/8627)
* **batch:** Invalid spot fleet service role ([#8325](https://github.com/aws/aws-cdk/issues/8325)) ([034bc35](https://github.com/aws/aws-cdk/commit/034bc354ace24965cd091f423b8f2ef91f487a7a)), closes [#6706](https://github.com/aws/aws-cdk/issues/6706)
* **cli:** post install warnings are not clearly visible when running cdk init ([#8723](https://github.com/aws/aws-cdk/issues/8723)) ([2662db3](https://github.com/aws/aws-cdk/commit/2662db3218387a6264b37190c231e3b0006eb6b6)), closes [#8720](https://github.com/aws/aws-cdk/issues/8720)
* **cli:** unable to use "legacy" bootstrap with --public-access-block-configuration=false ([#8755](https://github.com/aws/aws-cdk/issues/8755)) ([88f8e1e](https://github.com/aws/aws-cdk/commit/88f8e1e9475c66114796dd2840c67a3f4e11f57f)), closes [#8728](https://github.com/aws/aws-cdk/issues/8728)
* **cognito:** cannot add multiple route53 targets to the same user pool domain ([#8622](https://github.com/aws/aws-cdk/issues/8622)) ([32b54a5](https://github.com/aws/aws-cdk/commit/32b54a504357922e55ac98850a8e4acc9a0349f5)), closes [#8603](https://github.com/aws/aws-cdk/issues/8603)
* **core:** bundling directory access permission is too restrictive ([#8767](https://github.com/aws/aws-cdk/issues/8767)) ([1842168](https://github.com/aws/aws-cdk/commit/18421686c4109deb018cc77429ec6deefb7d5689)), closes [#8757](https://github.com/aws/aws-cdk/issues/8757)
* **eks:** Helm chart timeout expects duration ([#8773](https://github.com/aws/aws-cdk/issues/8773)) ([d1c2ef2](https://github.com/aws/aws-cdk/commit/d1c2ef2fc8a845446c956e5e1eb32745f1810ee9)), closes [#8718](https://github.com/aws/aws-cdk/issues/8718)
* **elbv2:** Add missing accounts to ELBv2 Log Delivery. ([#8715](https://github.com/aws/aws-cdk/issues/8715)) ([8914899](https://github.com/aws/aws-cdk/commit/8914899aafcaa28d8b7ca2d2901f86b016179b50))
* **rewrite:** script ignores list of files ([#8777](https://github.com/aws/aws-cdk/issues/8777)) ([bb514c1](https://github.com/aws/aws-cdk/commit/bb514c1eb1098ccbe5cee4d7570d11bc8d9155c3))
* **route53-targets:** A/AAAA Alias Record to ELB cannot resolve IPv6 addresses ([#8747](https://github.com/aws/aws-cdk/issues/8747)) ([87e2651](https://github.com/aws/aws-cdk/commit/87e265114590d8fcc69e18b42d777b8ca201307c)), closes [#6271](https://github.com/aws/aws-cdk/issues/6271)
* **s3-notifications:** broken permissions query in `LambdaDestination` ([#8741](https://github.com/aws/aws-cdk/issues/8741)) ([10bd8e4](https://github.com/aws/aws-cdk/commit/10bd8e49709330624eee5f2c2662dee11e19e130)), closes [#8538](https://github.com/aws/aws-cdk/issues/8538)

## [1.47.1](https://github.com/aws/aws-cdk/compare/v1.47.0...v1.47.1) (2020-06-30)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -10,5 +10,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.47.1"
"version": "1.48.0"
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/package.json
Expand Up @@ -64,7 +64,7 @@
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@types/nodeunit": "^0.0.31",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudtrail/package.json
Expand Up @@ -64,7 +64,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/package.json
Expand Up @@ -70,7 +70,7 @@
"@aws-cdk/aws-sns": "0.0.0",
"@aws-cdk/aws-sqs": "0.0.0",
"@types/nodeunit": "^0.0.31",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codecommit/package.json
Expand Up @@ -70,7 +70,7 @@
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-sns": "0.0.0",
"@types/nodeunit": "^0.0.31",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-dynamodb/package.json
Expand Up @@ -65,7 +65,7 @@
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@types/jest": "^26.0.3",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"aws-sdk-mock": "^5.1.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
8 changes: 5 additions & 3 deletions packages/@aws-cdk/aws-ec2/README.md
Expand Up @@ -48,9 +48,11 @@ distinguishes three different subnet types:
connected to from other instances in the same VPC. A default VPC configuration
will not include isolated subnets,

A default VPC configuration will create public and private subnets, but not
isolated subnets. See *Advanced Subnet Configuration* below for information
on how to change the default subnet configuration.

A default VPC configuration will create public and **private** subnets. However, if
`natGateways:0` **and** `subnetConfiguration` is undefined, default VPC configuration
will create public and **isolated** subnets. See [*Advanced Subnet Configuration*](#advanced-subnet-configuration)
below for information on how to change the default subnet configuration.

Constructs using the VPC will "launch instances" (or more accurately, create
Elastic Network Interfaces) into one or more of the subnets. They all accept
Expand Down
19 changes: 18 additions & 1 deletion packages/@aws-cdk/aws-ec2/lib/vpc.ts
Expand Up @@ -968,6 +968,22 @@ export class Vpc extends VpcBase {
},
];

/**
* The default subnet configuration if natGateways specified to be 0
*
* 1 Public and 1 Isolated Subnet per AZ evenly split
*/
public static readonly DEFAULT_SUBNETS_NO_NAT: SubnetConfiguration[] = [
{
subnetType: SubnetType.PUBLIC,
name: defaultSubnetName(SubnetType.PUBLIC),
},
{
subnetType: SubnetType.ISOLATED,
name: defaultSubnetName(SubnetType.ISOLATED),
},
];

/**
* Import an exported VPC
*/
Expand Down Expand Up @@ -1152,7 +1168,8 @@ export class Vpc extends VpcBase {

this.vpcId = this.resource.ref;

this.subnetConfiguration = ifUndefined(props.subnetConfiguration, Vpc.DEFAULT_SUBNETS);
const defaultSubnet = props.natGateways === 0 ? Vpc.DEFAULT_SUBNETS_NO_NAT : Vpc.DEFAULT_SUBNETS;
this.subnetConfiguration = ifUndefined(props.subnetConfiguration, defaultSubnet);

const natGatewayPlacement = props.natGatewaySubnets || { subnetType: SubnetType.PUBLIC };
const natGatewayCount = determineNatGatewayCount(props.natGateways, this.subnetConfiguration, this.availabilityZones.length);
Expand Down
34 changes: 33 additions & 1 deletion packages/@aws-cdk/aws-ec2/test/vpc.test.ts
Expand Up @@ -417,17 +417,49 @@ nodeunitShim({
test.done();
},

'natGateways = 0 requires there to be no PRIVATE subnets'(test: Test) {
'natGateways = 0 throws if no PRIVATE subnets configured'(test: Test) {
const stack = getTestStack();
test.throws(() => {
new Vpc(stack, 'VPC', {
natGateways: 0,
subnetConfiguration: [
{
name: 'public',
subnetType: SubnetType.PUBLIC,
},
{
name: 'private',
subnetType: SubnetType.PRIVATE,
},
],
});
}, /make sure you don't configure any PRIVATE subnets/);
test.done();

},

'natGateway = 0 defaults with ISOLATED subnet'(test: Test) {
const stack = getTestStack();
new Vpc(stack, 'VPC', {
natGateways: 0,
});
expect(stack).to(haveResource('AWS::EC2::Subnet', hasTags([{
Key: 'aws-cdk:subnet-type',
Value: 'Isolated',
}])));
test.done();
},

'unspecified natGateways constructs with PRIVATE subnet'(test: Test) {
const stack = getTestStack();
new Vpc(stack, 'VPC');
expect(stack).to(haveResource('AWS::EC2::Subnet', hasTags([{
Key: 'aws-cdk:subnet-type',
Value: 'Private',
}])));
test.done();
},

'natGateways = 0 allows RESERVED PRIVATE subnets'(test: Test) {
const stack = getTestStack();
new Vpc(stack, 'VPC', {
Expand Down
46 changes: 45 additions & 1 deletion packages/@aws-cdk/aws-eks/README.md
Expand Up @@ -341,6 +341,38 @@ CDK. This means that if the resource is deleted from your code (or the stack is
deleted), the next `cdk deploy` will issue a `kubectl delete` command and the
Kubernetes resources will be deleted.

#### Dependencies

There are cases where Kubernetes resources must be deployed in a specific order.
For example, you cannot define a resource in a Kubernetes namespace before the
namespace was created.

You can represent dependencies between `KubernetesResource`s using
`resource.node.addDependency()`:

```ts
const namespace = cluster.addResource('my-namespace', {
apiVersion: 'v1',
kind: 'Namespace',
metadata: { name: 'my-app' }
});

const service = cluster.addResource('my-service', {
metadata: {
name: 'myservice',
namespace: 'my-app'
},
spec: // ...
});

service.node.addDependency(namespace); // will apply `my-namespace` before `my-service`.
```

NOTE: when a `KubernetesResource` includes multiple resources (either directly
or through `cluster.addResource()`) (e.g. `cluster.addResource('foo', r1, r2,
r3,...))`), these resources will be applied as a single manifest via `kubectl`
and will be applied sequentially (the standard behavior in `kubectl`).

### Patching Kubernetes Resources

The KubernetesPatch construct can be used to update existing kubernetes
Expand Down Expand Up @@ -524,8 +556,20 @@ deleted), the next `cdk deploy` will issue a `helm uninstall` command and the
Helm chart will be deleted.

When there is no `release` defined, the chart will be installed using the `node.uniqueId`,
which will be lower cassed and truncated to the last 63 characters.
which will be lower cased and truncated to the last 63 characters.

By default, all Helm charts will be installed concurrently. In some cases, this
could cause race conditions where two Helm charts attempt to deploy the same
resource or if Helm charts depend on each other. You can use
`chart.node.addDependency()` in order to declare a dependency order between
charts:

```ts
const chart1 = cluster.addChart(...);
const chart2 = cluster.addChart(...);

chart2.node.addDependency(chart1);
```

### Bottlerocket

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks/package.json
Expand Up @@ -65,7 +65,7 @@
"@aws-cdk/assert": "0.0.0",
"@types/nodeunit": "^0.0.31",
"@types/yaml": "1.2.0",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
31 changes: 28 additions & 3 deletions packages/@aws-cdk/aws-eks/test/integ.eks-cluster.expected.json
Expand Up @@ -2361,6 +2361,29 @@
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"ClustermanifestnginxnamespaceA68B4CE0": {
"Type": "Custom::AWSCDK-EKS-KubernetesResource",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B",
"Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn"
]
},
"Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"nginx\"}}]",
"ClusterName": {
"Ref": "Cluster9EE0221C"
},
"RoleArn": {
"Fn::GetAtt": [
"ClusterCreationRole360249B6",
"Arn"
]
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"Clusterchartnginxingress1193EC3F": {
"Type": "Custom::AWSCDK-EKS-HelmChart",
"Properties": {
Expand All @@ -2383,10 +2406,12 @@
"Chart": "nginx-ingress",
"Wait": true,
"Timeout": "900s",
"Namespace": "kube-system",
"Repository": "https://helm.nginx.com/stable",
"CreateNamespace": true
"Namespace": "nginx",
"Repository": "https://helm.nginx.com/stable"
},
"DependsOn": [
"ClustermanifestnginxnamespaceA68B4CE0"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
Expand Down
20 changes: 17 additions & 3 deletions packages/@aws-cdk/aws-eks/test/integ.eks-cluster.ts
Expand Up @@ -72,20 +72,34 @@ class EksClusterStack extends TestStack {
// apply a kubernetes manifest
cluster.addResource('HelloApp', ...hello.resources);

// add two Helm charts to the cluster. This will be the Kubernetes dashboard and the Nginx Ingress Controller
// deploy the Kubernetes dashboard through a helm chart
cluster.addChart('dashboard', {
chart: 'kubernetes-dashboard',
repository: 'https://kubernetes.github.io/dashboard/',
});

cluster.addChart('nginx-ingress', {
// deploy an nginx ingress in a namespace

const nginxNamespace = cluster.addResource('nginx-namespace', {
apiVersion: 'v1',
kind: 'Namespace',
metadata: {
name: 'nginx',
},
});

const nginxIngress = cluster.addChart('nginx-ingress', {
chart: 'nginx-ingress',
repository: 'https://helm.nginx.com/stable',
namespace: 'kube-system',
namespace: 'nginx',
wait: true,
createNamespace: false,
timeout: Duration.minutes(15),
});

// make sure namespace is deployed before the chart
nginxIngress.node.addDependency(nginxNamespace);

// add a service account connected to a IAM role
cluster.addServiceAccount('MyServiceAccount');

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-events-targets/package.json
Expand Up @@ -68,7 +68,7 @@
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-codecommit": "0.0.0",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"aws-sdk-mock": "^5.1.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-lambda/package.json
Expand Up @@ -71,13 +71,13 @@
"@types/lodash": "^4.14.157",
"@types/nodeunit": "^0.0.31",
"@types/sinon": "^9.0.4",
"aws-sdk": "^2.707.0",
"aws-sdk": "^2.708.0",
"aws-sdk-mock": "^5.1.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
"lodash": "^4.17.15",
"nock": "^13.0.0",
"nock": "^13.0.1",
"nodeunit": "^0.11.3",
"pkglint": "0.0.0",
"sinon": "^9.0.2"
Expand Down

0 comments on commit 9d392a8

Please sign in to comment.