Skip to content

Commit be5ad8b

Browse files
authored
2 parents 7a8ae02 + 4e27cc3 commit be5ad8b

File tree

828 files changed

+467244
-270095
lines changed

Some content is hidden

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

828 files changed

+467244
-270095
lines changed

.gitattributes

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# Set the default behavior, in case people don't have core.autocrlf set.
22
* text=auto
3-
43
# Currently, this repository has LF dependencies in building and testing, with json, sh, and no extensions.
54
# Until this is fixed, it is best to just set the whole repository to be LF.
65
* eol=lf
7-
86
*.gif binary
97
*.zip binary
108
*.png binary
119
*.jpg binary
1210
*.tgz binary
1311
*.tar.gz binary
14-
1512
# Hide snapshots from GitHub UI, except for the actual templates
1613
**/*.snapshot/** linguist-generated
1714
**/*.snapshot/**/*.template.json -linguist-generated
1815
**/*.snapshot/**/*DeployAssert*.template.json linguist-generated
16+
packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-big-response.js.snapshot/asset.3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip filter=lfs diff=lfs merge=lfs -text

CHANGELOG.v2.alpha.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,65 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.161.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.160.0-alpha.0...v2.161.0-alpha.0) (2024-10-03)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **kinesisfirehose-destinations:** the `logging` and `logGroup` properties in `DestinationLoggingProps` have been removed and replaced with a single optional property `loggingConfig` which accepts a class of type `LoggingConfig`.
11+
12+
#### Details
13+
Combine the `logging` and `logGroup` properties into a single new optional property called `loggingConfig` which accepts a class of type `LoggingConfig`.
14+
15+
`LoggingConfig` is an abstract class which can be instantiated through either an instance of `EnableLogging` or `DisableLogging` which can be used in the following 3 ways:
16+
17+
```ts
18+
import * as logs from 'aws-cdk-lib/aws-logs';
19+
20+
const logGroup = new logs.LogGroup(this, 'Log Group');
21+
declare const bucket: s3.Bucket;
22+
23+
// 1. Enable logging with no parameters - a log group will be created for you
24+
const destinationWithLogging = new destinations.S3Bucket(bucket, {
25+
loggingConfig: new destinations.EnableLogging(),
26+
});
27+
28+
// 2. Enable a logging and pass in a logGroup to be used
29+
const destinationWithLoggingAndMyLogGroup = new destinations.S3Bucket(bucket, {
30+
loggingConfig: new destinations.EnableLogging(logGroup),
31+
});
32+
33+
// 3. Disable logging (does not accept any parameters so it is now impossible to provide a logGroup in this case)
34+
const destinationWithoutLogging = new destinations.S3Bucket(bucket, {
35+
loggingConfig: new destinations.DisableLogging(),
36+
});
37+
38+
```
39+
40+
### Description of how you validated changes
41+
unit + integ test
42+
43+
### Checklist
44+
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
45+
46+
### Features
47+
48+
* **ec2:** add interface endpoint dynamodb ([#30162](https://github.com/aws/aws-cdk/issues/30162)) ([182804a](https://github.com/aws/aws-cdk/commit/182804a3b3116924e2f7a8e50a22e2e7d99c71ae)), closes [#29547](https://github.com/aws/aws-cdk/issues/29547)
49+
* **pipes-sources:** add Kinesis and DynamoDB ([#29476](https://github.com/aws/aws-cdk/issues/29476)) ([00c2efb](https://github.com/aws/aws-cdk/commit/00c2efb323fdba21191c69e7f970e2cd78c37d68)), closes [#29378](https://github.com/aws/aws-cdk/issues/29378) [#29377](https://github.com/aws/aws-cdk/issues/29377)
50+
* **pipes-targets:** add API destination ([#30756](https://github.com/aws/aws-cdk/issues/30756)) ([5e08c98](https://github.com/aws/aws-cdk/commit/5e08c981dd2a309c84abc01a0c8b358e55b5cc4c)), closes [/github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-events-targets/lib/api-gateway.ts#L11-L32](https://github.com/aws//github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-events-targets/lib/api-gateway.ts/issues/L11-L32)
51+
* **pipes-targets:** add Kinesis ([#30656](https://github.com/aws/aws-cdk/issues/30656)) ([d0c99d8](https://github.com/aws/aws-cdk/commit/d0c99d85e0bd85beea78ce65f843d319abd493ce))
52+
* **redshift:** supports excludeCharacters settings for DatabaseSecret ([#30563](https://github.com/aws/aws-cdk/issues/30563)) ([a1c46cf](https://github.com/aws/aws-cdk/commit/a1c46cfc5eefa58640324420a3dc15b32c37e7dd)), closes [#26847](https://github.com/aws/aws-cdk/issues/26847)
53+
54+
55+
### Bug Fixes
56+
57+
* **custom-resource-handlers:** better fallback for require failures ([#31571](https://github.com/aws/aws-cdk/issues/31571)) ([00cdbcb](https://github.com/aws/aws-cdk/commit/00cdbcba93baa9a605f62ae8c18c0880ec15aea2)), closes [#30067](https://github.com/aws/aws-cdk/issues/30067)
58+
59+
60+
### Miscellaneous Chores
61+
62+
* **kinesisfirehose-destinations:** refactor logging to combine logGroup and logging properties into loggingConfig ([#31488](https://github.com/aws/aws-cdk/issues/31488)) ([c4bda64](https://github.com/aws/aws-cdk/commit/c4bda6409cea78dbfa51fb6437f61fb13d0d0abb))
63+
564
## [2.160.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.159.1-alpha.0...v2.160.0-alpha.0) (2024-09-24)
665

766

CHANGELOG.v2.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,38 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.161.0](https://github.com/aws/aws-cdk/compare/v2.160.0...v2.161.0) (2024-10-03)
6+
7+
8+
### Features
9+
10+
* update L1 CloudFormation resource definitions ([#31640](https://github.com/aws/aws-cdk/issues/31640)) ([79d9c4d](https://github.com/aws/aws-cdk/commit/79d9c4ddd4b96a4d4bd0c38a83687229253449fc)), closes [/docs.aws.amazon.com/datasync/latest/userguide/create-locations-cli.html#create-location-s3](https://github.com/aws//docs.aws.amazon.com/datasync/latest/userguide/create-locations-cli.html/issues/create-location-s3)
11+
* **bedrock:** support meta llama3-2 ([#31568](https://github.com/aws/aws-cdk/issues/31568)) ([4ddc702](https://github.com/aws/aws-cdk/commit/4ddc702236e74abd179b5d866614066f71a0f91b))
12+
* **cli:** `cdk rollback` ([#31407](https://github.com/aws/aws-cdk/issues/31407)) ([0755561](https://github.com/aws/aws-cdk/commit/0755561b79d6be0744b0b21504fe54ffcf2b618a)), closes [#30546](https://github.com/aws/aws-cdk/issues/30546)
13+
* **cli:** notices on bootstrap version ([#31555](https://github.com/aws/aws-cdk/issues/31555)) ([b0e4a54](https://github.com/aws/aws-cdk/commit/b0e4a544aecce86e8b41e7cd148a139c2e34bfbd))
14+
* **ecs:** support restart policy for container ([#31228](https://github.com/aws/aws-cdk/issues/31228)) ([a22e8cc](https://github.com/aws/aws-cdk/commit/a22e8cc8e2bd458fa2b972a76cd5c1f8c57a88d1)), closes [#31127](https://github.com/aws/aws-cdk/issues/31127) [#31425](https://github.com/aws/aws-cdk/issues/31425)
15+
* **logs:** add metric methods for log group IncomingLogEvents and IncomingBytes ([#31535](https://github.com/aws/aws-cdk/issues/31535)) ([2813eb2](https://github.com/aws/aws-cdk/commit/2813eb26c5ae7457591897fd898438019af8ea65)), closes [#30034](https://github.com/aws/aws-cdk/issues/30034)
16+
* **rds:** support for local write forwarding in an Aurora Mysql cluster ([#31524](https://github.com/aws/aws-cdk/issues/31524)) ([48c4192](https://github.com/aws/aws-cdk/commit/48c4192736c5ad1ea96f2b6760466031219adfbf)), closes [#31523](https://github.com/aws/aws-cdk/issues/31523)
17+
* **s3-deployment:** added property outputObjectKeys for BucketDeployment ([#31452](https://github.com/aws/aws-cdk/issues/31452)) ([54c01cb](https://github.com/aws/aws-cdk/commit/54c01cbb24242f5646f2798f8b28ec6172dedbc9)), closes [#28579](https://github.com/aws/aws-cdk/issues/28579)
18+
19+
20+
### Bug Fixes
21+
22+
* **appsync:** lambda authorizer permission is not scoped to appsync api arn ([#31567](https://github.com/aws/aws-cdk/issues/31567)) ([c7cee15](https://github.com/aws/aws-cdk/commit/c7cee1525deb48d915740c9b30bdc6f886d17aa5)), closes [#31550](https://github.com/aws/aws-cdk/issues/31550) [/docs.aws.amazon.com/controltower/latest/controlreference/lambda-rules.html#ct-lambda-pr-2](https://github.com/aws//docs.aws.amazon.com/controltower/latest/controlreference/lambda-rules.html/issues/ct-lambda-pr-2)
23+
* **batch:** remove default optimal for arm based instance types and add error checks ([#31510](https://github.com/aws/aws-cdk/issues/31510)) ([7e80cc9](https://github.com/aws/aws-cdk/commit/7e80cc9665c0a1f7e82b124991d946a4234313c2)), closes [#31148](https://github.com/aws/aws-cdk/issues/31148)
24+
* **cdk:** `cdk diff --quiet` to print stack name when there is diffs ([#30186](https://github.com/aws/aws-cdk/issues/30186)) ([bcf9209](https://github.com/aws/aws-cdk/commit/bcf9209fb1b9e9aa295f50c5681201db094b8c00)), closes [#27128](https://github.com/aws/aws-cdk/issues/27128)
25+
* **cli:** deployment errors are printed 3 times ([#31389](https://github.com/aws/aws-cdk/issues/31389)) ([4b00ffe](https://github.com/aws/aws-cdk/commit/4b00ffeb86b3ebb9a0190c2842bd36ebb4043f52))
26+
* **core:** `isTaggable` function can return undefined instead of false ([#31600](https://github.com/aws/aws-cdk/issues/31600)) ([be70c82](https://github.com/aws/aws-cdk/commit/be70c822a1608cb43a4b4b17fc0430f3352797c6)), closes [#26495](https://github.com/aws/aws-cdk/issues/26495)
27+
* **core:** apps that use token-aware-stringify are construct-instantiation-order-dependent ([#31470](https://github.com/aws/aws-cdk/issues/31470)) ([4128bf1](https://github.com/aws/aws-cdk/commit/4128bf16b94c3fc9b654187abc8b52638d712999)), closes [#31345](https://github.com/aws/aws-cdk/issues/31345) [#31345](https://github.com/aws/aws-cdk/issues/31345)
28+
* **core:** file asset publishing role not used in `cdk diff` to upload large templates ([#31597](https://github.com/aws/aws-cdk/issues/31597)) ([be1207b](https://github.com/aws/aws-cdk/commit/be1207beedb01fc1cf773f13705ddae19c3209f0)), closes [#29936](https://github.com/aws/aws-cdk/issues/29936) [/github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml#L275](https://github.com/aws//github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml/issues/L275) [/github.com/aws/aws-cdk/blob/4b00ffeb86b3ebb9a0190c2842bd36ebb4043f52/packages/aws-cdk/lib/api/deployments.ts#L605](https://github.com/aws//github.com/aws/aws-cdk/blob/4b00ffeb86b3ebb9a0190c2842bd36ebb4043f52/packages/aws-cdk/lib/api/deployments.ts/issues/L605)
29+
* **core:** throw on intrinsics in CFN update and create policies ([#31578](https://github.com/aws/aws-cdk/issues/31578)) ([9410361](https://github.com/aws/aws-cdk/commit/941036100f1633a5693075ea07477122bab9cbb2)), closes [#27578](https://github.com/aws/aws-cdk/issues/27578) [#30740](https://github.com/aws/aws-cdk/issues/30740)
30+
* **lambda:** configuring log retention fails on 70+ Lambdas ([#31340](https://github.com/aws/aws-cdk/issues/31340)) ([a2d42d2](https://github.com/aws/aws-cdk/commit/a2d42d20ad4439ba294d1027152a16fb19786df3)), closes [#31338](https://github.com/aws/aws-cdk/issues/31338)
31+
* **lambda-nodejs:** remove smithy models from bundling for AWS SDK v3 runtimes (under feature flag) ([#31639](https://github.com/aws/aws-cdk/issues/31639)) ([19ee46d](https://github.com/aws/aws-cdk/commit/19ee46d7653894f0669aff3872c6c5314be0666c))
32+
* **pipelines:** "Node with duplicate id" on duplicate stack names ([#31328](https://github.com/aws/aws-cdk/issues/31328)) ([16b74f3](https://github.com/aws/aws-cdk/commit/16b74f337e351b177aaeed2d80c519ff264c3e11)), closes [#30960](https://github.com/aws/aws-cdk/issues/30960)
33+
* **rds:** fixed the IAM policy that grantConnect() generates for DatabaseInstanceReadReplica ([#31579](https://github.com/aws/aws-cdk/issues/31579)) ([52f676c](https://github.com/aws/aws-cdk/commit/52f676ca82a6078425020efcef73da8bd6afa261)), closes [#31061](https://github.com/aws/aws-cdk/issues/31061)
34+
* **stack:** check stack tags for deploy-time values ([#31457](https://github.com/aws/aws-cdk/issues/31457)) ([abd1768](https://github.com/aws/aws-cdk/commit/abd176866a3ab3ce14b20bd5773ab3b23b1b7677)), closes [#28017](https://github.com/aws/aws-cdk/issues/28017)
35+
* update L1 CloudFormation resource definitions by removing outdated schema overrides ([#31539](https://github.com/aws/aws-cdk/issues/31539)) ([218331b](https://github.com/aws/aws-cdk/commit/218331bd1f87897bf6cbd42a2059d570b59bfb3f))
36+
537
## [2.160.0](https://github.com/aws/aws-cdk/compare/v2.159.1...v2.160.0) (2024-09-24)
638

739

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,24 @@ grantAwesomePowerBeta1()
954954
When we decide it's time to graduate the API, the latest preview version will
955955
be deprecated and the final version - `grantAwesomePower` will be added.
956956

957+
### Adding new experimental CLI features
958+
959+
In order to move fast when developing new CLI features, we may decide to release
960+
functionality as "experimental" or "incremental." In this scenario we can utilize
961+
explicit opt-in via an `--unstable` flag.
962+
963+
Explicit opt-ins would look something like this:
964+
965+
```bash
966+
cdk new-command --unstable='new-command'
967+
968+
cdk bootstrap --unstable='new-funky-bootstrap'
969+
```
970+
971+
And can be simply added as an additional flag on the CLI command that is being worked on.
972+
When the time comes to stabilize the command, we remove the requirement that such a flag
973+
is set.
974+
957975
## Documentation
958976

959977
Every module's README is rendered as the landing page of the official documentation. For example, this is

CONTRIBUTORS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ Shout out to our top contributors!
1414
- [mrgrain](https://github.com/mrgrain)
1515
- [pahud](https://github.com/pahud)
1616
- [TheRealAmazonKendra](https://github.com/TheRealAmazonKendra)
17-
- [madeline-k](https://github.com/madeline-k)
1817
- [comcalvi](https://github.com/comcalvi)
18+
- [madeline-k](https://github.com/madeline-k)
1919
- [NetaNir](https://github.com/NetaNir)
2020
- [robertd](https://github.com/robertd)
21-
- [MrArnoldPalmer](https://github.com/MrArnoldPalmer)
2221
- [go-to-k](https://github.com/go-to-k)
22+
- [MrArnoldPalmer](https://github.com/MrArnoldPalmer)
2323
- [lpizzinidev](https://github.com/lpizzinidev)
2424
- [peterwoodworth](https://github.com/peterwoodworth)
25+
- [mazyu36](https://github.com/mazyu36)
2526
- [colifran](https://github.com/colifran)
27+
- [badmintoncryer](https://github.com/badmintoncryer)
2628
- [msambol](https://github.com/msambol)
27-
- [mazyu36](https://github.com/mazyu36)
2829
- [watany-dev](https://github.com/watany-dev)
29-
- [badmintoncryer](https://github.com/badmintoncryer)
3030

3131

32-
_Last updated: Sun, 01 Sep 24 00:12:30 +0000_
32+
_Last updated: Tue, 01 Oct 24 00:12:17 +0000_

packages/@aws-cdk-testing/cli-integ/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Test suites are written as a collection of Jest tests, and they are run using Je
3737

3838
### Setup
3939

40-
Building the @aws-cdk-testing package is not very different from building the rest of the CDK. However, If you are having issues with the tests, you can ensure your enviornment is built properly by following the steps below:
40+
Building the @aws-cdk-testing package is not very different from building the rest of the CDK. However, If you are having issues with the tests, you can ensure your environment is built properly by following the steps below:
4141

4242
```shell
4343
yarn install # Install dependencies

packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { shell, ShellOptions, ShellHelper, rimraf } from './shell';
1313
import { AwsContext, withAws } from './with-aws';
1414
import { withTimeout } from './with-timeout';
1515

16-
export const DEFAULT_TEST_TIMEOUT_S = 10 * 60;
16+
export const DEFAULT_TEST_TIMEOUT_S = 20 * 60;
1717
export const EXTENDED_TEST_TIMEOUT_S = 30 * 60;
1818

1919
/**
@@ -24,7 +24,8 @@ export const EXTENDED_TEST_TIMEOUT_S = 30 * 60;
2424
* For backwards compatibility with existing tests (so we don't have to change
2525
* too much) the inner block is expected to take a `TestFixture` object.
2626
*/
27-
export function withCdkApp(
27+
export function withSpecificCdkApp(
28+
appName: string,
2829
block: (context: TestFixture) => Promise<void>,
2930
): (context: TestContext & AwsContext & DisableBootstrapContext) => Promise<void> {
3031
return async (context: TestContext & AwsContext & DisableBootstrapContext) => {
@@ -36,7 +37,7 @@ export function withCdkApp(
3637
context.output.write(` Test directory: ${integTestDir}\n`);
3738
context.output.write(` Region: ${context.aws.region}\n`);
3839

39-
await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', 'app'), integTestDir, context.output);
40+
await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', appName), integTestDir, context.output);
4041
const fixture = new TestFixture(
4142
integTestDir,
4243
stackNamePrefix,
@@ -87,6 +88,16 @@ export function withCdkApp(
8788
};
8889
}
8990

91+
/**
92+
* Like `withSpecificCdkApp`, but uses the default integration testing app with a million stacks in it
93+
*/
94+
export function withCdkApp(
95+
block: (context: TestFixture) => Promise<void>,
96+
): (context: TestContext & AwsContext & DisableBootstrapContext) => Promise<void> {
97+
// 'app' is the name of the default integration app in the `cdk-apps` directory
98+
return withSpecificCdkApp('app', block);
99+
}
100+
90101
export function withCdkMigrateApp<A extends TestContext>(language: string, block: (context: TestFixture) => Promise<void>) {
91102
return async (context: A) => {
92103
const stackName = `cdk-migrate-${language}-integ-${context.randomString}`;
@@ -188,6 +199,10 @@ export function withDefaultFixture(block: (context: TestFixture) => Promise<void
188199
return withAws(withTimeout(DEFAULT_TEST_TIMEOUT_S, withCdkApp(block)));
189200
}
190201

202+
export function withSpecificFixture(appName: string, block: (context: TestFixture) => Promise<void>) {
203+
return withAws(withTimeout(DEFAULT_TEST_TIMEOUT_S, withSpecificCdkApp(appName, block)));
204+
}
205+
191206
export function withExtendedTimeoutFixture(block: (context: TestFixture) => Promise<void>) {
192207
return withAws(withTimeout(EXTENDED_TEST_TIMEOUT_S, withCdkApp(block)));
193208
}

packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class YourStack extends cdk.Stack {
7272
}
7373
}
7474

75+
class NoticesStack extends cdk.Stack {
76+
constructor(parent, id, props) {
77+
super(parent, id, props);
78+
new sqs.Queue(this, 'queue');
79+
}
80+
}
81+
7582
class SsoPermissionSetNoPolicy extends Stack {
7683
constructor(scope, id) {
7784
super(scope, id);
@@ -424,6 +431,20 @@ class LambdaStack extends cdk.Stack {
424431
}
425432
}
426433

434+
class IamRolesStack extends cdk.Stack {
435+
constructor(parent, id, props) {
436+
super(parent, id, props);
437+
438+
// Environment variabile is used to create a bunch of roles to test
439+
// that large diff templates are uploaded to S3 to create the changeset.
440+
for(let i = 1; i <= Number(process.env.NUMBER_OF_ROLES) ; i++) {
441+
new iam.Role(this, `Role${i}`, {
442+
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
443+
});
444+
}
445+
}
446+
}
447+
427448
class SessionTagsStack extends cdk.Stack {
428449
constructor(parent, id, props) {
429450
super(parent, id, {
@@ -753,6 +774,7 @@ switch (stackSet) {
753774
// Deploy all does a wildcard ${stackPrefix}-test-*
754775
new MyStack(app, `${stackPrefix}-test-1`, { env: defaultEnv });
755776
new YourStack(app, `${stackPrefix}-test-2`);
777+
new NoticesStack(app, `${stackPrefix}-notices`);
756778
// Deploy wildcard with parameters does ${stackPrefix}-param-test-*
757779
new ParameterStack(app, `${stackPrefix}-param-test-1`);
758780
new OtherParameterStack(app, `${stackPrefix}-param-test-2`);
@@ -770,6 +792,8 @@ switch (stackSet) {
770792

771793
new LambdaStack(app, `${stackPrefix}-lambda`);
772794

795+
new IamRolesStack(app, `${stackPrefix}-iam-roles`);
796+
773797
if (process.env.ENABLE_VPC_TESTING == 'IMPORT') {
774798
// this stack performs a VPC lookup so we gate synth
775799
const env = { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION };

0 commit comments

Comments
 (0)