Skip to content

Commit

Permalink
Merge branch 'master' into thantos/aws-event-field-concat
Browse files Browse the repository at this point in the history
  • Loading branch information
thantos authored May 31, 2021
2 parents b49fa47 + ed72ad3 commit 7cb6ff5
Show file tree
Hide file tree
Showing 169 changed files with 12,933 additions and 1,774 deletions.
773 changes: 0 additions & 773 deletions .github/actions/prlinter/package-lock.json

This file was deleted.

19 changes: 0 additions & 19 deletions .github/actions/prlinter/package.json

This file was deleted.

168 changes: 103 additions & 65 deletions .github/workflows/issue-label-assign.yml

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ on:
jobs:
validate-pr:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Install packages
run: cd .github/actions/prlinter && npm ci
- name: Install & Build prlint
run: cd tools/prlint && npm ci && npm run build+test

- name: Validate
uses: ./.github/actions/prlinter
uses: ./tools/prlint
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_ROOT: ${{ github.workspace }}
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,60 @@

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.106.1](https://github.com/aws/aws-cdk/compare/v1.106.0...v1.106.1) (2021-05-26)


### Bug Fixes

* **secretsmanager**: revert "Automatically grant permissions to rotation Lambda ([#14471](https://github.com/aws/aws-cdk/issues/14471))",
fixes [#14868](https://github.com/aws/aws-cdk/issues/14868)

## [1.106.0](https://github.com/aws/aws-cdk/compare/v1.105.0...v1.106.0) (2021-05-25)


### Features

* **ecs-service-extensions**: allow taskRole to be passed in on creation of an ECS service ([3e257a0](https://github.com/aws/aws-cdk/commit/3e257a0e554851b7393f52bbbea2f5187673e8a7))
* **appmesh:** add IAM grants for StreamAggregatedResources ([#13596](https://github.com/aws/aws-cdk/issues/13596)) ([f4a2938](https://github.com/aws/aws-cdk/commit/f4a2938cf6773bf80e3316abda82d03aed051108)), closes [#11639](https://github.com/aws/aws-cdk/issues/11639)
* **cfnspec:** cloudformation spec v36.0.0 ([#14791](https://github.com/aws/aws-cdk/issues/14791)) ([3a9f56d](https://github.com/aws/aws-cdk/commit/3a9f56d5167aab6a1bd0bf8b29b53dd8658a2313))
* **dynamodb:** add ability to enable contributor insights on Table ([#14742](https://github.com/aws/aws-cdk/issues/14742)) ([3c7a89d](https://github.com/aws/aws-cdk/commit/3c7a89de6edaf7a1910bf716419dbe5568d79374))
* **lambda:** support Principal conditions in Permission ([#14674](https://github.com/aws/aws-cdk/issues/14674)) ([b78a1bb](https://github.com/aws/aws-cdk/commit/b78a1bbf445743d96c8e4f54e7d2e7cac204342a)), closes [#8116](https://github.com/aws/aws-cdk/issues/8116)
* **lambda-nodejs:** pnpm support ([#14772](https://github.com/aws/aws-cdk/issues/14772)) ([b02311c](https://github.com/aws/aws-cdk/commit/b02311cd55b5bdbe408085488dd17816f181fd2c)), closes [#14757](https://github.com/aws/aws-cdk/issues/14757)


### Bug Fixes

* **cognito:** user pool - phoneNumberVerified attribute fails deployment ([#14699](https://github.com/aws/aws-cdk/issues/14699)) ([cd2589f](https://github.com/aws/aws-cdk/commit/cd2589f560600294cc50988a98e69b091c42e3f8)), closes [#14175](https://github.com/aws/aws-cdk/issues/14175)
* **iam:** permissions boundaries not added to custom resource roles ([#14754](https://github.com/aws/aws-cdk/issues/14754)) ([f36feb5](https://github.com/aws/aws-cdk/commit/f36feb52a750a326842903ac4dc23be83e4aee1a)), closes [#13310](https://github.com/aws/aws-cdk/issues/13310)
* **lambda:** changing reserved concurrency fails lambda version deployment ([#14586](https://github.com/aws/aws-cdk/issues/14586)) ([f47d5cb](https://github.com/aws/aws-cdk/commit/f47d5cb48e641515b503bae092cd32071dae2ed9)), closes [#11537](https://github.com/aws/aws-cdk/issues/11537)
* **lambda-nodejs:** esbuild detection with Yarn 2 in PnP mode ([#14739](https://github.com/aws/aws-cdk/issues/14739)) ([5c84696](https://github.com/aws/aws-cdk/commit/5c84696a88f9319af1b2782b747e10f408c4c8fb))
* **pipelines:** self-update build fails with named pipeline stack ([#14729](https://github.com/aws/aws-cdk/issues/14729)) ([eff9c75](https://github.com/aws/aws-cdk/commit/eff9c7504710929da58eab96c45d7b925132f73e)), closes [#10782](https://github.com/aws/aws-cdk/issues/10782)

## [1.105.0](https://github.com/aws/aws-cdk/compare/v1.104.0...v1.105.0) (2021-05-19)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **lambda-nodejs:** using `banner` and `footer` now requires `esbuild` >= 0.9.0

### Features

* **apigatewayv2:** http api - lambda authorizer ([#13181](https://github.com/aws/aws-cdk/issues/13181)) ([4da78f6](https://github.com/aws/aws-cdk/commit/4da78f6ba2036f4a94d0e47c8581131b9bc23e14)), closes [#10534](https://github.com/aws/aws-cdk/issues/10534)
* **custom-resources:** restrict output of AwsCustomResource to list of paths ([#14041](https://github.com/aws/aws-cdk/issues/14041)) ([773ca8c](https://github.com/aws/aws-cdk/commit/773ca8c5d2a845f392f530d7710020075b884c72)), closes [#2825](https://github.com/aws/aws-cdk/issues/2825)
* **stepfunctions:** Add support for ResultSelector ([#14648](https://github.com/aws/aws-cdk/issues/14648)) ([50d486a](https://github.com/aws/aws-cdk/commit/50d486ad4e7d175dfac048dbb4abf5e4084ce4fe)), closes [#9904](https://github.com/aws/aws-cdk/issues/9904)


### Bug Fixes

* **cli:** Updated typo user to uses ([#14357](https://github.com/aws/aws-cdk/issues/14357)) ([7fe329c](https://github.com/aws/aws-cdk/commit/7fe329cd17502cf04c451153f6d19955621952dc))
* **core:** cannot determine packaging when bundling that produces an archive is skipped ([#14372](https://github.com/aws/aws-cdk/issues/14372)) ([163e812](https://github.com/aws/aws-cdk/commit/163e8122db994d0bea7077f025876dbeac490ead)), closes [#14369](https://github.com/aws/aws-cdk/issues/14369)
* **ecr:** add validations for ECR repository names ([#12613](https://github.com/aws/aws-cdk/issues/12613)) ([396dca9](https://github.com/aws/aws-cdk/commit/396dca965b56bfbe8a7aedb2bcaddb196b5560c4)), closes [#9877](https://github.com/aws/aws-cdk/issues/9877)
* **lambda:** unable to access SingletonFunction vpc connections ([#14533](https://github.com/aws/aws-cdk/issues/14533)) ([49d18ab](https://github.com/aws/aws-cdk/commit/49d18ab8e8f55f8b36584f7fb95427106139a140)), closes [#6261](https://github.com/aws/aws-cdk/issues/6261)
* **lambda-nodejs:** banner and footer values not escaped ([#14743](https://github.com/aws/aws-cdk/issues/14743)) ([81aa612](https://github.com/aws/aws-cdk/commit/81aa61213b4f5e3bd9cbbc155264252bd64d0f5b)), closes [#13576](https://github.com/aws/aws-cdk/issues/13576)
* **pipelines:** self-mutating builds cannot be run in privileged mode ([#14655](https://github.com/aws/aws-cdk/issues/14655)) ([73b9b4a](https://github.com/aws/aws-cdk/commit/73b9b4a89078d1425f4acdf50a6e9b5275b7e555)), closes [#11425](https://github.com/aws/aws-cdk/issues/11425)
* **pipelines:** stackOutput generates names too long to be used in useOutputs ([#14680](https://github.com/aws/aws-cdk/issues/14680)) ([d81e06d](https://github.com/aws/aws-cdk/commit/d81e06d5a5651cf332614d73e27bf6ed95d083a3)), closes [#13552](https://github.com/aws/aws-cdk/issues/13552)
* **pipelines:** synth fails if 'aws-cdk' is not in `package.json` ([#14745](https://github.com/aws/aws-cdk/issues/14745)) ([0b8ee97](https://github.com/aws/aws-cdk/commit/0b8ee97b7c029c5195de694a1d2eea309c343f61)), closes [#14658](https://github.com/aws/aws-cdk/issues/14658)

## [1.104.0](https://github.com/aws/aws-cdk/compare/v1.103.0...v1.104.0) (2021-05-14)


Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![PyPI version](https://badge.fury.io/py/aws-cdk.core.svg)](https://badge.fury.io/py/aws-cdk.core)
[![NuGet version](https://badge.fury.io/nu/Amazon.CDK.svg)](https://badge.fury.io/nu/Amazon.CDK)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/software.amazon.awscdk/core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/software.amazon.awscdk/core)
[![Go Reference](https://pkg.go.dev/badge/github.com/aws/aws-cdk-go/awscdk.svg)](https://pkg.go.dev/github.com/aws/aws-cdk-go/awscdk)
[![Mergify](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/aws/aws-cdk&style=flat)](https://mergify.io)

The **AWS Cloud Development Kit (AWS CDK)** is an open-source software development
Expand All @@ -24,6 +25,8 @@ The CDK is available in the following languages:
* Python ([Python ≥ 3.6](https://www.python.org/downloads/))
* Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi))
* .NET ([.NET Core ≥ 3.1](https://dotnet.microsoft.com/download))
* Go ([Go ≥ 1.16.4](https://golang.org/))
- Go is currently in developer preview and is not recommended for production use.

\
Jump To:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"conventional-changelog-cli": "^2.1.1",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.6",
"jest-junit": "^12.0.0",
"jest-junit": "^12.1.0",
"jsii-diff": "^1.29.0",
"jsii-pacmak": "^1.29.0",
"jsii-reflect": "^1.29.0",
Expand Down
19 changes: 19 additions & 0 deletions packages/@aws-cdk-containers/ecs-service-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,25 @@ At this point, all the service resources will be created. This includes the ECS
Definition, Service, as well as any other attached resources, such as App Mesh Virtual
Node or an Application Load Balancer.

## Creating your own taskRole

Sometimes the taskRole should be defined outside of the service so that you can create strict resource policies (ie. S3 bucket policies) that are restricted to a given taskRole:

```ts
const taskRole = new iam.Role(stack, 'CustomTaskRole', {
assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'),
});

// Use taskRole in any CDK resource policies
// new s3.BucketPolicy(this, 'BucketPolicy, {});

const nameService = new Service(stack, 'name', {
environment: environment,
serviceDescription: nameDescription,
taskRole,
});
```

## Creating your own custom `ServiceExtension`

In addition to using the default service extensions that come with this module, you
Expand Down
12 changes: 12 additions & 0 deletions packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { IEnvironment } from './environment';
import { EnvironmentCapacityType, ServiceBuild } from './extensions/extension-interfaces';
Expand All @@ -22,6 +23,13 @@ export interface ServiceProps {
* The environment to launch the service in.
*/
readonly environment: IEnvironment

/**
* The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
*
* @default - A task role is automatically created for you.
*/
readonly taskRole?: iam.IRole;
}

/**
Expand Down Expand Up @@ -120,6 +128,10 @@ export class Service extends Construct {
cpu: '256',
memory: '512',

// Allow user to pre-define the taskRole so that it can be used in resource policies that may
// be defined before the ECS service exists in a CDK application
taskRole: props.taskRole,

// Ensure that the task definition supports both EC2 and Fargate
compatibility: ecs.Compatibility.EC2_AND_FARGATE,
} as ecs.TaskDefinitionProps;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { countResources, expect, haveResource } from '@aws-cdk/assert-internal';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { Container, EnvironmentCapacityType, Environment, Service, ServiceDescription } from '../lib';
Expand Down Expand Up @@ -40,6 +41,9 @@ export = {
capacityType: EnvironmentCapacityType.EC2,
});
const serviceDescription = new ServiceDescription();
const taskRole = new iam.Role(stack, 'CustomTaskRole', {
assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'),
});

serviceDescription.add(new Container({
cpu: 256,
Expand All @@ -51,6 +55,7 @@ export = {
new Service(stack, 'my-service', {
environment,
serviceDescription,
taskRole,
});

// THEN
Expand Down Expand Up @@ -89,7 +94,7 @@ export = {
],
TaskRoleArn: {
'Fn::GetAtt': [
'myservicetaskdefinitionTaskRole92ACD903',
'CustomTaskRole3C6B13FD',
'Arn',
],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"nodeunit": "^0.11.3",
"pkglint": "0.0.0",
"sinon": "^9.2.4",
"ts-mock-imports": "^1.3.4",
"ts-mock-imports": "^1.3.7",
"@aws-cdk/assert-internal": "0.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigatewayv2-authorizers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const authHandler = new Function(this, 'auth-function', {
});

const authorizer = new HttpLambdaAuthorizer({
responseTypes: [HttpLambdaAuthorizerType.SIMPLE] // Define if returns simple and/or iam response
responseTypes: [HttpLambdaResponseType.SIMPLE] // Define if returns simple and/or iam response
handler: authHandler,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.23",
"@types/aws-lambda": "^8.10.76",
"@aws-cdk/aws-apigatewayv2-integrations": "0.0.0",
"@aws-cdk/aws-lambda": "0.0.0",
"cdk-build-tools": "0.0.0",
Expand Down
69 changes: 46 additions & 23 deletions packages/@aws-cdk/aws-appmesh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@ const node = new VirtualNode(this, 'node', {
},
})],
backendDefaults: {
clientPolicy: appmesh.ClientPolicy.fileTrust({
certificateChain: '/keys/local_cert_chain.pem',
}),
tlsClientPolicy: {
validation: {
trust: appmesh.TlsValidationTrust.file({
certificateChain: '/keys/local_cert_chain.pem',
}),
},
},
},
accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});
Expand Down Expand Up @@ -218,12 +222,8 @@ const node = new VirtualNode(this, 'node', {
});

const virtualService = new appmesh.VirtualService(stack, 'service-1', {
serviceDiscovery: appmesh.ServiceDiscovery.dns('service1.domain.local'),
mesh,
clientPolicy: appmesh.ClientPolicy.fileTrust({
certificateChain: '/keys/local_cert_chain.pem',
ports: [8080, 8081],
}),
virtualServiceProvider: appmesh.VirtualServiceProvider.virtualRouter(router),
virtualServiceName: 'service1.domain.local',
});

node.addBackend(appmesh.Backend.virtualService(virtualService));
Expand All @@ -248,13 +248,15 @@ const cert = new certificatemanager.Certificate(this, 'cert', {...});

const node = new appmesh.VirtualNode(stack, 'node', {
mesh,
dnsHostName: 'node',
serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
listeners: [appmesh.VirtualNodeListener.grpc({
port: 80,
tlsCertificate: appmesh.TlsCertificate.acm({
certificate: cert,
tlsMode: TlsMode.STRICT,
}),
tls: {
mode: appmesh.TlsMode.STRICT,
certificate: appmesh.TlsCertificate.acm({
certificate: cert,
}),
},
})],
});

Expand All @@ -263,11 +265,13 @@ const gateway = new appmesh.VirtualGateway(this, 'gateway', {
mesh: mesh,
listeners: [appmesh.VirtualGatewayListener.grpc({
port: 8080,
tlsCertificate: appmesh.TlsCertificate.file({
certificateChain: 'path/to/certChain',
privateKey: 'path/to/privateKey',
tlsMode: TlsMode.STRICT,
}),
tls: {
mode: appmesh.TlsMode.STRICT,
certificate: appmesh.TlsCertificate.file({
certificateChainPath: 'path/to/certChain',
privateKeyPath: 'path/to/privateKey',
}),
},
})],
virtualGatewayName: 'gateway',
});
Expand Down Expand Up @@ -309,7 +313,7 @@ connection pool properties per listener protocol types.
// A Virtual Node with a gRPC listener with a connection pool set
const node = new appmesh.VirtualNode(stack, 'node', {
mesh,
dnsHostName: 'node',
serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
listeners: [appmesh.VirtualNodeListener.http({
port: 80,
connectionPool: {
Expand Down Expand Up @@ -493,10 +497,14 @@ const gateway = new appmesh.VirtualGateway(stack, 'gateway', {
}),
})],
backendDefaults: {
clientPolicy: appmesh.ClientPolicy.acmTrust({
certificateAuthorities: [acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'certificate', certificateAuthorityArn)],
tlsClientPolicy: {
ports: [8080, 8081],
}),
validation: {
trust: appmesh.TlsValidationTrust.acm({
certificateAuthorities: [acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'certificate', certificateAuthorityArn)],
}),
},
},
},
accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
virtualGatewayName: 'virtualGateway',
Expand Down Expand Up @@ -584,3 +592,18 @@ appmesh.Mesh.fromMeshArn(stack, 'imported-mesh', arn);
```ts
appmesh.Mesh.fromMeshName(stack, 'imported-mesh', 'abc');
```

## IAM Grants

Virtual Node and Virtual Gateway implement `grantStreamAggregatedResources` that will grant identities that are running
Envoy access to stream generated config from App Mesh.

```ts
const gateway = new appmesh.VirtualGateway(stack, 'testGateway', { mesh: mesh });
const envoyUser = new iam.User(stack, 'envoyUser');

/**
* This will grant `grantStreamAggregatedResources` ONLY for this gateway.
*/
gateway.grantStreamAggregatedResources(envoyUser)
```
Loading

0 comments on commit 7cb6ff5

Please sign in to comment.