Skip to content

Commit f249e61

Browse files
committed
Merge branch 'master' into shivlaks/cli-stack-events
2 parents e7dc40a + 8edc0c0 commit f249e61

File tree

630 files changed

+24121
-4368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

630 files changed

+24121
-4368
lines changed

.github/ISSUE_TEMPLATE/bug.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ description of the bug:
1818
minimal amount of code that causes the bug (if possible) or a reference:
1919
-->
2020

21-
22-
23-
24-
### Error Log
21+
### What did you expect to happen?
2522

2623
<!--
27-
what is the error message you are seeing?
24+
What were you trying to achieve by performing the steps above?
2825
-->
2926

27+
### What actually happened?
3028

29+
<!--
30+
What is the unexpected behavior you were seeing? If you got an error, paste it here.
31+
-->
3132

3233

3334
### Environment

.github/workflows/issue-label-assign.yml

+35-34
Large diffs are not rendered by default.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ yarn-error.log
4040
# Parcel default cache directory
4141
.parcel-cache
4242

43+
# Cloud9
44+
.c9

.gitpod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image: jsii/superchain
22
tasks:
3-
- init: yarn build --skip-test --no-bail --skip-prereqs
3+
- init: yarn build --skip-test --no-bail --skip-prereqs --skip-compat
44

55
vscode:
66
extensions:

.mergify.yml

+28-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pull_request_rules:
66
label:
77
add: [ contribution/core ]
88
conditions:
9-
- author~=^(eladb|RomainMuller|garnaat|nija-at|shivlaks|skinny85|rix0rrr|NGL321|Jerry-AWS|SomayaB|MrArnoldPalmer|NetaNir|iliapolo|njlynch)$
9+
- author~=^(eladb|RomainMuller|garnaat|nija-at|shivlaks|skinny85|rix0rrr|NGL321|Jerry-AWS|SomayaB|MrArnoldPalmer|NetaNir|iliapolo|njlynch|ericzbeard|ccfife|fulghum|pkandasamy91|SoManyHs|uttarasridhar|BryanPan342|comcalvi|kaizen3031593|)$
1010
- -label~="contribution/core"
1111
- name: automatic merge
1212
actions:
@@ -21,7 +21,7 @@ pull_request_rules:
2121
conditions:
2222
- base!=release
2323
- -title~=(WIP|wip)
24-
- -label~=(blocked|do-not-merge|no-squash)
24+
- -label~=(blocked|do-not-merge|no-squash|two-approvers)
2525
- -merged
2626
- -closed
2727
- author!=dependabot[bot]
@@ -32,7 +32,32 @@ pull_request_rules:
3232
- status-success~=AWS CodeBuild us-east-1
3333
#- status-success=Semantic Pull Request
3434
- status-success=mandatory-changes
35-
- name: automatic merge
35+
- name: automatic merge (2+ approvers)
36+
actions:
37+
comment:
38+
message: Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).
39+
merge:
40+
strict: smart
41+
method: squash
42+
strict_method: merge
43+
commit_message: title+body
44+
delete_head_branch: {}
45+
conditions:
46+
- base!=release
47+
- -title~=(WIP|wip)
48+
- label~=two-approvers
49+
- -label~=(blocked|do-not-merge|no-squash)
50+
- -merged
51+
- -closed
52+
- author!=dependabot[bot]
53+
- author!=dependabot-preview[bot]
54+
- "#approved-reviews-by>=2"
55+
- -approved-reviews-by~=author
56+
- "#changes-requested-reviews-by=0"
57+
- status-success~=AWS CodeBuild us-east-1
58+
#- status-success=Semantic Pull Request
59+
- status-success=mandatory-changes
60+
- name: automatic merge (no-squash)
3661
actions:
3762
comment:
3863
message: Thank you for contributing! Your pull request will be updated from master and then merged automatically without squashing (do not update manually, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).

CHANGELOG.md

+213
Large diffs are not rendered by default.

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,14 @@ $ lr pkglint
361361

362362
**awslint** is a linter for the AWS Construct Library APIs. It is executed as a
363363
part of the build of all AWS modules in the project and enforces the [AWS
364-
Construct Library Design Guidelines](./design/aws-guidelines.md).
364+
Construct Library Design Guidelines](./DESIGN_GUIDELINES.md).
365365

366366
For more information about this tool, see the [awslint
367-
README](./tools/awslint/README.md).
367+
README](./packages/awslint/README.md).
368368

369369
Generally speaking, if you make any changes which violate an awslint rule, build
370370
will fail with appropriate messages. All rules are documented and explained in
371-
the [guidelines](./design/aws-guidelines.md).
371+
the [guidelines](./DESIGN_GUIDELINES.md).
372372

373373
Here are a few useful commands:
374374

@@ -377,7 +377,7 @@ Here are a few useful commands:
377377
* `scripts/foreach.sh yarn awslint` will start linting the entire repo, progressively. Rerun `scripts/foreach.sh` after fixing to continue.
378378
* `lerna run awslint --no-bail --stream 2> awslint.txt` will run __awslint__ in all modules and collect all results into awslint.txt
379379
* `lerna run awslint -- -i <RULE>` will run awslint throughout the repo and
380-
evaluate only the rule specified [awslint README](./tools/awslint/README.md)
380+
evaluate only the rule specified [awslint README](./packages/awslint/README.md)
381381
for details on include/exclude rule patterns.
382382

383383
### cfn2ts

README.md

+33-32
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ The CDK is available in the following languages:
2626
* Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi))
2727
* .NET ([.NET Core ≥ 3.1](https://dotnet.microsoft.com/download))
2828

29-
-------
30-
29+
\
30+
Jump To:
3131
[Developer Guide](https://docs.aws.amazon.com/cdk/latest/guide) |
32-
[CDK Workshop](https://cdkworkshop.com/) |
33-
[Getting Started](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html) |
3432
[API Reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html) |
35-
[Examples](https://github.com/aws-samples/aws-cdk-examples) |
33+
[Getting Started](#getting-started) |
3634
[Getting Help](#getting-help) |
35+
[Contributing](#contributing) |
3736
[RFCs](https://github.com/aws/aws-cdk-rfcs) |
38-
[Roadmap](https://github.com/aws/aws-cdk/blob/master/ROADMAP.md)
37+
[Roadmap](https://github.com/aws/aws-cdk/blob/master/ROADMAP.md) |
38+
[More Resources](#more-resources)
39+
40+
-------
3941

4042
Developers use the [CDK framework] in one of the
4143
supported programming languages to define reusable cloud components called [constructs], which
@@ -51,16 +53,20 @@ how to use AWS. The AWS Construct Library aims to reduce the complexity and
5153
glue-logic required when integrating various AWS services to achieve your goals
5254
on AWS.
5355

54-
[cdk framework]: https://docs.aws.amazon.com/cdk/api/latest/
56+
[CDK framework]: https://docs.aws.amazon.com/cdk/latest/guide/home.html
5557
[constructs]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html
56-
[stacks]: https://docs.aws.amazon.com/cdk/latest/guide/apps_and_stacks.html#stacks
57-
[apps]: https://docs.aws.amazon.com/cdk/latest/guide/apps_and_stacks.html#apps
58+
[stacks]: https://docs.aws.amazon.com/cdk/latest/guide/stacks.html
59+
[apps]: https://docs.aws.amazon.com/cdk/latest/guide/apps.html
5860
[Developer Guide]: https://docs.aws.amazon.com/cdk/latest/guide
5961
[AWS CDK CLI]: https://docs.aws.amazon.com/cdk/latest/guide/tools.html
6062
[AWS Construct Library]: https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html
6163

62-
## At a glance
6364

65+
## Getting Started
66+
67+
For a detailed walkthrough, see the [tutorial](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#hello_world_tutorial) in the AWS CDK [Developer Guide](https://docs.aws.amazon.com/cdk/latest/guide/home.html).
68+
69+
### At a glance
6470
Install or update the [AWS CDK CLI] from npm (requires [Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/)). We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
6571
⚠️ versions `13.0.0` to `13.6.0` are not supported due to compatibility issues with our dependencies.
6672

@@ -108,38 +114,33 @@ Use the `cdk` command-line toolkit to interact with your project:
108114
* `cdk synth`: synthesizes an AWS CloudFormation template for your app
109115
* `cdk diff`: compares your app with the deployed stack
110116

111-
For a detailed walkthrough, see the [tutorial] in the AWS CDK [Developer Guide].
112-
113117
## Getting Help
114118

115-
Please use these community resources for getting help. We use the GitHub issues
116-
for tracking bugs and feature requests.
119+
The best way to interact with our team is through GitHub. You can open an [issue](https://github.com/aws/aws-cdk/issues/new/choose) and choose from one of our templates for bug reports, feature requests, documentation issues, or guidance.
120+
121+
If you have a support plan with AWS Support, you can also create a new [support case](https://console.aws.amazon.com/support/home#/).
117122

123+
You may also find help on these community resources:
124+
* Look through the [API Reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html) or [Developer Guide](https://docs.aws.amazon.com/cdk/latest/guide)
118125
* Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/aws-cdk)
119126
and tag it with `aws-cdk`
120127
* Come join the AWS CDK community on [Gitter](https://gitter.im/awslabs/aws-cdk)
121128
* Talk in the CDK channel of the [AWS Developers Slack workspace](https://awsdevelopers.slack.com) (invite required)
122-
* Open a support ticket with [AWS Support](https://console.aws.amazon.com/support/home#/)
123-
* If it turns out that you may have found a bug,
124-
please open an [issue](https://github.com/aws/aws-cdk/issues/new)
129+
* Check out the [partitions.io board](https://partitions.io/cdk)
130+
131+
### Roadmap
132+
133+
The [AWS CDK Roadmap project board](https://github.com/orgs/aws/projects/7) lets developers know about our upcoming features and priorities to help them plan how to best leverage the CDK and identify opportunities to contribute to the project. See [ROADMAP.md](https://github.com/aws/aws-cdk/blob/master/ROADMAP.md) for more information and FAQs.
125134

126135
## Contributing
127136

128137
We welcome community contributions and pull requests. See
129-
[CONTRIBUTING](./CONTRIBUTING.md) for information on how to set up a development
138+
[CONTRIBUTING.md](./CONTRIBUTING.md) for information on how to set up a development
130139
environment and submit code.
131140

132-
## Roadmap
133-
134-
The [AWS CDK Roadmap project board] lets developers know about our upcoming features and priorities to help them plan how to best leverage the CDK and identify opportunities to contribute to the project. See [ROADMAP] for more information and FAQs.
135-
136-
[AWS CDK Roadmap project board]: https://github.com/orgs/aws/projects/7
137-
[Roadmap]: (https://github.com/aws/aws-cdk/ROADMAP.md)
138-
139-
## License
140-
141-
The AWS CDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
142-
143-
See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for more information.
144-
145-
[Tutorial]: https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#hello_world_tutorial
141+
## More Resources
142+
* [CDK Workshop](https://cdkworkshop.com/)
143+
* [Examples](https://github.com/aws-samples/aws-cdk-examples)
144+
* [Changelog](./CHANGELOG.md)
145+
* [NOTICE](./NOTICE)
146+
* [License](./LICENSE)

allowed-breaking-changes.txt

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ removed:@aws-cdk/cdk-assets-schema.FileDestination
1919
removed:@aws-cdk/cdk-assets-schema.FileSource
2020
removed:@aws-cdk/cdk-assets-schema.ManifestFile
2121
removed:@aws-cdk/cdk-assets-schema.FileAssetPackaging
22+
23+
changed-type:@aws-cdk/aws-codedeploy.IServerDeploymentGroup.autoScalingGroups
24+
changed-type:@aws-cdk/aws-codedeploy.ServerDeploymentGroup.autoScalingGroups

build.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -euo pipefail
44
bail="--bail"
55
runtarget="build+test"
66
check_prereqs="true"
7+
check_compat="true"
78
while [[ "${1:-}" != "" ]]; do
89
case $1 in
910
-h|--help)
@@ -22,6 +23,9 @@ while [[ "${1:-}" != "" ]]; do
2223
--skip-prereqs)
2324
check_prereqs="false"
2425
;;
26+
--skip-compat)
27+
check_compat="false"
28+
;;
2529
*)
2630
echo "Unrecognized parameter: $1"
2731
exit 1
@@ -70,6 +74,8 @@ echo "==========================================================================
7074
echo "building..."
7175
time lerna run $bail --stream $runtarget || fail
7276

73-
/bin/bash scripts/check-api-compatibility.sh
77+
if [ "$check_compat" == "true" ]; then
78+
/bin/bash scripts/check-api-compatibility.sh
79+
fi
7480

7581
touch $BUILD_INDICATOR

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"tools/*"
1111
],
1212
"rejectCycles": "true",
13-
"version": "1.51.0"
13+
"version": "1.57.0"
1414
}

packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class PipelineDeployStackAction implements codepipeline.IAction {
115115

116116
constructor(props: PipelineDeployStackActionProps) {
117117
this.stack = props.stack;
118-
const assets = this.stack.node.metadata.filter(md => md.type === cxschema.ArtifactMetadataEntryType.ASSET);
118+
const assets = this.stack.construct.metadata.filter(md => md.type === cxschema.ArtifactMetadataEntryType.ASSET);
119119
if (assets.length > 0) {
120120
// FIXME: Implement the necessary actions to publish assets
121121
throw new Error(`Cannot deploy the stack ${this.stack.stackName} because it references ${assets.length} asset(s)`);

packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ export = nodeunit.testCase({
390390

391391
const deployedStack = new cdk.Stack(app, 'DeployedStack');
392392
for (let i = 0 ; i < assetCount ; i++) {
393-
deployedStack.node.addMetadata(cxschema.ArtifactMetadataEntryType.ASSET, {});
393+
deployedStack.construct.addMetadata(cxschema.ArtifactMetadataEntryType.ASSET, {});
394394
}
395395

396396
test.throws(() => {

packages/@aws-cdk/assert/lib/synth-utils.ts

+23-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import * as core from '@aws-cdk/core';
44
import * as cxapi from '@aws-cdk/cx-api';
55

66
export class SynthUtils {
7+
/**
8+
* Returns the cloud assembly template artifact for a stack.
9+
*/
710
public static synthesize(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact {
811
// always synthesize against the root (be it an App or whatever) so all artifacts will be included
9-
const root = stack.node.root;
10-
11-
// if the root is an app, invoke "synth" to avoid double synthesis
12-
const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options);
13-
12+
const assembly = synthesizeApp(stack, options);
1413
return assembly.getStackArtifact(stack.artifactId);
1514
}
1615

@@ -51,10 +50,7 @@ export class SynthUtils {
5150
*/
5251
public static _synthesizeWithNested(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object {
5352
// always synthesize against the root (be it an App or whatever) so all artifacts will be included
54-
const root = stack.node.root;
55-
56-
// if the root is an app, invoke "synth" to avoid double synthesis
57-
const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options);
53+
const assembly = synthesizeApp(stack, options);
5854

5955
// if this is a nested stack (it has a parent), then just read the template as a string
6056
if (stack.nestedStackParent) {
@@ -65,6 +61,24 @@ export class SynthUtils {
6561
}
6662
}
6763

64+
/**
65+
* Synthesizes the app in which a stack resides and returns the cloud assembly object.
66+
*/
67+
function synthesizeApp(stack: core.Stack, options: core.SynthesisOptions) {
68+
const root = stack.construct.root;
69+
if (!core.Stage.isStage(root)) {
70+
throw new Error('unexpected: all stacks must be part of a Stage or an App');
71+
}
72+
73+
// to support incremental assertions (i.e. "expect(stack).toNotContainSomething(); doSomething(); expect(stack).toContainSomthing()")
74+
const force = true;
75+
76+
return root.synth({
77+
force,
78+
...options,
79+
});
80+
}
81+
6882
export interface SubsetOptions {
6983
/**
7084
* Match all resources of the given type

packages/@aws-cdk/assets/test/test.staging.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export = {
2323
'staging can be disabled through context'(test: Test) {
2424
// GIVEN
2525
const stack = new Stack();
26-
stack.node.setContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT, true);
26+
stack.construct.setContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT, true);
2727
const sourcePath = path.join(__dirname, 'fs', 'fixtures', 'test1');
2828

2929
// WHEN

packages/@aws-cdk/aws-amplify/lib/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class App extends Resource implements IApp, iam.IGrantable {
221221
description: props.description,
222222
environmentVariables: Lazy.anyValue({ produce: () => renderEnvironmentVariables(this.environmentVariables) }, { omitEmptyArray: true }),
223223
iamServiceRole: role.roleArn,
224-
name: props.appName || this.node.id,
224+
name: props.appName || this.construct.id,
225225
oauthToken: sourceCodeProviderOptions?.oauthToken?.toString(),
226226
repository: sourceCodeProviderOptions?.repository,
227227
});

packages/@aws-cdk/aws-amplify/lib/domain.ts

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Construct, Lazy, Resource } from '@aws-cdk/core';
1+
import { Construct, Lazy, Resource, IResolvable } from '@aws-cdk/core';
22
import { CfnDomain } from './amplify.generated';
33
import { IApp } from './app';
44
import { IBranch } from './branch';
@@ -72,6 +72,27 @@ export class Domain extends Resource {
7272
*/
7373
public readonly statusReason: string;
7474

75+
/**
76+
* Branch patterns for the automatically created subdomain.
77+
*
78+
* @attribute
79+
*/
80+
public readonly domainAutoSubDomainCreationPatterns: string[];
81+
82+
/**
83+
* The IAM service role for the subdomain.
84+
*
85+
* @attribute
86+
*/
87+
public readonly domainAutoSubDomainIamRole: string;
88+
89+
/**
90+
* Specifies whether the automated creation of subdomains for branches is enabled.
91+
*
92+
* @attribute
93+
*/
94+
public readonly domainEnableAutoSubDomain: IResolvable;
95+
7596
private readonly subDomains: SubDomain[];
7697

7798
constructor(scope: Construct, id: string, props: DomainProps) {
@@ -91,6 +112,9 @@ export class Domain extends Resource {
91112
this.domainName = domain.attrDomainName;
92113
this.domainStatus = domain.attrDomainStatus;
93114
this.statusReason = domain.attrStatusReason;
115+
this.domainAutoSubDomainCreationPatterns = domain.attrAutoSubDomainCreationPatterns;
116+
this.domainAutoSubDomainIamRole = domain.attrAutoSubDomainIamRole;
117+
this.domainEnableAutoSubDomain = domain.attrEnableAutoSubDomain;
94118
}
95119

96120
/**

0 commit comments

Comments
 (0)