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

Merge #29

Merged
merged 135 commits into from
Oct 21, 2020
Merged

Merge #29

merged 135 commits into from
Oct 21, 2020

Conversation

flemjame-at-amazon
Copy link
Owner


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 30 commits October 6, 2020 14:36
Natively integrate EKS with the `cdk8s` library.

Closes #9670

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Stop bundling `test` directories in NPM packages to reduce package sizes
and prevent Yarn from unplugging some packages based on the presence
of a `.jar` file.

Fixes #10602.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
To fix, add the CLI version into the pipeline structure (as an
environment variable to the CodePipeline project).

Fixes #10659.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
* chore(monocdk-experiment): rename package name to monocdk
Based on the discovery of Michael (https://twitter.com/hellomichibye/status/1313134632918024193) this fixes the needed IAM permissions for X-Ray in step-functions.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR adds a property `clusterArn` to `IServerlessCluster`. This simplifies the usage of the Data API which requires passing the ARN of the cluster in Data API calls.

closes #10736


----

*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*
This [commit](#10619), while fixed the problem mentioned, broke the simplest functionally of:
```
cdk context
```
Now throws:

```
Cannot read property 'sort' of undefined
```
This PR reverts that change, and adds a simple unit test that will allow detecting this kind of breakage in unit tests.

We still need to fix the issue in the PR, opening the orginal [issue](#3033). 


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add support for setting `BackupPolicy` to the `FileSystem` L2 construct. [Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html#cfn-efs-filesystem-backuppolicy)

closes #10414 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
bump the minor version to `1.2.10` to avoid a [bug](tdegrunt/jsonschema#314) in version `1.2.9`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
In the latest version the property is called `blockDevices`, not `blockDeviceMappings`.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
chore(rds): add additional mysql engine versions
Closes: #10756

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Co-authored-by: AWS CDK Team <aws-cdk@amazon.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…ed (#10742)

PR that resolves #10740

----

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

Adds support for passing in a identity as it is possible in the CloudFrontWebDistribution

closes #9859


----

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

in the `18.5` import, there the AWS::StepFunctions::Activity resource dropped the required
name property and added one called Arn which was unintentional. A patch was added to restore
the resource specification to previous state.

Since #10762 has been merged, those properties have been restored in the resource specification
as of `18.6`. The patch is no longer necessary.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Support for the new Cache Policy concept in CloudFront, which replaces the
existing `ForwardedValues` properties and specifies what parts of a request
make up the cache key, and what TTLs to use.

_Implementation notes:_
* To achieve the API I wanted for the managed policies, I opted to *not* have
  `ICachePolicy` extend `IResource`. I admit to not understanding all of the
  implications of this, so welcome feedback.
* I also opted to exclude the `cachePolicyLastUpdatedTimestamp` attribute from
  both `ICachePolicy` and `CachePolicy`, as the use case for them isn't clear,
  and handling the property for managed/imported cache policies was awkward.
* Lastly, I opted to remove completely (rather than deprecate) the
  `forwardedValues` property, forcing users to create (or use managed) Cache
  Policies to achieve the same behavior.
* Related to the above, `ForwardedValues` is marked as deprecated and optional
  in the CloudFormation docs, but if no `CachePolicyId` or `ForwardedValues` are
  specified, the deployment will fail claiming `ForwardedValues` is missing.
  That's why I opted to default the `CachePolicyId` to "CachingOptimized".

fixes #9644

BREAKING CHANGE: Distribution `forwardQueryString` and `forwardQueryStringCacheKeys` have been removed in favor of `cachePolicy` and the new CachePolicy construct.
* **cloudfront:** Distributions now default to the "CachingOptimized" managed cache policy

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Support for the new Origin Request Policy concept in CloudFront, which provides
greater control to users over what values are forwarded to the origin from the
original viewer request.

_Implementation Notes:_
* *Heavily* influenced by #10656, including the same notes on not extending from
  `IResource` and excluding the `lastModifiedTimestamp`.
* Currently marked as a DRAFT, since this PR *requires* #10656;
  origin request policies cannot be used without cache policies.

fixes #9647

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
added a condition to ensure that eventBusName does not contain
an unresolved token before performing validation.

Closes #10467


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Use `minimatch` to match stack names when deciding whether to bundle assets or not. This will ensure that when `cdk deploy -e '*-stack'` is run and there is a stack with assets named `'my-stack`, the assets are bundled.

fixes #10732

----

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


----

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

----

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

[Ref](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html)

closes #8459 

----

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

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
NetaNir and others added 29 commits October 17, 2020 19:02
### What's new?

1. Added `.scripts/gen.sh` - execute this to execute `gen` all modules, for cfn modules this will usually execute `cfn2ts`.  This also means that you can use it to generate all required files to build `monocdk`:

```
./scripts/gen.sh
lerna build --scope monocdk
```
 
2. `cdk-build` will now execute the command specified in the package `script.gen` directive.
3. `cdk-build.pre` - The commands in the `pre` array are now concatenated using `&&`. 

This PR includes changes to many files the majority of them are `package.json` files. Summary of changes:

1. Added a `gen` as an npm script target to all cfn modules. The `gen` target is already used in our repo as a convention for executing pre build command for code generation. This change extends it to  include executing `cfn2ts`. Prior to this change we were executing the `pre` commands in `cdk-build`, followed by executing `cfn2ts` on cfn modules. `cdk-build` now execute `gen` unless `--skip-gen` is passed.
2. All code generation command (non `cfn2ts`) were moved from `pre` in `cdk-build` to `gen`. The only remaining `pre` directives are those unrelated to code generation such as cleaning commands.
**Why?**
This will allow us to execute `lerna run --stream gen` to execute all required code generation scripts on all modules.
2. The `cfn2ts` script **already** includes the ability to auto detect the CloudFormation scope from `cdk-build` clause in the `package.json`:
https://github.com/aws/aws-cdk/blob/bc096f08dd1dc29a0bb320b5798b0d7bee5e3161/tools/cfn2ts/bin/cfn2ts.ts#L43-L46
which makes it redundant to execute `cfn2ts --scope=scope` . 
3. Since the `gen` directive is now required in all cfn module, it was added to `cfnspec` so it will be added to every new module.
5. Added a `gen.sh` script in `scripts`, executing it will build `cfn2ts` and then execute `lerna gen`. This is useful if one wants to only get the `.generated` files without running a full build.

This PR originally included the changes require to split the monocdk build, these were removed from this PR to make it easier to review. The monocdk build related changes will be submitted in a different PR.


 
----

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

To avoid forcing a `cdk8s` dependency on the monolithic packages, we don't directly use `cdk8s.Chart` in the EKS integration. Instead, we use a generic `Construct` and assert at runtime that it indeed a cdk8s chart.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR fixes #3033 while also addressing the issues that arose from #10619

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The self-mutation feature of the `CdkPipeline` might at times get in the way of the pipeline development workflow. Each change to the pipeline must be pushed to git, otherwise, after the pipeline was updated using `cdk deploy`, it will automatically revert to the state found in git.

To make the development more convenient, the self-mutation feature can be turned off temporarily, by passing `selfMutating: false` property, example:

```ts
const pipeline = new CdkPipeline(this, 'Pipeline', {
  selfMutating: false,
  ...
});
```

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Expects generic `RestApiBase` instead of `RestApi` at `BasePathMapping` creation
- Fixes #10300


----

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

The [AutoPullRequest] CodeBuild job already checks out the base branch.
This causes the `git checkout -b` command to fail since the branch
already exists.

Update the script so that branch creation occurs only if it does not
already exist.

[AutoPullRequest]: https://github.com/aws/cdk-ops/blob/21acd7ff37ad9ab14d8c3f9b41980e9f62f64503/lib/cdk-pipeline.ts#L284-L290


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Note: No functional change to the tests or the set of tests.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Bumps [yargs](https://github.com/yargs/yargs) from 16.0.3 to 16.1.0.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/master/CHANGELOG.md)
- [Commits](yargs/yargs@v16.0.3...v16.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Fixes the issue with the lambda python asset hashes changing. The dependencies of the `requests` package need to be explicitly locked.

See broken builds in #10958, #10957

----

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

Bumps [parcel](https://github.com/parcel-bundler/parcel) from 2.0.0-beta.1 to 2.0.0-nightly.425.
- [Release notes](https://github.com/parcel-bundler/parcel/releases)
- [Changelog](https://github.com/parcel-bundler/parcel/blob/v2/CHANGELOG.md)
- [Commits](https://github.com/parcel-bundler/parcel/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
The parameter specified for LogOptions is `destination`, not `destinations`.
https://github.com/aws/aws-cdk/blob/2640d9aa06039a6eb539d959d2126749486c7ef3/packages/%40aws-cdk/aws-stepfunctions/lib/state-machine.ts#L62

----

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

closes #10349


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Bumps [jest](https://github.com/facebook/jest) from 26.4.2 to 26.6.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](jestjs/jest@v26.4.2...v26.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Two different mergify rules match the v2-main branch merge.
Include the branch base name as a conditional to keep them unique.
Enable brotli compression support in `CachePolicy`

Closes #10947
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This reverts #10570. The logging buckets were originally using the regional
domain names, but this caused odd behavior with CloudFront's new console "Logs"
experience. #10570 switched logging buckets to use the global domain name, which
addressed the console issue but broke customers in CN regions.

We will follow up internally to improve the CloudFront console issue.

fixes #10923


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
L2 constructs were created in May for this module, but the package stability was
never updated.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Bumps [cdk8s](https://github.com/awslabs/cdk8s) from 0.30.0 to 0.32.0.
- [Release notes](https://github.com/awslabs/cdk8s/releases)
- [Changelog](https://github.com/awslabs/cdk8s/blob/master/CHANGELOG.md)
- [Commits](cdk8s-team/cdk8s@v0.30.0...v0.32.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 10.17.35 to 10.17.40.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
One test was modified because the last argument didn't type check against the nodeunit-shim - here:

https://github.com/aws/aws-cdk/blob/2640d9aa06039a6eb539d959d2126749486c7ef3/packages/%40aws-cdk/aws-s3/test/test.bucket.ts#L128-L132

changed to:

```ts
test.throws(() => new s3.Bucket(stack, 'MyBucket', {
  bucketName: bucket,
}), expectedErrors);
```

----

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

Bumps [parcel](https://github.com/parcel-bundler/parcel) from 2.0.0-nightly.425 to 2.0.0-nightly.426.
- [Release notes](https://github.com/parcel-bundler/parcel/releases)
- [Changelog](https://github.com/parcel-bundler/parcel/blob/v2/CHANGELOG.md)
- [Commits](https://github.com/parcel-bundler/parcel/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
----

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


----

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

hashicorp/terraform-provider-aws#13061

----

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

The `aws-cloudfront` `Distribution` construct was marked as Developer Preview
in #10831, but this module -- which the `Distribution` relies on -- was missed.


----

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

# fix from sh to bash

`lib/bundlers.ts` actually uses not `sh` but `bash`,
`bash` is a good way to test.

# lock yarn version

aws-lambda-nodejs have issue

* [npm install -g yarn · Issue #6 · nodejs/corepack](nodejs/corepack#6)
* [npm install yarn --global fails in docker container · Issue #8358 · yarnpkg/yarn](yarnpkg/yarn#8358)

From issue comment,

> For future reference, you can (should) pin your version rather than use whatever the latest is on npm (by using yarn@1.22.6, etc) - it's a good practice anyway regardless of the conditions, as you never know which bug could slip by us. You can also use the yarn-path setting to ensure that upgrades go through the appropriate review processes (including CI).
>
> <yarnpkg/yarn#8358 (comment)>

So we'll follow it.

And from issue comment,

> Fwiw we don't plan to add any more features to Yarn 1, as all of our resources have shifted to Yarn 2. The past few commits have been aimed toward making the transition a bit easier, in particular thanks to the Corepack initiative which we hope will make it easier to use Yarn (both 1 & 2) by removing the need to manually install them.
>
> <yarnpkg/yarn#8358 (comment)>

There's not much need to be concerned with the latest version of 1.

# allow execute command for non root user

`amazon/aws-sam-cli-build-image-nodejs12.x` don't have user that index is 1000.
So create non root user.

`/` in `amazon/aws-sam-cli-build-image-nodejs12.x` permission is `700`.
change to allow execute command for non root user.
I really don't want to change around the permissions,
but I don't have a choice.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@flemjame-at-amazon flemjame-at-amazon merged commit 3687738 into flemjame-at-amazon:master Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.