Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): 2.83.0 #25887

Merged
merged 34 commits into from
Jun 7, 2023
Merged

chore(release): 2.83.0 #25887

merged 34 commits into from
Jun 7, 2023

Conversation

aws-cdk-automation
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation commented Jun 7, 2023

See CHANGELOG

sumupitchayan and others added 30 commits May 12, 2023 17:03
)

Fixes #25761

The existing behavior was that `alias.aliasName` was always a raw string, so properties like `keyId` and `keyArn` depended on a raw string and not a reference to the alias itself. This behavior is preserved.

Under a new feature flag, `const KMS_ALIAS_NAME_REF = '@aws-cdk/aws-kms:aliasNameRef'`, we instead use a reference to the `aliasName` output itself, which means that properties that depend on `aliasName` now depend on the `alias`. In turn, the `alias` depends on the `key`. This allows the expected behavior where specifying something like `alias.keyArn()` depends on the key.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Checks off some items from #24597

----

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

Includes cdklabs/cdk-generate-synthetic-examples#262

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Increasing time it takes to automatically close inactive issues across our repositories

----

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

The reason is that the packages that have the changes in them are now called `@aws-cdk/aws-XXX-alpha`, but changes are usually stated as `feat(XXX): ...`.

The code generating name variants to catch the possible values of `XXX` was not taking the `-alhpa` suffix into account. Now is.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
To help with diagnosing #25806, if the work graph can't make any progress anymore because of a dependency cycle, print the cycle that was found instead of all the remaining nodes.

----

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

Users can run commands in or get a shell to a container running on an Amazon EC2 instance or on AWS Fargate with Amazon ECS Exec.

`FargateService` and `Ec2Service` in `aws-ecs` supports the flag to enable Amazon ECS Exec, `enableExecuteCommand`.
`EcsTask` in `aws-events-targets` also supports `enableExecuteCommand` in CloudFormation, but AWS CDK doesn't.
This feature supports `enableExecuteCommand` flag also for `EcsTask`.

----

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

In #25536 we introduced the new work graph orchestration for the CLI which had a bug when the same asset was shared by multiple stacks. #25719 was an attempt at fixing this bug, and while it fixed it for some cases it didn't fix all of them.

The issue is that for cosmetic reasons, asset publishing steps inherit the dependencies of the stacks they are publishing for  (so that the printed output of asset publishing doesn't interfere with the in-place updated progress bar of stack deployment and make it lose track of the terminal state).

There were two bugs:

* These extra dependencies could cause cycles (#25719 addressed direct cycles, where `Publish <--> Stack`, but not indirect cycles, where `Publish -> StackA -> StackB -> Publish`).
* Publishing nodes would overwrite other nodes with the same ID, and the dependency set they would end up with would be somewhat nondeterministic, making this problem hard to isolate.

Fixes #25806.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add parameter automaticStopTimeMinutes to specify the number of minutes until the running instance is shut down after the environment was last used.

Closes #25592.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
RestApi has the ability to set the apiKeyRequired option for all methods via defaultMethodOptions.

Setting this option on a method should override the value set in defaultMethodOptions, but it doesn't work.

This commit fixes the behaviour and adds a test.

Mentioned in #8827

----

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

When building the options to `tsc` for pre-compilation from tsconfig, exclude any `noEmit` compiler option in case it has been set to `true`, which would prevent generation of the compiled .js files. Added `'noEmit'` to the list of excluded options when processing tsconfig.

Closes #25603.

----

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

When the StateMachine being invoked by CodePipeline is not in the same account/region as the CodePipeline, the `DescribeExecutions` permission was granted on the incorrect account/region pair (that of the pipeline, and not that of the StateMachine), due to the transforming of the state machine's ARN into a state machine execution ARN pattern not copying the account & region of the original ARN.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Guards against the following error when creating new packages:

```bash
Error: The module @aws-cdk/app-staging-synthesizer-alpha does not have a dotnet.packageId setting
```

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This adds support for using TypeScript Module (`.mts`), TypeScript CommonJS (`.cts`) and JavaScript CommonJS (`.cjs`) entry files, as well as adding these to the default entry file search. 

This is a must for projects mixing ESM and CommonJS (quite common as not everything can/should be fully ESM yet) or where explicit file extension is desired.

I tried to follow the existing convention as best I could to keep it as simple as possible. I am not sure why the tests for the existing entry files are skipped as they seem to be working correctly, at least locally, so I enabled the new tests I added.

Closes #21635.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When an application has many assets (think ~100) the existence check which seeks to scrub already existing assets from the work graph is starting to take a significant amount of time. Do those checks in parallel.

Also in this PR:

- Improve the printing of the work graph a little to make it slightly less unreadable if the graph gets large.
- Print the graphviz representation of the work graph to the trace log if the graph gets stuck, for debugging purposes.
- In the work graph builder, only add dependencies on stacks. Previously, it used to add dependencies on assets as if they were stacks (those were later on removed, but we didn't need to add them in the first place).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
fix broken link in CONTRIBUTING.md. 🙏🏻 

----

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

## What changes
Add support of AWS SDK for JavaScript v3 to `AwsCustomResource`. It also continues to works with runtimes that use the AWS SDK for JavaScript v2 (e.g Node.js 16.x).
**⚠️ This PR only add support, doesn' change custom resource default runtime version**

## Why need this change?
Because AWS SDK for JavaScript v2 enters into maintenance mode in 2023.
At least, we must upgrade Node.js runtime to 18 or higher version that using AWS SDK for JavaScript v3 in 2023. If not upgrade, when customers possibly can't use new AWS Service's APIs.

※ reference from [Document for AWS SDK for JavaScript v2](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/)
> ### Version 2.x Support
> We are formalizing our plans to enter AWS SDK for JavaScript v2 into maintenance mode in 2023.
 [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3) is the latest and recommended version, which has been GA since December 2020. Here is [why and how you should use AWS SDK for JavaScript v3](https://aws.amazon.com/blogs/developer/why-and-how-you-should-use-aws-sdk-for-javascript-v3-on-node-js-18/). You can try our experimental migration scripts in [aws-sdk-js-codemod](https://www.npmjs.com/package/aws-sdk-js-codemod) to migrate your application from v2 to v3.
To get help with your migration, please follow our general guidelines to [open an issue](https://github.com/aws/aws-sdk-js/issues/new/choose) and choose [guidance](https://github.com/aws/aws-sdk-js/issues/new?assignees=&labels=guidance%2C+needs-triage&template=---questions---help.md&title=). To give feedback on and report issues in the v3 repo, please refer to [Giving feedback and contributing](https://github.com/aws/aws-sdk-js-v3#giving-feedback-and-contributing).
Watch this README and the [AWS Developer Tools Blog](https://aws.amazon.com/blogs/developer/) for updates and announcements regarding the maintenance plans and timelines. Please refer to the [AWS SDKs and Tools maintenance policy](https://docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html) for further details.

## Why don't change default runtime version?
AWS Lambda uses AWS SDK for JavaScript v3 since Node.js 18.x runtime. This is major update so I think it has breaking changes. This is reason. So I plan this.
1. Add experimentally support AWS SDK for JavaScript v3 (this PR)
2. Announce experimentally support Node.js 18.x runtime for customers who wish to update
3. Change `AwsCustomResource`'s default runtime to Node.js 18.x in 2023 or Node.js 16.x EOL

This plan allows time for transition before changing the default runtime for `AwsCustomResource`.

## Are there any changes to the props?
Yes. The specification method for the AWS SDK for JavaScript v3 will now be supported.
In AWS SDK for JavaScript v3, packages are installed for each service. Therefore, specify the package name for `service`. Also, `action` specifies the XxxClient operations provided in the package.

Example of [SSM.getParameter](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/preview/client/ssm/):
```ts
new AwsCustomResource(this, 'GetParameter', {
  resourceType: 'Custom::SSMParameter',
  onUpdate: {
    service: '@aws-sdk/client-ssm', // 'SSM' in v2
    action: 'GetParameterCommand', // 'getParameter' in v2
    parameters: {
      Name: 'foo',
      WithDecryption: true,
    },
    physicalResourceId: PhysicalResourceId.fromResponse('Parameter.ARN'),
  },
});
```

## What actions do customers need to take when migrating?
Nothing to do. To maintain backward compatibility, when customers provides AWS SDK for JavaScript v2 style parameters, then `AwsCustomResource`  automatically convert the parameters to AWS SDK for JavaScript v3 style and handle it in lambda runtime code. Next example will be allowed.
```ts
new AwsCustomResource(this, 'CostUsageReportDefinitions', {
  resourceType: 'Custom::CostUsageReportDefinitions',
  onUpdate: {
    service: 'CUR', // will convert to '@aws-sdk/client-cost-and-usage-report-service'
    action: 'describeReportDefinitions', // will convert to 'DescribeReportDefinitionsCommand'
    parameters: {
      MaxResults: 5,
    },
    physicalResourceId: PhysicalResourceId.of('xxx'),
  },
});
```

## How can I use it before the default runtime changes?
On hold. Considering overriding with [`regioninfo.Fact.register`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.region_info-readme.html#overriding-incorrect-information) or rewriting it like `addPropertyOverride` by customers. There are currently no plans to provide dedicated functions.

## Others
- I added 3 packages for testing
  - @aws-sdk/client-s3
  - @aws-sdk/credential-providers
  - aws-sdk-client-mock
- I'm referring to part of the code at [aws-sdk-js-codemod](https://github.com/awslabs/aws-sdk-js-codemod). The license is from the same organization, so I don't think there's a problem, but I'll write it down for confirmation.



----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
There was still a TOCTOU error in the file asset publishing, which could lead to `ENOENT: no such file or directory` when assets were being published in parallel.

The whole `if (fileExists) { delete; }` logic was actually not necessary, as `fs.rename` will atomically overwrite existing files already, so we can just call it directly.

Closes #25293.

----

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

Fixes #24822

As I commented on #24822 (comment), auto delete container images in ECR repository fails when it has container manifest list. I fix custom resource Lambda function to delete tagged images first.

----

*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 auto-approve pr/no-squash This PR should be merged instead of squash-merging it labels Jun 7, 2023
@gitpod-io
Copy link

gitpod-io bot commented Jun 7, 2023

@github-actions github-actions bot added the p2 label Jun 7, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team June 7, 2023 10:50
@aws-cdk-automation
Copy link
Collaborator Author

AWS CodeBuild CI Report

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

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

@mergify
Copy link
Contributor

mergify bot commented Jun 7, 2023

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).

@mergify mergify bot merged commit 0fd7f2b into v2-release Jun 7, 2023
@mergify mergify bot deleted the bump/2.83.0 branch June 7, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-approve p2 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.