Skip to content

Commit

Permalink
Merge branch 'master' into ft/http-api-lambda-authorizers
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored May 17, 2021
2 parents d00988d + 49d18ab commit 681c46f
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 3 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

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.104.0](https://github.com/aws/aws-cdk/compare/v1.103.0...v1.104.0) (2021-05-14)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **apigatewayv2:** setting the authorizer of an API route to HttpNoneAuthorizer will now remove any existing authorizer on the route

### Features

* **appsync:** elasticsearch data source for graphql api ([#14651](https://github.com/aws/aws-cdk/issues/14651)) ([2337b5d](https://github.com/aws/aws-cdk/commit/2337b5d965028ba06d6ff72f991c0b8e46433a8f)), closes [#6063](https://github.com/aws/aws-cdk/issues/6063)
* **cfnspec:** cloudformation spec v35.2.0 ([#14610](https://github.com/aws/aws-cdk/issues/14610)) ([799ce1a](https://github.com/aws/aws-cdk/commit/799ce1a7d5fb261cae92d514b4f7e315d8f0e589))
* **cloudwatch:** GraphWidget supports period and statistic ([#14679](https://github.com/aws/aws-cdk/issues/14679)) ([b240f6e](https://github.com/aws/aws-cdk/commit/b240f6ece74d129e5f43b210e8ad12f95c4a2971))
* **cloudwatch:** time range support for GraphWidget ([#14659](https://github.com/aws/aws-cdk/issues/14659)) ([010a6b1](https://github.com/aws/aws-cdk/commit/010a6b1a14f14be5001779644df3d3a2e27d4e71)), closes [#4649](https://github.com/aws/aws-cdk/issues/4649)
* **ecs:** add support for EC2 Capacity Providers ([#14386](https://github.com/aws/aws-cdk/issues/14386)) ([114f7cc](https://github.com/aws/aws-cdk/commit/114f7ccdaf736988834fe2be487363a992a31369))
* **secretsmanager:** Automatically grant permissions to rotation Lambda ([#14471](https://github.com/aws/aws-cdk/issues/14471)) ([85e00fa](https://github.com/aws/aws-cdk/commit/85e00faf1e3bcc32c2f7aa881d42c6d1f6c17f63))


### Bug Fixes

* **apigatewayv2:** authorizer is not removed when HttpNoneAuthorizer is used ([#14424](https://github.com/aws/aws-cdk/issues/14424)) ([3698a91](https://github.com/aws/aws-cdk/commit/3698a91ac81a31f763c55487f200458d5b5eaf0f))
* **ecs:** Classes FargateService and Ec2Service have no defaultChild ([#14691](https://github.com/aws/aws-cdk/issues/14691)) ([348e11e](https://github.com/aws/aws-cdk/commit/348e11e26edc0ff90b623b7cec778f4935e61e6d)), closes [#14665](https://github.com/aws/aws-cdk/issues/14665)
* **events-targets:** circular dependency when adding a KMS-encrypted SQS queue ([#14638](https://github.com/aws/aws-cdk/issues/14638)) ([3063818](https://github.com/aws/aws-cdk/commit/3063818aa7c3c3ff56cf55254b0f6561db190a3e)), closes [#11158](https://github.com/aws/aws-cdk/issues/11158)
* **lambda:** custom resource fails to connect to efs filesystem ([#14431](https://github.com/aws/aws-cdk/issues/14431)) ([10a633c](https://github.com/aws/aws-cdk/commit/10a633c8cda9f21b85c82f911d88641f3a362c4d))
* **lambda-event-sources:** incorrect documented defaults for stream types ([#14562](https://github.com/aws/aws-cdk/issues/14562)) ([0ea24e9](https://github.com/aws/aws-cdk/commit/0ea24e95939412765c0e09133a7793557f779c76)), closes [#13908](https://github.com/aws/aws-cdk/issues/13908)
* **lambda-nodejs:** handler filename missing from error message ([#14564](https://github.com/aws/aws-cdk/issues/14564)) ([256fd4c](https://github.com/aws/aws-cdk/commit/256fd4c6fcdbe6519bc70f62415557dbeae950a1))

## [1.103.0](https://github.com/aws/aws-cdk/compare/v1.102.0...v1.103.0) (2021-05-10)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See: [Contributing Guide](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-ecs/README.md)
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-ecs-patterns/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See: [Contributing Guide](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-ecs/README.md)
56 changes: 56 additions & 0 deletions packages/@aws-cdk/aws-ecs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Contributing to the AWS ECS and AWS ECS Patterns modules

Hiya! Thanks for your interest in contributing to the ECS modules! The [ECS
Developer Experience](https://github.com/orgs/aws/teams/aws-ecs-devx) team
currently owns the following construct libraries:

- [@aws-cdk/aws-ecs](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-ecs):
the main construct library for AWS ECS
- [@aws-cdk/aws-ecs-patterns](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-ecs-patterns):
a set of simplified, higher-level constructs based on common container-based
application architectures. Great for first-time container developers!
- [@aws-cdk-containers/ecs-service-extensions](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk-containers/ecs-service-extensions):
a set of ECS constructs that promote best practices for container
infrastructure by using composable add-ons, such as load balancers and sidecar
containers used for tracing and metric logging. More suitable for advanced
container configuration.

## Find something to work on

Issues related to ECS, ECS Patterns, and ECS Service extensions are tracked on
our public [project board](https://github.com/aws/aws-cdk/projects/2).

If you want to contribute a specific feature or fix you have in mind, check our
[in-flight work](https://github.com/aws/aws-cdk/projects/2#column-8268897) or
[open pull requests](https://github.com/aws/aws-cdk/projects/2#column-11918985)
to see if someone else is already working on it. If an issue has someone
assigned to it in our "In Progress" column, that means they are actively
working on it. Otherwise, any unassigned issue is up for grabs!

If an issue doesn't exist for your feature/fix, please create one using the
appropriate [issue
template](https://github.com/aws/aws-cdk/tree/master/.github/ISSUE_TEMPLATE).

If you're simply looking for any issue to work on, explore our [Backlog of
issues](https://github.com/aws/aws-cdk/projects/2#column-8114389) on the public
project board and find something that piques your interest. If you are looking
for your first contribution, the ['good first issue'
label](https://github.com/aws/aws-cdk/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
will be of help.

### Let us know what you're working on!
Once you've chosen to work on an existing issue, please **add a comment to
indicate that you are starting work on it!** This will help us assign the
issue to you and keep track of issues being actively worked on, to avoid
duplicate effort.

### Include a design if you can!
For larger features, your contribution is far more likely to be accepted if you:
1. let us know you are working on it!
2. include a design document.

Examples of past designs for the ECS module can be found in under the
[design](https://github.com/aws/aws-cdk/tree/master/design/aws-ecs) directory.

## Breaking Changes
See guidance on breaking changes in the [Contributing Guide](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md#breaking-changes).
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-ecs/lib/base/base-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ export abstract class BaseService extends Resource
if (props.cloudMapOptions) {
this.enableCloudMap(props.cloudMapOptions);
}

this.node.defaultChild = this.resource;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nodeunitShim({
memoryLimitMiB: 512,
});

new ecs.Ec2Service(stack, 'Ec2Service', {
const service = new ecs.Ec2Service(stack, 'Ec2Service', {
cluster,
taskDefinition,
});
Expand All @@ -47,6 +47,8 @@ nodeunitShim({
EnableECSManagedTags: false,
}));

test.notEqual(service.node.defaultChild, undefined);

test.done();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nodeunitShim({
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
});

new ecs.FargateService(stack, 'FargateService', {
const service = new ecs.FargateService(stack, 'FargateService', {
cluster,
taskDefinition,
});
Expand Down Expand Up @@ -79,6 +79,8 @@ nodeunitShim({
},
}));

test.notEqual(service.node.defaultChild, undefined);

test.done();
},

Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-lambda-go/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM $IMAGE

# set the GOCACHE
ENV GOCACHE=$GOPATH/.cache/go-build
ENV GOPROXY=direct

# Ensure all users can write to GOPATH
RUN chmod -R 777 $GOPATH
Expand Down
15 changes: 15 additions & 0 deletions packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
Expand Down Expand Up @@ -63,6 +64,20 @@ export class SingletonFunction extends FunctionBase {
this.canCreatePermissions = true; // Doesn't matter, addPermission is overriden anyway
}

/**
* @inheritdoc
*/
public get isBoundToVpc(): boolean {
return this.lambdaFunction.isBoundToVpc;
}

/**
* @inheritdoc
*/
public get connections(): ec2.Connections {
return this.lambdaFunction.connections;
}

/**
* Returns a `lambda.Version` which represents the current version of this
* singleton Lambda function. A new version will be created every time the
Expand Down
24 changes: 24 additions & 0 deletions packages/@aws-cdk/aws-lambda/test/singleton-lambda.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@aws-cdk/assert-internal/jest';
import { ResourcePart } from '@aws-cdk/assert-internal';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import * as lambda from '../lib';
Expand Down Expand Up @@ -174,4 +175,27 @@ describe('singleton lambda', () => {
},
});
});

test('bind to vpc and access connections', () => {
// GIVEN
const stack = new cdk.Stack();
const vpc = new ec2.Vpc(stack, 'VPC', { maxAzs: 2 });
const securityGroup = new ec2.SecurityGroup(stack, 'SecurityGroup', {
vpc: vpc,
});

// WHEN
const singleton = new lambda.SingletonFunction(stack, 'Singleton', {
uuid: '84c0de93-353f-4217-9b0b-45b6c993251a',
code: new lambda.InlineCode('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
securityGroups: [securityGroup],
vpc: vpc,
});

// THEN
expect(singleton.isBoundToVpc).toBeTruthy();
expect(singleton.connections).toEqual(new ec2.Connections({ securityGroups: [securityGroup] }));
});
});
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-msk/test/integ.cluster.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// !cdk-integ pragma:ignore-assets
import * as ec2 from '@aws-cdk/aws-ec2';
import * as cdk from '@aws-cdk/core';
import * as msk from '../lib';
Expand Down
2 changes: 1 addition & 1 deletion version.v1.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.103.0"
"version": "1.104.0"
}

0 comments on commit 681c46f

Please sign in to comment.