Skip to content

chore(release): 2.0.0-rc.31 - #17662

Merged
mergify[bot] merged 148 commits into
v2-releasefrom
bump/2.0.0-rc.31
Nov 23, 2021
Merged

mergify[bot] merged 148 commits into
v2-releasefrom
bump/2.0.0-rc.31

Conversation

@aws-cdk-automation

@aws-cdk-automation aws-cdk-automation commented Nov 23, 2021 •

Copy link
Copy Markdown
Collaborator

See CHANGELOG

serahisaactho and others added 30 commits November 9, 2021 10:08
Resolves #12559 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date.
Included in this PR:
- chore(stepfunctions): migrate tests to assertions
- chore(stepfunctions-tasks): migrate tests to assertions

For both modules, removes dev dependency to `assert-internal` and replaces it with `assertions`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
A previous commit - 0fb2179 - removed the need for vendoring in the old
assert module. It had previously required its dependencies to be
bundled.

These dependencies are no longer required. This clean up was missed in
the previous commit.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
closes #14828

By this PR, we can allow access to management API by the following code.

```ts
    const api = new WebSocketApi(stack, 'Api');
    const defaultStage = new WebSocketStage(stack, 'Stage', {
      webSocketApi: api,
      stageName: 'dev',
    });
    const principal = new User(stack, 'User');

    api.grantManagementApiAccess(principal); // allow access to the management API for all the stage
    defaultStage.grantManagementApiAccess(principal); // allow access to the management API for a specific stage
```

We use WebSocket API Management API to send messages to a WebSocket API. [(doc)](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html) To use the API, we must set IAM statement as below [(doc)](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-control-access-iam.html):

```json
    {
      "Effect": "Allow",
      "Action": [
        "execute-api:ManageConnections"           
      ],
      "Resource": [
        "arn:aws:execute-api:us-east-1:account-id:api-id/stage-name/POST/@connections/*"
      ]
    }
``` 

We need `/*` at the end of resource ARN because there will be arbitrary strings (`connectionId`).
i.e. `{apiArn}/{stageName}/POST/@connections/{connectionId}`

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The init template tests now run tests for each language. However, the python app
init template does not have any defined tests (the sample test is commented
out). This causes the init template test to fail.

Leaving the SQS assertion commented out, but uncommenting the rest of the test
so a no-op test runs successfully.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
`jsii-rosetta infuse` will modify all the assemblies in-place to
add examples to types that don't have examples yet.

Re-roll 3 of this feature.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…Path` (#17376)

Add `DynamoAttributeValue.listFromJsonPath(value: string)` to allow specifying a list/array from the state input as a parameter in a DynamoDB PutItem or UpdateItem optimized integration in stepfunctions-tasks.

Closes #17375 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add timezone property to ScheduledAction.

example:
```typescript
import * as asg from '@aws-cdk/aws-autoscaling';

new asg.ScheduledAction(this, 'test', {
    autoScalingGroup: 'test',
    desiredCapacity: 1,
    minCapacity: 1,
    maxCapacity: 2,
    schedule: {
        expressionString: '0 3 * * *'
    },
    timeZone: 'Asia/Seoul'
});
```

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add support for nested stacks


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This will prevent regression in compilation status for the top 25 construct libraries, that we've gone through the effort of making compile.

This also gets rid of the `@example` values in most of the construct libraries here.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR refactor the test that I committed earlier based on the above comment.

- #17307 (comment)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…17403)

## Summary

This PR modifies the aws-logs `index.ts` file to also forward the exports from `policy.ts` ([a newly created file](#17015) that implements the `ResourcePolicy` class).

Fixes: #17402
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…gure layers and environment (#17372)

## Summary

This PR adds the following to `SingletonFunction`:

- `runtime` - property
- `logGroup` - property
- `addLayers()` - method
- `addEnvironment()` - method

Fixes: #17369

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
## Summary

This PR adds `@aws-cdk/asserts` to the dependency list of `aws-codebuild`. 

Fixes:  #17416

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…onstraint (#17371)

Service Catalog Launch Role Constraints support the ability to reference a role by name. Many customers use Service Catalog in a hub and spoke model, sharing portfolios to many accounts. This feature allows the launch role to be account agnostic, as the arn is tied to a single account. As a result, a launch role constraint can be created once with the role name and shared rather than sharing the portfolio and creating a launch role constraint in each spoke account.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

Co-authored-by: Aidan Crank <[email protected]>
`rosetta` folder is erroneously tracked by git. This PR
adds `rosetta` to `.gitignore` and removes the folder
from the repo.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date.
Currently ubergen bundles all fixtures into the same `rosetta` folder.
This means that all fixtures in files called `default.ts-fixture` replace
each other as they are found and vie to be the last `default.ts-fixture`
standing in the `rosetta` folder. This causes unintended compiliation
failures for `yarn rosetta:extract --compile` in projects that rely on
ubergen, since they will be copied into the wrong `default.ts-fixture`.

The solution here in jsii is to find fixtures based on submodules: aws/jsii#3131.
This PR updates ubergen to construct the necessary subfolders in
`rosetta` so that the expected submodule fixtures can be found. 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add `watch` to the list of commands that require bundling.

Closes #17391


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR refactor the test that I committed earlier, and is based on the following comment.

- #17307 (comment)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs.

This PR is one of steps after following PR: 
- #16681 (comment)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…al tooling (#17343)

----
Reference issue #14593
Building on this initial PR: #1433

We're looking to add asset metadata to the NestedStack resource. The implementation is similar to this one [design/code-asset-metadata.md](https://github.com/aws/aws-cdk/pull/design/code-asset-metadata.md). This will allow SAM CLI to support CDK-synthed templates nested function resources.

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
)

fixes #16188 
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
iliapolo and others added 21 commits November 22, 2021 15:19
Add support for deploying the [AWS ALB Controller](https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/) onto the cluster. 

Resolves #8836

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Some examples don't compile because we can emit some imports
twice.

This is because we expect imports to be sorted, and only deduplicate
pairwise, but we forgot to include submodule in the sort key.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
fixes: #17572
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Adds `rewriteImports` and helper functions `rewriteReadmeImports` and `rewriteMonoPackageImports` to `aws-cdk-migration` package.
- `individual-package-gen` consumes `rewriteReadmeImports` for alpha modules.
- `individual-package-gen` treats rosetta fixtures as source files and rewrites imports there as well.
- Adds `aws-cdk-migration` as a dependency to `ubergen`.
- Refactors `rewriteImports` in `ubergen` to use the API in `aws-cdk-migration`. Has the side affect of removing the string-replace function that was introduced in this [PR](#14255). This changes the readme import style from `import { blah as blah } from 'aws-cdk-lib';` to `import * as blah from 'aws-cdk-lib/blah';`.
- fixes error in `cfnspec` that generated invalid import names for L1 module readmes.
- fixes bug in `cdk-build` that only executed one `post` command.
- fixes `verify-imports` scripts typo introduced previously (that was not caught due to the `cdk-build` bug).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…ort #17627) (#17629)

This is an automatic backport of pull request #17627 done by [Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
…17573) (#17635)

This is an automatic backport of pull request #17573 done by [Mergify](https://mergify.com).
Cherry-pick of 66e37cc has failed:
```
On branch mergify/bp/master/pr-17573
Your branch is up to date with 'origin/master'.

You are currently cherry-picking commit 66e37cc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   packages/@aws-cdk/cfnspec/test/libary-creation.test.ts
	modified:   packages/aws-cdk-lib/.gitignore
	modified:   packages/aws-cdk-lib/package.json
	modified:   packages/aws-cdk-lib/scripts/verify-imports-resolve-same.ts
	deleted:    packages/aws-cdk-lib/scripts/verify-readme-import-rewrites.ts
	modified:   packages/aws-cdk-migration/bin/rewrite-imports-v2.ts
	modified:   packages/aws-cdk-migration/lib/rewrite.ts
	modified:   packages/aws-cdk-migration/test/rewrite.test.ts
	modified:   packages/monocdk/.gitignore
	modified:   tools/@aws-cdk/cdk-build-tools/bin/cdk-build.ts
	modified:   tools/@aws-cdk/individual-pkg-gen/transform-packages.ts
	modified:   tools/@aws-cdk/ubergen/bin/ubergen.ts
	modified:   tools/@aws-cdk/ubergen/package.json

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   packages/@aws-cdk/cfnspec/lib/library-creation.ts

```


To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…17634)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The `Cluster.addCapacity` method was deprecated in #14386 as part of the
introduction of `Cluster.addAsgCapacityProvider`. However, the corresponding
`ClusterProps.capacity` property and `AddCapacityOptions` interface were not
deprecated, leading to a confusing mismash of deprecated and undeprecated usage.
The README for ECS still heavily references `Cluster.addCapacity`, further
leading to potential confusion for users just following the module's guidance.

As part of cleaning up deprecated usage as part of the lead-up to the V2 launch,
opting to un-deprecate the `addCapacity` method rather than deprecating the
other two elements and rewriting the README.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is an automatic backport of pull request #17652 done by [Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
…te failure (#17530)

This fixes the issue where updating the memoryLimit or vpc of the
BucketDeployment resource would result in a stack update failure. In
order to fix this the ID of the BucketDeployment CustomResource includes
info on the memoryLimit and vpc in the same way that the Lambda function
does. This means that when either of these values are updated, the
BucketDeployment CustomResource will be recreated along with the Lambda
function.

If anyone is setting `retainOnDelete=false` (default is `true`) then
this change would result in the data in the bucket being deleted. In
order to avoid this scenario, this PR introduces a bucket tag that
controls whether or not a BucketDeployment resource can delete data from
the bucket.

The BucketDeployment resource will now add a tag to the deployment
bucket with a format like `aws-cdk:cr-owned:{keyPrefix}:{uniqueHash}`.
For example:

```
{
  Key: 'aws-cdk:cr-owned:deploy/here/:240D17B3',
  Value: 'true',
}
```

Each bucket+keyPrefix can be "owned" by 1 or more BucketDeployment
resources. Since there are some scenarios where multiple BucketDeployment
resources can deploy to the same bucket and key prefix
(e.g. using include/exclude) we also append part of the id to
make the key unique.

As long as a bucket+keyPrefix is "owned" by a BucketDeployment
resource, another CR cannot delete data. There are a couple of
scenarios where this comes into play.

1. If the LogicalResourceId of the CustomResource changes
(e.g. memoryLimit is updated) CloudFormation will first issue a 'Create'
to create the new CustomResource and will update the Tag on the bucket.
CloudFormation will then issue a 'Delete' on the old CustomResource
and since the new CR "owns" the Bucket+keyPrefix (indicated by the
presence of the tag), the old CR will not delete the contents of the bucket

2. If the BucketDeployment resource is deleted _and_ it is the only CR
for that bucket+keyPrefix then CloudFormation will first remove the tag
from the bucket and then issue a "Delete" to the CR. Since there are no
tags indicating that this bucket+keyPrefix is "owned" then it will delete
the contents.

3. If the BucketDeployment resource is deleted _and_ it is *not* the only
CR for that bucket:keyPrefix then CloudFormation will first remove the tag
from the bucket and then issue a "Delete" to the CR.
Since there are other CRs that also "own" that bucket+keyPrefix
(indicated by the presence of tags), there will
still be a tag on the bucket and the contents will not be removed. The
contents will only be removed after _all_ BucketDeployment resource that
"own" the bucket+keyPrefix have been removed.

4. If the BucketDeployment resource _and_ the S3 Bucket are both removed,
then CloudFormation will first issue a "Delete" to the CR and since there
is a tag on the bucket the contents will not be removed. If you want the
contents of the bucket to be removed on bucket deletion, then
`autoDeleteObjects` property should be set to true on the Bucket.

Scenario 3 & 4 are changes to the existing functionality in that they
now do *not* delete data in some scenarios when they did previously.

fixes #7128


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is done with the express purpose of improving its discoverability on Construct Hub.

----
Changed the description and added keywords
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@aws-cdk-automation aws-cdk-automation added pr/auto-approve Notifies the GH action to auto-approve this PR pr/no-squash This PR should be merged instead of squash-merging it labels Nov 23, 2021
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator Author

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4403b14
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
mergify Bot merged commit a08d57c into v2-release Nov 23, 2021
@mergify
mergify Bot deleted the bump/2.0.0-rc.31 branch November 23, 2021 18:38
@mergify

mergify Bot commented Nov 23, 2021

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be automatically updated and merged without squashing (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/auto-approve Notifies the GH action to auto-approve this PR pr/no-squash This PR should be merged instead of squash-merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.