Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-grantUpdate-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Jun 30, 2020
2 parents 085d7fa + 4ce27f4 commit ff15172
Show file tree
Hide file tree
Showing 655 changed files with 17,785 additions and 5,357 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "\U0001F41B Bug Report"
about: Report a bug
title: "[module] "
labels: bug, needs-triage
---

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "📕 Documentation Issue"
about: Issue in the reference documentation or developer guide
title: "[module] "
labels: feature-request, documentation, needs-triage
---

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "\U0001F680 Feature Request"
about: Request a new feature
title: "[module] "
labels: feature-request, needs-triage
---

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/general-issues.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "\U00002753 General Issue"
about: Create a new issue
title: "[module] "
labels: needs-triage
---

Expand Down
168 changes: 168 additions & 0 deletions .github/workflows/issue-label-assign.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ cdk.out/

# Yarn error log
yarn-error.log

# Parcel default cache directory
.parcel-cache
103 changes: 103 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ removed:@aws-cdk/core.BootstraplessSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
removed:@aws-cdk/core.DefaultStackSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
removed:@aws-cdk/core.DefaultStackSynthesizerProps.assetPublishingExternalId
removed:@aws-cdk/core.DefaultStackSynthesizerProps.assetPublishingRoleArn

# merge asset manifest schema into cloud assembly schema
removed:@aws-cdk/cdk-assets-schema.AssetManifestSchema
removed:@aws-cdk/cdk-assets-schema.AwsDestination
removed:@aws-cdk/cdk-assets-schema.DockerImageAsset
removed:@aws-cdk/cdk-assets-schema.DockerImageDestination
removed:@aws-cdk/cdk-assets-schema.DockerImageSource
removed:@aws-cdk/cdk-assets-schema.FileAsset
removed:@aws-cdk/cdk-assets-schema.FileDestination
removed:@aws-cdk/cdk-assets-schema.FileSource
removed:@aws-cdk/cdk-assets-schema.ManifestFile
removed:@aws-cdk/cdk-assets-schema.FileAssetPackaging
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

echo "============================================================================================="
echo "installing..."
yarn install --frozen-lockfile
yarn install --frozen-lockfile --network-timeout 1000000

fail() {
echo "❌ Last command failed. Scroll up to see errors in log (search for '!!!!!!!!')."
Expand Down
3 changes: 3 additions & 0 deletions design/cdk-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ and need to be kept for backwards compatibility reasons:

* `--bootstrap-kms-key-id`: optional identifier of the KMS key used for encrypting the file assets S3 bucket.

* `--public-access-block-configuration`: allows you to explicitly enable or disable public access bucket block configuration
on the file assets S3 Bucket (enabled by default).

#### New options

These options will be added to the `bootstrap` command:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.45.0"
"version": "1.47.1"
}
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"conventional-changelog-cli": "^2.0.34",
"fs-extra": "^9.0.1",
"graceful-fs": "^4.2.4",
"jsii-diff": "^1.6.0",
"jsii-pacmak": "^1.6.0",
"jsii-rosetta": "^1.6.0",
"jsii-diff": "^1.7.0",
"jsii-pacmak": "^1.7.0",
"jsii-rosetta": "^1.7.0",
"lerna": "^3.22.1",
"standard-version": "^8.0.0",
"typescript": "~3.8.3"
"typescript": "~3.9.5"
},
"resolutions-comment": "should be removed or reviewed when nodeunit dependency is dropped or adjusted",
"resolutions": {
Expand Down Expand Up @@ -52,22 +52,26 @@
"@aws-cdk/aws-codepipeline-actions/case/**",
"@aws-cdk/aws-ecr-assets/minimatch",
"@aws-cdk/aws-ecr-assets/minimatch/**",
"@aws-cdk/aws-eks/yaml",
"@aws-cdk/aws-eks/yaml/**",
"@aws-cdk/aws-lambda-nodejs/parcel-bundler",
"@aws-cdk/aws-lambda-nodejs/parcel-bundler/**",
"@aws-cdk/cdk-assets-schema/semver",
"@aws-cdk/cdk-assets-schema/semver/**",
"@aws-cdk/cloud-assembly-schema/jsonschema",
"@aws-cdk/cloud-assembly-schema/jsonschema/**",
"@aws-cdk/cloud-assembly-schema/semver",
"@aws-cdk/cloud-assembly-schema/semver/**",
"@aws-cdk/cloudformation-include/yaml",
"@aws-cdk/cloudformation-include/yaml/**",
"@aws-cdk/core/fs-extra",
"@aws-cdk/core/fs-extra/**",
"@aws-cdk/core/minimatch",
"@aws-cdk/core/minimatch/**",
"@aws-cdk/cx-api/semver",
"@aws-cdk/cx-api/semver/**",
"monocdk-experiment/case",
"monocdk-experiment/case/**",
"monocdk-experiment/fs-extra",
"monocdk-experiment/fs-extra/**",
"monocdk-experiment/jsonschema",
"monocdk-experiment/jsonschema/**",
"monocdk-experiment/minimatch",
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/alexa-ask/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ dist
tsconfig.json
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/app-delivery/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ coverage

tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/assert/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ dist
tsconfig.json
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
4 changes: 2 additions & 2 deletions packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.0",
"@types/jest": "^26.0.3",
"cdk-build-tools": "0.0.0",
"jest": "^25.5.4",
"pkglint": "0.0.0",
"ts-jest": "^26.1.0"
"ts-jest": "^26.1.1"
},
"dependencies": {
"@aws-cdk/cloudformation-diff": "0.0.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/assets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ dist

tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-accessanalyzer/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ tsconfig.json
!.jsii
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-acmpca/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ tsconfig.json

.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-amazonmq/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ dist
tsconfig.json
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-amplify/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ dist
tsconfig.json
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-apigateway/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ dist

tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class LambdaIntegration extends AwsIntegration {
super.bind(method);
const principal = new iam.ServicePrincipal('apigateway.amazonaws.com');

const desc = `${method.restApi.node.uniqueId}.${method.httpMethod}.${method.resource.path.replace(/\//g, '.')}`;
const desc = `${method.api.node.uniqueId}.${method.httpMethod}.${method.resource.path.replace(/\//g, '.')}`;

this.handler.addPermission(`ApiPermission.${desc}`, {
principal,
Expand Down
15 changes: 5 additions & 10 deletions packages/@aws-cdk/aws-apigateway/lib/method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,27 +237,22 @@ export class Method extends Resource {
* arn:aws:execute-api:{region}:{account}:{restApiId}/{stage}/{method}/{path}
*
* NOTE: {stage} will refer to the `restApi.deploymentStage`, which will
* automatically set if auto-deploy is enabled.
* automatically set if auto-deploy is enabled, or can be explicitly assigned.
* When not configured, {stage} will be set to '*', as a shorthand for 'all stages'.
*
* @attribute
*/
public get methodArn(): string {
if (!this.restApi.deploymentStage) {
throw new Error(
`Unable to determine ARN for method "${this.node.id}" since there is no stage associated with this API.\n` +
'Either use the `deploy` prop or explicitly assign `deploymentStage` on the RestApi');
}

const stage = this.restApi.deploymentStage.stageName.toString();
return this.restApi.arnForExecuteApi(this.httpMethod, pathForArn(this.resource.path), stage);
const stage = this.api.deploymentStage?.stageName;
return this.api.arnForExecuteApi(this.httpMethod, pathForArn(this.resource.path), stage);
}

/**
* Returns an execute-api ARN for this method's "test-invoke-stage" stage.
* This stage is used by the AWS Console UI when testing the method.
*/
public get testMethodArn(): string {
return this.restApi.arnForExecuteApi(this.httpMethod, pathForArn(this.resource.path), 'test-invoke-stage');
return this.api.arnForExecuteApi(this.httpMethod, pathForArn(this.resource.path), 'test-invoke-stage');
}

private renderIntegration(integration?: Integration): CfnMethod.IntegrationProperty {
Expand Down
27 changes: 17 additions & 10 deletions packages/@aws-cdk/aws-apigateway/lib/restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export interface IRestApi extends IResourceBase {
*/
readonly latestDeployment?: Deployment;

/**
* API Gateway stage that points to the latest deployment (if defined).
*/
deploymentStage: Stage;

/**
* Represents the root resource ("/") of this API. Use it to define the API model:
*
Expand All @@ -46,6 +51,17 @@ export interface IRestApi extends IResourceBase {
*
*/
readonly root: IResource;

/**
* Gets the "execute-api" ARN
* @returns The "execute-api" ARN.
* @default "*" returns the execute API ARN for all methods/resources in
* this API.
* @param method The method (default `*`)
* @param path The resource path. Must start with '/' (default `*`)
* @param stage The stage (default `*`)
*/
arnForExecuteApi(method?: string, path?: string, stage?: string): string;
}

/**
Expand Down Expand Up @@ -324,15 +340,6 @@ export abstract class RestApiBase extends Resource implements IRestApi {
return new UsagePlan(this, id, props);
}

/**
* Gets the "execute-api" ARN
* @returns The "execute-api" ARN.
* @default "*" returns the execute API ARN for all methods/resources in
* this API.
* @param method The method (default `*`)
* @param path The resource path. Must start with '/' (default `*`)
* @param stage The stage (default `*`)
*/
public arnForExecuteApi(method: string = '*', path: string = '/*', stage: string = '*') {
if (!path.startsWith('/')) {
throw new Error(`"path" must begin with a "/": '${path}'`);
Expand Down Expand Up @@ -496,7 +503,7 @@ export class RestApi extends RestApiBase {
* Import an existing RestApi.
*/
public static fromRestApiId(scope: Construct, id: string, restApiId: string): IRestApi {
class Import extends Resource implements IRestApi {
class Import extends RestApiBase {
public readonly restApiId = restApiId;

public get root(): IResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParametersa4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771S3Bucket3AA102C2"
"Ref": "AssetParameterse7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0S3Bucket316B0B52"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -49,7 +49,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersa4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771S3VersionKeyA8B9EEA1"
"Ref": "AssetParameterse7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0S3VersionKey4A4C6C19"
}
]
}
Expand All @@ -62,7 +62,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersa4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771S3VersionKeyA8B9EEA1"
"Ref": "AssetParameterse7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0S3VersionKey4A4C6C19"
}
]
}
Expand Down Expand Up @@ -272,17 +272,17 @@
}
},
"Parameters": {
"AssetParametersa4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771S3Bucket3AA102C2": {
"AssetParameterse7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0S3Bucket316B0B52": {
"Type": "String",
"Description": "S3 bucket for asset \"a4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771\""
"Description": "S3 bucket for asset \"e7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0\""
},
"AssetParametersa4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771S3VersionKeyA8B9EEA1": {
"AssetParameterse7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0S3VersionKey4A4C6C19": {
"Type": "String",
"Description": "S3 key for asset version \"a4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771\""
"Description": "S3 key for asset version \"e7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0\""
},
"AssetParametersa4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771ArtifactHash6ECBBD25": {
"AssetParameterse7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0ArtifactHash2FE6C4D8": {
"Type": "String",
"Description": "Artifact hash for asset \"a4fe33e0257e9c62ac536e63b53e36b44b0791e1715f23fcb34c0e6a16402771\""
"Description": "Artifact hash for asset \"e7d4044be8659ef3bb40a53a69846d7ca1b2d8e4e4bd36ad8c9d8e69fe3b68a0\""
}
},
"Outputs": {
Expand Down Expand Up @@ -313,4 +313,4 @@
}
}
}
}
}
Loading

0 comments on commit ff15172

Please sign in to comment.