Skip to content

Commit

Permalink
Merge branch 'master' into jericht/autoscaling_imds_aspect
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 19, 2021
2 parents 336da33 + 83cf9b8 commit a26b1d6
Show file tree
Hide file tree
Showing 50 changed files with 1,073 additions and 386 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# AWS CDK GitHub Actions

These workflows and actions are configured in the AWS CDK GitHub repository.

## Pull Request Triggered

### Auto Approve
[auto-approve.yml](auto-approve.yml): Approves merging PRs with the
`pr/auto-approve` label.
Owner: Core CDK team

### PR Linter
[pr-linter.yml](pr-linter.yml): Runs `tools/@aws-cdk-prlint` on each PR to
check for correctness.
Owner: Core CDK team

### v2-main PR automation
[v2-pull-request.yml](v2-pull-request.yml): Runs `pkglint` on merge forward PRs
and commits the results.
Owner: Core CDK team

### Label Assigner
[issue-label-assign.yml](issue-label-assign.yml): Github action for automatically adding labels and/or setting assignees when an Issue or PR is opened or edited based on user-defined Area
Owner: CDK support team

## Issue Triggered

### Closed Issue Message
[closed-issue-message.yml](closed-issue-message.yml): Adds a reminder message
to issues that are closed.
Owner: CDK support team

### Label Assigner
[issue-label-assign.yml](issue-label-assign.yml): Github action for automatically adding labels and/or setting assignees when an Issue or PR is opened or edited based on user-defined Area
Owner: CDK support team

## Scheduled Actions

### Issue Lifecycle Handling
[close-stale-issues.yml](close-stale-issues.yml): Handles labeling issues and
PRs with `closing-soon`, `response-requested`, etc.
Owner: CDK support team

### Yarn Upgrader
[yarn-upgrade.yml](yarn-upgrade.yml): Upgrades yarn dependencies and creates a
patch file for downloading.
Owner: Core CDK team
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: "Close Stale Issues"
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
- cron: "0 */4 * * *"

jobs:
cleanup:
Expand Down
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
# be forced to registry.yarnpkg.com.
# https://github.com/npm/cli/issues/3783
registry "https://registry.npmjs.org"
ignore-engines true # the 'engines' key for 'aws-cdk-lib' has specifies node14 as min while v1 will remain at node10
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@

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.128.0](https://github.com/aws/aws-cdk/compare/v1.127.0...v1.128.0) (2021-10-14)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **assertions:** Starting this release, the `assertions` module will be
published to Maven with the name 'assertions' instead of
'cdk-assertions'.

### Features

* **apigatewayv2-integrations:** http api - support for request parameter mapping ([#15630](https://github.com/aws/aws-cdk/issues/15630)) ([0452aed](https://github.com/aws/aws-cdk/commit/0452aed2f00198e05bd65b1d20246f7de0b24e20))
* **cli:** hotswap deployments for ECS Services ([#16864](https://github.com/aws/aws-cdk/issues/16864)) ([ad7288f](https://github.com/aws/aws-cdk/commit/ad7288f35a17fcfbecd7080e99ece4873fa99ad2))
* **codepipeline:** add support for string user parameters to the Lambda invoke action ([#16946](https://github.com/aws/aws-cdk/issues/16946)) ([e19ea31](https://github.com/aws/aws-cdk/commit/e19ea31dbf62446edaf5131c75246098ab05da6e)), closes [#16776](https://github.com/aws/aws-cdk/issues/16776)
* **lambda:** docker platform for architecture ([#16858](https://github.com/aws/aws-cdk/issues/16858)) ([5c258a3](https://github.com/aws/aws-cdk/commit/5c258a30367a4922e404eb26e5aa076720846fbe))
* **lambda-event-sources:** self managed kafka: support sasl/plain authentication ([#16712](https://github.com/aws/aws-cdk/issues/16712)) ([d4ad93f](https://github.com/aws/aws-cdk/commit/d4ad93f30877b26b851caa81d3a4a1d80df55164))
* **stepfunctions-tasks:** AWS SDK service integrations ([#16746](https://github.com/aws/aws-cdk/issues/16746)) ([ae840ff](https://github.com/aws/aws-cdk/commit/ae840ff1abb8283a1290dae5859f5729a9cf72b1)), closes [#16780](https://github.com/aws/aws-cdk/issues/16780)


### Bug Fixes

* **ecs:** add ASG capacity via Capacity Provider by not specifying machineImageType ([#16361](https://github.com/aws/aws-cdk/issues/16361)) ([93b3fdc](https://github.com/aws/aws-cdk/commit/93b3fdce80f0997d7b809f9ef7e3edd1e75e1f42)), closes [#16360](https://github.com/aws/aws-cdk/issues/16360)
* **servicecatalog:** Allow users to create multiple product versions from assets. ([#16914](https://github.com/aws/aws-cdk/issues/16914)) ([958d755](https://github.com/aws/aws-cdk/commit/958d755ff7acaf016e3f8969bf5ab07d4dc2977b))
* **codebuild:** add build image AMAZON_LINUX_2_ARM_2 ([#16931](https://github.com/aws/aws-cdk/issues/16931)) ([370cb31](https://github.com/aws/aws-cdk/commit/370cb310cce3fccc5381d8d53130e21b266de868)), closes [#16930](https://github.com/aws/aws-cdk/issues/16930)
* **core:** asset hash is different between linux and windows ([#16945](https://github.com/aws/aws-cdk/issues/16945)) ([59950dd](https://github.com/aws/aws-cdk/commit/59950dd331635fb707aac819529614c0f3e47ee5)), closes [#14555](https://github.com/aws/aws-cdk/issues/14555) [#16928](https://github.com/aws/aws-cdk/issues/16928)
* **ecs-patterns:** minScalingCapacity cannot be set to 0 ([#16961](https://github.com/aws/aws-cdk/issues/16961)) ([589f284](https://github.com/aws/aws-cdk/commit/589f284acec8530aa9824b75a5daef4632e98985)), closes [#15632](https://github.com/aws/aws-cdk/issues/15632) [#14336](https://github.com/aws/aws-cdk/issues/14336)
* **ssm:** StringParameter accepts ParameterType.AWS_EC2_IMAGE_ID as type ([#16884](https://github.com/aws/aws-cdk/issues/16884)) ([2b353be](https://github.com/aws/aws-cdk/commit/2b353be5291cbcdc56a8863038eed4a5f2adc65f)), closes [#16806](https://github.com/aws/aws-cdk/issues/16806)
* use registry.npmjs.com to fix shinkwrap resolves ([#16607](https://github.com/aws/aws-cdk/issues/16607)) ([8f91531](https://github.com/aws/aws-cdk/commit/8f91531c3c25900316d40d5564450566a03e27ee))


### Miscellaneous Chores

* **assertions:** consistent naming in maven ([#16921](https://github.com/aws/aws-cdk/issues/16921)) ([0dcd9ec](https://github.com/aws/aws-cdk/commit/0dcd9eca3a1014c39f92d9e052b67974fc751af0))

## [1.127.0](https://github.com/aws/aws-cdk/compare/v1.126.0...v1.127.0) (2021-10-08)


Expand Down
13 changes: 10 additions & 3 deletions packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export interface IHttpStage extends IStage {
*/
readonly api: IHttpApi;

/**
* The custom domain URL to this stage
*/
readonly domainUrl: string;

/**
* Metric for the number of client-side errors captured in a given period.
*
Expand Down Expand Up @@ -96,6 +101,7 @@ export interface HttpStageAttributes extends StageAttributes {
}

abstract class HttpStageBase extends StageBase implements IHttpStage {
public abstract readonly domainUrl: string;
public abstract readonly api: IHttpApi;

public metricClientError(props?: MetricOptions): Metric {
Expand Down Expand Up @@ -140,6 +146,10 @@ export class HttpStage extends HttpStageBase {
get url(): string {
throw new Error('url is not available for imported stages.');
}

get domainUrl(): string {
throw new Error('domainUrl is not available for imported stages.');
}
}
return new Import(scope, id);
}
Expand Down Expand Up @@ -177,9 +187,6 @@ export class HttpStage extends HttpStageBase {
return `https://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath}`;
}

/**
* The custom domain URL to this stage
*/
public get domainUrl(): string {
if (!this._apiMapping) {
throw new Error('domainUrl is not available when no API mapping is associated with the Stage');
Expand Down
24 changes: 23 additions & 1 deletion packages/@aws-cdk/aws-apigatewayv2/test/http/api.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Match, Template } from '@aws-cdk/assertions';
import { Certificate } from '@aws-cdk/aws-certificatemanager';
import { Metric } from '@aws-cdk/aws-cloudwatch';
import * as ec2 from '@aws-cdk/aws-ec2';
import { Duration, Stack } from '@aws-cdk/core';
import {
CorsHttpMethod,
CorsHttpMethod, DomainName,
HttpApi, HttpAuthorizer, HttpIntegrationType, HttpMethod, HttpRouteAuthorizerBindOptions, HttpRouteAuthorizerConfig,
HttpRouteIntegrationBindOptions, HttpRouteIntegrationConfig, IHttpRouteAuthorizer, IHttpRouteIntegration, HttpNoneAuthorizer, PayloadFormatVersion,
} from '../../lib';
Expand Down Expand Up @@ -374,6 +375,27 @@ describe('HttpApi', () => {
expect(() => api.apiEndpoint).toThrow(/apiEndpoint is not configured/);
});

test('domainUrl can be retrieved for default stage', () => {
const stack = new Stack();
const dn = new DomainName(stack, 'DN', {
domainName: 'example.com',
certificate: Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:111111111111:certificate'),
});

const api = new HttpApi(stack, 'Api', {
createDefaultStage: true,
defaultDomainMapping: {
domainName: dn,
},
});

expect(stack.resolve(api.defaultStage?.domainUrl)).toEqual({
'Fn::Join': ['', [
'https://', { Ref: 'DNFDC76583' }, '/',
]],
});
});


describe('default authorization settings', () => {
test('can add default authorizer', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1656,8 +1656,9 @@ class ArmBuildImage implements IBuildImage {
public validate(buildEnvironment: BuildEnvironment): string[] {
const ret = [];
if (buildEnvironment.computeType &&
buildEnvironment.computeType !== ComputeType.SMALL &&
buildEnvironment.computeType !== ComputeType.LARGE) {
ret.push(`ARM images only support ComputeType '${ComputeType.LARGE}' - ` +
ret.push(`ARM images only support ComputeTypes '${ComputeType.SMALL}' and '${ComputeType.LARGE}' - ` +
`'${buildEnvironment.computeType}' was given`);
}
return ret;
Expand Down
43 changes: 32 additions & 11 deletions packages/@aws-cdk/aws-codebuild/test/codebuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1590,17 +1590,21 @@ describe('ARM image', () => {
});
});

test('cannot be used in conjunction with ComputeType SMALL', () => {
test('can be used with ComputeType SMALL', () => {
const stack = new cdk.Stack();
new codebuild.PipelineProject(stack, 'Project', {
environment: {
computeType: codebuild.ComputeType.SMALL,
buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2_ARM,
},
});

expect(() => {
new codebuild.PipelineProject(stack, 'Project', {
environment: {
buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2_ARM,
computeType: codebuild.ComputeType.SMALL,
},
});
}).toThrow(/ARM images only support ComputeType 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_SMALL' was given/);
expect(stack).toHaveResourceLike('AWS::CodeBuild::Project', {
'Environment': {
'Type': 'ARM_CONTAINER',
'ComputeType': 'BUILD_GENERAL1_SMALL',
},
});
});

test('cannot be used in conjunction with ComputeType MEDIUM', () => {
Expand All @@ -1613,7 +1617,24 @@ describe('ARM image', () => {
computeType: codebuild.ComputeType.MEDIUM,
},
});
}).toThrow(/ARM images only support ComputeType 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_MEDIUM' was given/);
}).toThrow(/ARM images only support ComputeTypes 'BUILD_GENERAL1_SMALL' and 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_MEDIUM' was given/);
});

test('can be used with ComputeType LARGE', () => {
const stack = new cdk.Stack();
new codebuild.PipelineProject(stack, 'Project', {
environment: {
computeType: codebuild.ComputeType.LARGE,
buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2_ARM,
},
});

expect(stack).toHaveResourceLike('AWS::CodeBuild::Project', {
'Environment': {
'Type': 'ARM_CONTAINER',
'ComputeType': 'BUILD_GENERAL1_LARGE',
},
});
});

test('cannot be used in conjunction with ComputeType X2_LARGE', () => {
Expand All @@ -1626,7 +1647,7 @@ describe('ARM image', () => {
computeType: codebuild.ComputeType.X2_LARGE,
},
});
}).toThrow(/ARM images only support ComputeType 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_2XLARGE' was given/);
}).toThrow(/ARM images only support ComputeTypes 'BUILD_GENERAL1_SMALL' and 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_2XLARGE' was given/);
});
});
});
Expand Down
Loading

0 comments on commit a26b1d6

Please sign in to comment.