diff --git a/.github/workflows/github-merit-badger.yml b/.github/workflows/github-merit-badger.yml index 3e8e0bc33dbb5..55bf1061c8091 100644 --- a/.github/workflows/github-merit-badger.yml +++ b/.github/workflows/github-merit-badger.yml @@ -17,4 +17,4 @@ jobs: badges: '[beginning-contributor,repeat-contributor,valued-contributor,admired-contributor,star-contributor,distinguished-contributor]' thresholds: '[0,3,6,13,25,50]' badge-type: 'achievement' - ignore-usernames: '[RomainMuller,rix0rrr,Jerry-AWS,MrArnoldPalmer,iliapolo,otaviomacedo,madeline-k,kaizencc,comcalvi,corymhall,peterwoodworth,ryparker,TheRealAmazonKendra,vinayak-kukreja,Naumel,mrgrain,pahud,cgarvis,kellertk,HBobertz,aws-cdk-automation,dependabot[bot],mergify[bot]]' + ignore-usernames: '[RomainMuller,rix0rrr,MrArnoldPalmer,iliapolo,otaviomacedo,madeline-k,kaizencc,comcalvi,corymhall,peterwoodworth,ryparker,TheRealAmazonKendra,vinayak-kukreja,Naumel,mrgrain,pahud,cgarvis,kellertk,HBobertz,sumupitchayan,pattasai,SankyRed,udaypant,aws-cdk-automation,dependabot[bot],mergify[bot]]' diff --git a/.mergify.yml b/.mergify.yml index 507e533327f6b..ffd1505e05fcf 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -10,7 +10,7 @@ pull_request_rules: label: add: [ contribution/core ] conditions: - - author~=^(RomainMuller|rix0rrr|Jerry-AWS|MrArnoldPalmer|iliapolo|uttarasridhar|otaviomacedo|madeline-k|kaizencc|comcalvi|corymhall|peterwoodworth|ryparker|TheRealAmazonKendra|yuth|vinayak-kukreja|Naumel|mrgrain|pahud|cgarvis|kellertk|HBobertz)$ + - author~=^(RomainMuller|rix0rrr|MrArnoldPalmer|iliapolo|uttarasridhar|otaviomacedo|madeline-k|kaizencc|comcalvi|corymhall|peterwoodworth|ryparker|TheRealAmazonKendra|vinayak-kukreja|Naumel|mrgrain|pahud|cgarvis|kellertk|HBobertz|sumupitchayan|pattasai|SankyRed|udaypant)$ - -label~="contribution/core" - name: automatic merge actions: diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index d4bb0f0503d9e..363c8590f51b7 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,43 @@ 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. +## [2.62.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.62.0-alpha.0...v2.62.1-alpha.0) (2023-01-26) + +## [2.62.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.61.1-alpha.0...v2.62.0-alpha.0) (2023-01-25) + + +### Features + +* **apprunner:** apprunner secrets manager ([#23692](https://github.com/aws/aws-cdk/issues/23692)) ([a914fc0](https://github.com/aws/aws-cdk/commit/a914fc0614cd9aa634c5724c3474c99fd3888d98)) + + +### Bug Fixes + +* **integ-runner:** cleanup tmp snapshot before running test ([#23773](https://github.com/aws/aws-cdk/issues/23773)) ([366f2ab](https://github.com/aws/aws-cdk/commit/366f2ab6fbedaf33630a40d5306746c6d363f05c)) + +## [2.61.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.61.0-alpha.0...v2.61.1-alpha.0) (2023-01-20) + +## [2.61.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.60.0-alpha.0...v2.61.0-alpha.0) (2023-01-18) + + +### Features + +* **cli-lib:** [JS/TS only] experimental support for programmatic CLI api ([#22836](https://github.com/aws/aws-cdk/issues/22836)) ([0b6b716](https://github.com/aws/aws-cdk/commit/0b6b7166c3f0348cc33fd3a0d19637351ea3b05b)) + + +### Bug Fixes + +* **glue:** --conf parameter is no longer a reserved keyword for glue jobs ([#23673](https://github.com/aws/aws-cdk/issues/23673)) ([3d0f4ba](https://github.com/aws/aws-cdk/commit/3d0f4ba6dd92ad7b91b00fad6cbab873964683fc)) +* **servicecatalogappregistry:** outputs are not deployable ([#23652](https://github.com/aws/aws-cdk/issues/23652)) ([fa9eef0](https://github.com/aws/aws-cdk/commit/fa9eef081ead451a4d38bf083eda02af09fff482)), closes [#23641](https://github.com/aws/aws-cdk/issues/23641) + +## [2.60.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.59.0-alpha.0...v2.60.0-alpha.0) (2023-01-11) + + +### Features + +* **gamelift:** add MatchmakingConfiguration L2 Construct for GameLift ([#23326](https://github.com/aws/aws-cdk/issues/23326)) ([9b2573b](https://github.com/aws/aws-cdk/commit/9b2573b32e8535d3db21f07647f099c9e01eb292)) +* **integ-runner:** support `--language` presets for JavaScript, TypeScript, Python and Go ([#22058](https://github.com/aws/aws-cdk/issues/22058)) ([22673b2](https://github.com/aws/aws-cdk/commit/22673b2ea40c13b6c10a2c7c628ce5cc534f5840)), closes [#21169](https://github.com/aws/aws-cdk/issues/21169) + ## [2.59.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.58.1-alpha.0...v2.59.0-alpha.0) (2023-01-03) ## [2.58.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.58.0-alpha.0...v2.58.1-alpha.0) (2022-12-30) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 6748407a0c2f4..aa071b7cf9cc5 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,92 @@ 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. +## [2.62.1](https://github.com/aws/aws-cdk/compare/v2.62.0...v2.62.1) (2023-01-26) + + +### Bug Fixes + +* `aws-cdk-lib` imports from ESM modules are broken ([#23846](https://github.com/aws/aws-cdk/issues/23846)) ([46b93a9](https://github.com/aws/aws-cdk/commit/46b93a913743ab5791b9ae722293dfbeb9692eef)), closes [#23813](https://github.com/aws/aws-cdk/issues/23813) + +## [2.62.0](https://github.com/aws/aws-cdk/compare/v2.61.1...v2.62.0) (2023-01-25) + + +### Features + +* **certificatemanager:** deprecate DnsValidatedCertificate ([#21982](https://github.com/aws/aws-cdk/issues/21982)) ([64bfbf9](https://github.com/aws/aws-cdk/commit/64bfbf9b981a32a4db1b07476144d280d6eced32)), closes [#8934](https://github.com/aws/aws-cdk/issues/8934) [#2914](https://github.com/aws/aws-cdk/issues/2914) [#20698](https://github.com/aws/aws-cdk/issues/20698) [#17349](https://github.com/aws/aws-cdk/issues/17349) [#15217](https://github.com/aws/aws-cdk/issues/15217) [#14519](https://github.com/aws/aws-cdk/issues/14519) +* **cfnspec:** cloudformation spec v107.0.0 ([#23750](https://github.com/aws/aws-cdk/issues/23750)) ([3dc40b4](https://github.com/aws/aws-cdk/commit/3dc40b4c9b660a8d50bc07646fa63ecbee6df958)) +* **cfnspec:** cloudformation spec v108.0.0 ([#23769](https://github.com/aws/aws-cdk/issues/23769)) ([ff0070d](https://github.com/aws/aws-cdk/commit/ff0070d61f18a6cdd77b027a7f6cd2baf976c3c9)) +* **cfnspec:** cloudformation spec v108.0.0 ([#23808](https://github.com/aws/aws-cdk/issues/23808)) ([858ff23](https://github.com/aws/aws-cdk/commit/858ff2363e110b355c2e9823664d087af991bb55)) +* **lambda-event-sources:** events source mapping support for sqs max concurrency ([#23714](https://github.com/aws/aws-cdk/issues/23714)) ([6dcec2d](https://github.com/aws/aws-cdk/commit/6dcec2d00363a286906dab19647816ddfd58f33a)) +* **logs:** add grantRead function to LogGroup ([#23280](https://github.com/aws/aws-cdk/issues/23280)) ([42ef507](https://github.com/aws/aws-cdk/commit/42ef50706f60a7f452698166fa2d9c93ca54bc0d)) + + +### Bug Fixes + +* **appsync:** Populate construct name dynamically for lambda authorizer permission in appsync ([#23777](https://github.com/aws/aws-cdk/issues/23777)) ([92f02e9](https://github.com/aws/aws-cdk/commit/92f02e92905252ee7e4fff32751e76da5052b14b)) +* importing `aws-cdk-lib` is slow ([#23813](https://github.com/aws/aws-cdk/issues/23813)) ([8aaeffb](https://github.com/aws/aws-cdk/commit/8aaeffbbb86e8a80cb87fa3314880bd7c2a893be)) +* **bootstrap:** bootstrap stack version was not bumped during previous update ([#23669](https://github.com/aws/aws-cdk/issues/23669)) ([f56cb70](https://github.com/aws/aws-cdk/commit/f56cb7004cc4f1017ded4b6a0593a744e8f6271e)) +* **cfnspec:** incorrectly handling array result from jsondiff ([#23795](https://github.com/aws/aws-cdk/issues/23795)) ([4a701f1](https://github.com/aws/aws-cdk/commit/4a701f1668177a509f1e2f7f3c5d2249070ec666)), closes [/github.com/andreyvit/json-diff/blob/35582a9d19f8b0b2773360d67937e57ce2866781/test/diff_test.coffee#L78](https://github.com/aws//github.com/andreyvit/json-diff/blob/35582a9d19f8b0b2773360d67937e57ce2866781/test/diff_test.coffee/issues/L78) +* **cli:** only load sourcemap when `--debug` flag is enabled ([#23752](https://github.com/aws/aws-cdk/issues/23752)) ([94102c1](https://github.com/aws/aws-cdk/commit/94102c1210a4d7906a03c81a1845466c988c06e7)) +* **codeguruprofiler:** imported profiling group environment configured with stack region ([#23568](https://github.com/aws/aws-cdk/issues/23568)) ([8bfa695](https://github.com/aws/aws-cdk/commit/8bfa695881f6b78a052ca5276a63d78c1a8c0dda)) +* **lambda:** lambda functions that use triggers error when invoked ([#23728](https://github.com/aws/aws-cdk/issues/23728)) ([37974ed](https://github.com/aws/aws-cdk/commit/37974ed91fda77a31aa99da75c1d7fb301135a5f)), closes [#23062](https://github.com/aws/aws-cdk/issues/23062) [#23062](https://github.com/aws/aws-cdk/issues/23062) [#23407](https://github.com/aws/aws-cdk/issues/23407) [#23407](https://github.com/aws/aws-cdk/issues/23407) +* **lambda-nodejs:** aws-sdk version detection broken for self-defined runtimes ([#23416](https://github.com/aws/aws-cdk/issues/23416)) ([8a7dffd](https://github.com/aws/aws-cdk/commit/8a7dffdd056ad6e4e1609deb43ba790a020b4997)), closes [#22989](https://github.com/aws/aws-cdk/issues/22989) [/github.com/aws/aws-cdk/pull/22989/files#diff-cd86fbd4f2bbefcbcffc2143adccabafa1debe5981edbcdfcc766b5a705fe770R371-R383](https://github.com/aws//github.com/aws/aws-cdk/pull/22989/files/issues/diff-cd86fbd4f2bbefcbcffc2143adccabafa1debe5981edbcdfcc766b5a705fe770R371-R383) + +## [2.61.1](https://github.com/aws/aws-cdk/compare/v2.61.0...v2.61.1) (2023-01-20) + + +### Bug Fixes + +* **lambda:** lambda functions that use triggers error when invoked ([#23728](https://github.com/aws/aws-cdk/issues/23728)) ([5fd9135](https://github.com/aws/aws-cdk/commit/5fd91352e4b625e003ee359563850852a50112ec)), closes [#23062](https://github.com/aws/aws-cdk/issues/23062) [#23062](https://github.com/aws/aws-cdk/issues/23062) [#23407](https://github.com/aws/aws-cdk/issues/23407) [#23407](https://github.com/aws/aws-cdk/issues/23407) + +## [2.61.0](https://github.com/aws/aws-cdk/compare/v2.60.0...v2.61.0) (2023-01-18) + + +### Features + +* **cfnspec:** cloudformation spec v107.0.0 ([#23698](https://github.com/aws/aws-cdk/issues/23698)) ([aca8a25](https://github.com/aws/aws-cdk/commit/aca8a256dcaf89b53f7af4f308b2f23e2e766902)) +* **core:** stack synthesizers can be shared between stacks ([#23571](https://github.com/aws/aws-cdk/issues/23571)) ([0ce19f0](https://github.com/aws/aws-cdk/commit/0ce19f0e1217a4a41a3a9c27049ab73c7fbc320d)) +* **logs:** add unit to metric filter ([#23608](https://github.com/aws/aws-cdk/issues/23608)) ([7cbe8ac](https://github.com/aws/aws-cdk/commit/7cbe8ac9286e5f7c3efb7f75aa859bf6b3bffecf)) +* **opensearch:** add support for latest amazon opensearch service 2.3 ([#22943](https://github.com/aws/aws-cdk/issues/22943)) ([0303d6f](https://github.com/aws/aws-cdk/commit/0303d6f7a71d2c70443df4433f0ff7554bcc4e56)) +* **pipeline:** enable key rotation ([#23620](https://github.com/aws/aws-cdk/issues/23620)) ([29d7336](https://github.com/aws/aws-cdk/commit/29d733677c4962199a848933a7415b47abb23a2f)) +* **route53-patterns:** use `Certificate` as the default certificate (under feature flag) ([#23575](https://github.com/aws/aws-cdk/issues/23575)) ([77709c8](https://github.com/aws/aws-cdk/commit/77709c8328fe664c1fca50223c8e64325cb70461)) + + +### Bug Fixes + +* **aws-s3:** log delivery may be incorrectly configured when target bucket is imported ([#23552](https://github.com/aws/aws-cdk/issues/23552)) ([41327d8](https://github.com/aws/aws-cdk/commit/41327d8e815b80c9148bd33751fdf1b70c3bc9cd)), closes [#23547](https://github.com/aws/aws-cdk/issues/23547) [#23588](https://github.com/aws/aws-cdk/issues/23588) +* **cdk-assets:** concurrent asset builds can leave a corrupted archive ([#23677](https://github.com/aws/aws-cdk/issues/23677)) ([18e0481](https://github.com/aws/aws-cdk/commit/18e0481a3bbcb92bd22ce4e83d4f02e03e484307)), closes [#23290](https://github.com/aws/aws-cdk/issues/23290) +* **cli:** can not assume role from 2-level SSO ([#23702](https://github.com/aws/aws-cdk/issues/23702)) ([c3a345b](https://github.com/aws/aws-cdk/commit/c3a345be0eeb26e1b410d68643740f0aea8af4d7)), closes [#23520](https://github.com/aws/aws-cdk/issues/23520) +* **cloudtrail:** Trail fails during resource creation due to invalid template properties when management events are 'None' ([#23569](https://github.com/aws/aws-cdk/issues/23569)) ([15ced88](https://github.com/aws/aws-cdk/commit/15ced888718531ddc59402f0c886c9b4f1fea67b)), closes [#16387](https://github.com/aws/aws-cdk/issues/16387) [#15488](https://github.com/aws/aws-cdk/issues/15488) +* **lambda:** ever-changing Version hash with LayerVersion from tokens ([#23629](https://github.com/aws/aws-cdk/issues/23629)) ([88fc62d](https://github.com/aws/aws-cdk/commit/88fc62d215d8c4aa3a4c423a06571ec45b51cec6)) +* **pipelines:** cross-stack step dependencies have wrong name ([#23594](https://github.com/aws/aws-cdk/issues/23594)) ([0d8142b](https://github.com/aws/aws-cdk/commit/0d8142bf6860cbebab9c1704f6ebf59b17a5704f)), closes [#21843](https://github.com/aws/aws-cdk/issues/21843) +* **servicecatalog:** incorrect objectkey produced from asset relative… ([#23580](https://github.com/aws/aws-cdk/issues/23580)) ([b4a6120](https://github.com/aws/aws-cdk/commit/b4a6120af01b46bc688eebb8f8bb6fbde7f481fe)), closes [#23560](https://github.com/aws/aws-cdk/issues/23560) +* **stepfunctions-tasks:** fix IAM policy statements for step functions API calls ([#22959](https://github.com/aws/aws-cdk/issues/22959)) ([dce662c](https://github.com/aws/aws-cdk/commit/dce662cae6eb493770d3c6f700c92a0b6c235195)) + +## [2.60.0](https://github.com/aws/aws-cdk/compare/v2.59.0...v2.60.0) (2023-01-11) + + +### Features + +* **appsync:** js resolver support ([#23551](https://github.com/aws/aws-cdk/issues/23551)) ([2318384](https://github.com/aws/aws-cdk/commit/231838409cc1409c137ff27086e853ce2b0fbf1c)), closes [#22921](https://github.com/aws/aws-cdk/issues/22921) +* **appsync:** stabilize appsync module πŸŽ†πŸŽ† πŸŽ† ([#23633](https://github.com/aws/aws-cdk/issues/23633)) ([e5b0230](https://github.com/aws/aws-cdk/commit/e5b023089e168c50eda83a11db0e697b96caf7e9)), closes [#6836](https://github.com/aws/aws-cdk/issues/6836) +* **cfnspec:** cloudformation spec v106.0.0 ([#23586](https://github.com/aws/aws-cdk/issues/23586)) ([f178c98](https://github.com/aws/aws-cdk/commit/f178c98d4473d8bb8d46d80c076fa520d03c623b)) +* **cloudfront:** remove headers and server timing ([#23558](https://github.com/aws/aws-cdk/issues/23558)) ([44a4812](https://github.com/aws/aws-cdk/commit/44a4812778d87af27809e5a733c6e5ea6b65004b)) +* **cognito:** use secretsmanager secrets for clientSecretValue ([#22885](https://github.com/aws/aws-cdk/issues/22885)) ([4baea78](https://github.com/aws/aws-cdk/commit/4baea78f415566dea499f4ce49fc24d4dc7c4ef7)) +* **ec2:** subnet ipv4 cidr blocks on imported vpc ([#23317](https://github.com/aws/aws-cdk/issues/23317)) ([e0885db](https://github.com/aws/aws-cdk/commit/e0885db29c8b45cfe9da1df8b55af2bf78892a04)) +* **ecr-assets:** Support docker outputs flag ([#23304](https://github.com/aws/aws-cdk/issues/23304)) ([61e5495](https://github.com/aws/aws-cdk/commit/61e5495105e06aba4c027fb33ae031da09a3ff33)), closes [#20566](https://github.com/aws/aws-cdk/issues/20566) +* **pipelines:** Expose stack output namespaces in custom `pipelines.Step`s ([#23110](https://github.com/aws/aws-cdk/issues/23110)) ([14f6811](https://github.com/aws/aws-cdk/commit/14f6811b89a0ae374863a3b2bdd36997ce67883e)), closes [/github.com/aws/aws-cdk/issues/23000#issuecomment-1324379670](https://github.com/aws//github.com/aws/aws-cdk/issues/23000/issues/issuecomment-1324379670) + + +### Bug Fixes + +* **acm:** domainName length constraint failure due to Tokens ([#23567](https://github.com/aws/aws-cdk/issues/23567)) ([2d7e3c0](https://github.com/aws/aws-cdk/commit/2d7e3c0e9edfb8f3e30dc0c1efaeb03fde19db7c)), closes [#23565](https://github.com/aws/aws-cdk/issues/23565) +* **aws-custom-resource:** switch off `installLatestAwsSdk` by default ([#23591](https://github.com/aws/aws-cdk/issues/23591)) ([c9b2548](https://github.com/aws/aws-cdk/commit/c9b2548126f01fd918009df0a42f0ab4c5e69cc3)), closes [#23113](https://github.com/aws/aws-cdk/issues/23113) +* **bootstrap:** KMS keys cannot be tagged ([#21975](https://github.com/aws/aws-cdk/issues/21975)) ([0e552db](https://github.com/aws/aws-cdk/commit/0e552dbb63a97cd6a7a65cae80ae863609237e61)), closes [#21281](https://github.com/aws/aws-cdk/issues/21281) +* **events:** cross stack rules require concrete environment ([#23549](https://github.com/aws/aws-cdk/issues/23549)) ([22d3341](https://github.com/aws/aws-cdk/commit/22d3341c2239b046473ded3fcbc85b5cbc4a37a1)), closes [#18405](https://github.com/aws/aws-cdk/issues/18405) +* **iam:** create stack based default policies for roles ([#23100](https://github.com/aws/aws-cdk/issues/23100)) ([dea4216](https://github.com/aws/aws-cdk/commit/dea4216a3f2e6727a6bc49d632c03b3f0a416947)) +* **lambda:** automatic `currentVersion` conflicts with explicit `Version` resource ([#23636](https://github.com/aws/aws-cdk/issues/23636)) ([de68652](https://github.com/aws/aws-cdk/commit/de6865229ee824c01431ae27509dbcd3e1a83763)), closes [#23225](https://github.com/aws/aws-cdk/issues/23225) + ## [2.59.0](https://github.com/aws/aws-cdk/compare/v2.58.1...v2.59.0) (2023-01-03) diff --git a/allowed-breaking-changes.txt b/allowed-breaking-changes.txt index 76a89b1620bad..3f04f7930ffb3 100644 --- a/allowed-breaking-changes.txt +++ b/allowed-breaking-changes.txt @@ -153,4 +153,9 @@ removed:aws-cdk-lib.aws_ec2.InstanceClass.COMPUTE6_GRAVITON2_HIGH_NETWORK_BANDWI # added new required property StackOutputsMap strengthened:@aws-cdk/pipelines.ProduceActionOptions -strengthened:aws-cdk-lib.pipelines.ProduceActionOptions \ No newline at end of file +strengthened:aws-cdk-lib.pipelines.ProduceActionOptions + +# reverted a change that broke deployments for anyone using Triggers +removed:aws-cdk-lib.triggers.InvocationType +removed:aws-cdk-lib.triggers.TriggerProps.invocationType +removed:aws-cdk-lib.triggers.TriggerProps.timeout \ No newline at end of file diff --git a/lerna.json b/lerna.json index 0867af78081e7..fca71760dbe9a 100644 --- a/lerna.json +++ b/lerna.json @@ -6,6 +6,7 @@ "packages/*", "packages/@aws-cdk/*", "packages/@aws-cdk-containers/*", + "packages/@aws-cdk-testing/*", "packages/@aws-cdk/*/lambda-packages/*", "tools/*", "tools/@aws-cdk/*", diff --git a/package.json b/package.json index 7e4c19662c7b4..712c4819e653c 100644 --- a/package.json +++ b/package.json @@ -18,15 +18,15 @@ "devDependencies": { "@types/prettier": "2.6.0", "@yarnpkg/lockfile": "^1.1.0", - "cdk-generate-synthetic-examples": "^0.1.112", + "cdk-generate-synthetic-examples": "^0.1.119", "conventional-changelog-cli": "^2.2.2", "fs-extra": "^9.1.0", "graceful-fs": "^4.2.10", "jest-junit": "^13.2.0", - "jsii-diff": "1.72.0", - "jsii-pacmak": "1.72.0", - "jsii-reflect": "1.72.0", - "jsii-rosetta": "1.72.0", + "jsii-diff": "1.73.0", + "jsii-pacmak": "1.73.0", + "jsii-reflect": "1.73.0", + "jsii-rosetta": "1.73.0", "lerna": "^4.0.0", "patch-package": "^6.5.1", "semver": "^6.3.0", @@ -68,6 +68,7 @@ "packages/*", "packages/@aws-cdk/*", "packages/@aws-cdk-containers/*", + "packages/@aws-cdk-testing/*", "packages/@aws-cdk/*/lambda-packages/*", "tools/*", "tools/@aws-cdk/*", diff --git a/packages/@aws-cdk-testing/cli-integ/.eslintrc.js b/packages/@aws-cdk-testing/cli-integ/.eslintrc.js new file mode 100644 index 0000000000000..77f8007f9fc90 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/.eslintrc.js @@ -0,0 +1,4 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); +baseConfig.ignorePatterns.push('resources/**/*'); +baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; +module.exports = baseConfig; diff --git a/packages/@aws-cdk-testing/cli-integ/.gitignore b/packages/@aws-cdk-testing/cli-integ/.gitignore new file mode 100644 index 0000000000000..eb8b474f4ca2a --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/.gitignore @@ -0,0 +1,20 @@ +*.js +*.js.map +*.d.ts +!resources/**/* +node_modules +dist + +.LAST_BUILD +.nyc_output +coverage +nyc.config.js +.LAST_PACKAGE +*.snk + +!.eslintrc.js +!jest.config.js + +.DS_Store + +junit.xml diff --git a/packages/@aws-cdk-testing/cli-integ/.npmignore b/packages/@aws-cdk-testing/cli-integ/.npmignore new file mode 100644 index 0000000000000..b2a3ba40d9011 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/.npmignore @@ -0,0 +1,32 @@ +# Don't include original .ts files when doing `npm pack` +*.ts +!*.d.ts +coverage +.nyc_output +*.tgz + +dist +.LAST_PACKAGE +.LAST_BUILD +*.snk + +!test/integ/run-wrappers/dist + +*.tsbuildinfo + +jest.config.js +tsconfig.json +.eslintrc.js + +!test/integ/cli/jest.config.js +!test/integ/uberpackage/jest.config.js +!resources/ +!resources/**/* + +.DS_Store + +junit.xml + +# exclude cdk artifacts +**/cdk.out +test/ diff --git a/packages/@aws-cdk-testing/cli-integ/LICENSE b/packages/@aws-cdk-testing/cli-integ/LICENSE new file mode 100644 index 0000000000000..9b722c65c5481 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@aws-cdk-testing/cli-integ/NOTICE b/packages/@aws-cdk-testing/cli-integ/NOTICE new file mode 100644 index 0000000000000..0dd703eaedb4a --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/NOTICE @@ -0,0 +1,16 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Third party attributions of this package can be found in the THIRD_PARTY_LICENSES file diff --git a/packages/@aws-cdk-testing/cli-integ/README.md b/packages/@aws-cdk-testing/cli-integ/README.md new file mode 100644 index 0000000000000..deafd6a5a8841 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/README.md @@ -0,0 +1,151 @@ +# CDK CLI integration test + + +--- + +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. +> They are subject to non-backward compatible changes or removal in any future version. These are +> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be +> announced in the release notes. This means that while you may use them, you may need to update +> your source code when upgrading to a newer version of this package. + +--- + + + +This package contains CDK CLI integration test suites, as well as helper tools necessary to run those suites against various different distributions of the CDK (in the source repository, against a build directory, or against published releases). + +> The tools and tests themselves should arguably be in different packages, but I want to prevent package proliferation. For now we'll keep them together. + +## Tests + +The tests themselves are in the `tests/` directory: + +```text +tests/ +β”œβ”€β”€ cli-integ-tests +β”œβ”€β”€ init-csharp +β”œβ”€β”€ init-fsharp +β”œβ”€β”€ init-java +β”œβ”€β”€ init-javascript +β”œβ”€β”€ init-python +β”œβ”€β”€ init-typescript-app +β”œβ”€β”€ init-typescript-lib +└── uberpackage +``` + +Each subdirectory contains one test **suite**, and in the development pipeline each suite is run individually in a CodeBuild job, all in parallel. This requires manual configuration in the pipeline: to add a new suite, first add a suite here, then add the suite to the pipeline as well. The safest strategy is to add a trivially succeeding suite first (for example, a single test with `expect(true).toBeTruthy()`), add it to the pipeline, and then write the actual tests. + +Test suites are written as a collection of Jest tests, and they are run using Jest, using the code in the `lib/` directory as helpers. + +### Running a test suite + +You run a suite using the `bin/run-suite` tool. You must select either a version of the CLI and framework which can be `npm install`ed, or point to the root of the source tree: + +```shell +# Use the given source tree +$ bin/run-suite --use-source=/path/to/repo-root + +# Automatically determine the source tree root +$ bin/run-suite -a + +# Run against a released version +$ bin/run-suite --use-cli-release=2.34.5 +``` + +To run a specific test, add `-t` and a substring of the test name. For example: + +```shell +bin/run-suite -a cli-integ-tests -t 'load old assemblies' +``` + +## Tools + +There are a number of tools in the `bin/` directory. They are: + +```text +bin/ +β”œβ”€β”€ apply-patches +β”œβ”€β”€ query-github +β”œβ”€β”€ run-suite +β”œβ”€β”€ stage-distribution +└── test-root +``` + +* `apply-patches`: used for regression testing. Applies patches to historical versions of the tests to fix false positive test failures. +* `query-github`: used for regression testing. Queries GitHub for previously released versions. +* `run-suite`: run one of the test suites in the `tests/` directory. +* `stage-distribution`: used for testing in the pipeline. Uploads candidate release binaries to CodeArtifact so that they can be installed using `npm install`, `pip install`, etc. +* `test-root`: return the directory containing all tests (used for applying patches). + +## Regression testing + +The regression testing mechanism is somewhat involved and therefore deserves its own section. The principle is not too hard to explain though: + +*We run the previous version of the CLI integ tests against the new candidate release of the CLI, to make sure we didn't accidentally introduce any breaking behavior*. + +This is slightly complicated by two facts: + +* (1) Both the CLI and the framework may have changed, and an incompatibility may have arisen between the framework and CLI. Newer CLIs must always support older framework versions. We therefore run two flavors of the integration tests: + * Old tests, new CLI, new framework + * Old tests, new CLI, old framework + +The testing matrix looks like this: + +```text + OLD TESTS NEW TESTS + + CLI CLI + Old New Old New + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β” + F'WORK β”‚ prev β”‚ β”‚ F'WORK β”‚ β”‚ β”‚ + Old β”‚ rls β”‚ regr β”‚ Old β”‚ (N/A) β”‚ ? β”‚ + β”‚ integ β”‚ β”‚ β”‚ β”‚ β”‚ + β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€ + β”‚ β”‚ β”‚ β”‚ β”‚ cur β”‚ + New β”‚ (N/A) β”‚ regr β”‚ New β”‚ (N/A) β”‚ rls β”‚ + β”‚ β”‚ β”‚ β”‚ β”‚ integ β”‚ + β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +We are covering everything except "new tests, new CLI, old framework", which is not clear that it even makes sense to test because some new features may rely on framework support which will not be in the old version yet. + +* (2) Sometimes, old tests will fail on newer releases when we introduce breaking changes to the framework or CLI for something serious (such as security reasons), or maybe because we had a bug in an old version that happened to pass, but now the test needs to be updated in order to pass a bugfix. + +For this case we have a patching mechanism, so that in a NEW release of the tools, we include files that are copied over an OLD release of the test, that allows them to pass. For the simplest case there is a mechanism to suppress the run of a single test, so that we can skip the running of one test for one release. For more complicated cases we copy in patched `.js` source files which will replace old source files. (Patches are considered part of the *tools*, not part of the *tests*). + +### Mechanism + +To run the tests in a regressory fashion, do the following: + +* Download the current `@aws-cdk-testing/cli-integ` artifact at `V1`. +* Determine the previous version `V0` (use `query-github` for this). +* Download the previous `@aws-cdk-testing/cli-integ` artifact at `V0`. +* From the `V1` artifact, apply the `V0` patch set. +* Run the `V0` tests with the `--framework-version` option: + +```shell +# Old tests, new CLI, new framework +V0/bin/run-suite --use-cli-release=V1 --framework-version=V1 [...] + +# Old tests, new CLI, old framework +V0/bin/run-suite --use-cli-release=V1 --framework-version=V0 [...] +``` + +### Patching + +To patch a previous set of tests to make them pass with a new release, add a directory to `resources/cli-regression-patches`. The simplest method is to add a `skip-tests.txt` file: + +```shell +# The version of the tests that are currently failing (V0 in the paragraph above) +export VERSION=X.Y.Z + +mkdir -p resources/cli-regression-patches/v${VERSION} +cp skip-tests.txt resources/cli-regression-patches/v${VERSION}/ +``` + +Now edit `resources/cli-regression-patches/vX.Y.Z/skip-tests.txt` and put the name of the test you want to skip on a line by itself. + +If you need to replace source files, it's probably best to stick compiled `.js` files in here. `.ts` source files wouldn't compile because they'd be missing `imports`. diff --git a/packages/@aws-cdk-testing/cli-integ/bin/apply-patches b/packages/@aws-cdk-testing/cli-integ/bin/apply-patches new file mode 100755 index 0000000000000..b27d0c93dc9e7 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/apply-patches @@ -0,0 +1,19 @@ +#!/bin/bash +# Written in bash just because that's easier with all the file manipulation +set -eu +scriptdir=$(cd $(dirname $0) && pwd) +version="$1" +target_dir="$2" + + +if [[ ! -f "$2/skip-tests.txt" ]]; then + echo "$2: does not look like a test root directory." >&2 + exit 1 +fi + + +candidate_dir="${scriptdir}/../resources/cli-regression-patches/v${version}" + +if [[ -f "$candidate_dir" ]]; then + cp -R "${candidate_dir}/"* "$2" +fi \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/bin/download-and-run-old-tests b/packages/@aws-cdk-testing/cli-integ/bin/download-and-run-old-tests new file mode 100755 index 0000000000000..ad72ce50c0991 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/download-and-run-old-tests @@ -0,0 +1,52 @@ +#!/bin/bash +set -eu +# Download old tests and run them. Written in bash, just because. Needs to do contortions, see below. +# +# Usage: +# +# download-and-run-old-tests [...args to run-suite...] +set -x + +scriptdir=$(cd $(dirname $0) && pwd) + +version="$1" +target_directory="old_tests" +shift + +rm -rf $target_directory && mkdir $target_directory + +# The old tests package MUST be 'npm install 'ed as a dependency, but MUST NOT +# end up in a `node_modules` directory. +# +# - MUST be 'npm install'ed: we need transitive dependencies as well. +# - as a dependency: if we check out the source and do an `npm install --production` in the +# package.json directory, NPM will still try to resolve devDependencies (even though it doesn't +# need to install them), and the devDeps do not exist on npmjs. +# - MUST NOT end up in `node_modules`: Jest 27 will ignore all tests that have `node_modules` in +# the path, and this behavior is not configurable before Jest 28. Unfortunately, because of TypeScript +# typing issues, we cannot move past Jest 27. +# +# To achieve this, do an `npm install ` then follow up with an `mv` to move the files out. +if ! npm install --prefix $target_directory --no-save @aws-cdk-testing/cli-integ@$version > npm.log 2>&1; then + cat npm.log >&2 + # Catch a "package does not exist" error, have to do it this way because for some reason, + # 'npm view ' doesn't exit with an error... :s + if grep -q 'code ETARGET' npm.log; then + echo "During migration, @aws-cdk-testing/cli-integ@$version does not exist yet." >&2 + + + # Do create an empty junit.xml file -- if we don't, then the "upload report" phase will fail + # if there are 0 files to upload. + echo '' > junit.xml + exit 0 + fi + exit 1 +fi + +mv $($target_directory/node_modules/.bin/test-root)/* $target_directory + +# Apply new patches to old tests +${scriptdir}/apply-patches $version $target_directory + +# Run the suite from the old tests +exec $target_directory/bin/run-suite "$@" \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/bin/query-github b/packages/@aws-cdk-testing/cli-integ/bin/query-github new file mode 100755 index 0000000000000..fbb9b1fa5f199 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/query-github @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./query-github.js'); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/query-github.ts b/packages/@aws-cdk-testing/cli-integ/bin/query-github.ts new file mode 100644 index 0000000000000..33da60c57f618 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/query-github.ts @@ -0,0 +1,58 @@ +// eslint-disable-next-line jest/no-jest-import +import * as yargs from 'yargs'; +import { fetchPreviousVersion } from '../lib/github'; + +async function main() { + const args = await yargs + .option('token', { + descripton: 'GitHub token (default: from environment GITHUB_TOKEN)', + alias: 't', + type: 'string', + requiresArg: true, + }) + .command('last-release', 'Query the last release', cmd => cmd + .option('prior-to', { + description: 'Return the most recent release before the given version', + alias: 'p', + type: 'string', + requiresArg: true, + }) + .option('major', { + description: 'Return the most recent release that matches', + alias: 'm', + type: 'string', + requiresArg: true, + })) + .demandCommand() + .help() + .strictOptions() + .showHelpOnFail(false) + .argv; + + const command = args._[0]; + + const token = args.token ?? process.env.GITHUB_TOKEN; + if (!token) { + throw new Error('Either pass --token or set GITHUB_TOKEN.'); + } + + switch (command) { + case 'last-release': + if (args['prior-to'] && args.major) { + throw new Error('Cannot pass both `--prior-to and --major at the same time'); + } + + // eslint-disable-next-line no-console + console.log(await fetchPreviousVersion(token, { + priorTo: args['prior-to'], + majorVersion: args.major, + })); + break; + } +} + +main().catch(e => { + // eslint-disable-next-line no-console + console.error(e); + process.exitCode = 1; +}); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/bin/run-suite b/packages/@aws-cdk-testing/cli-integ/bin/run-suite new file mode 100755 index 0000000000000..d4a0aacaa4a54 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/run-suite @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./run-suite.js'); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts b/packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts new file mode 100644 index 0000000000000..46a19e44bf47b --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts @@ -0,0 +1,136 @@ +/* eslint-disable no-console */ +import * as path from 'path'; +// eslint-disable-next-line jest/no-jest-import +import * as jest from 'jest'; +import * as yargs from 'yargs'; +import { ReleasePackageSourceSetup } from '../lib/package-sources/release-source'; +import { RepoPackageSourceSetup, autoFindRoot } from '../lib/package-sources/repo-source'; +import { IPackageSourceSetup } from '../lib/package-sources/source'; +import { serializeForSubprocess } from '../lib/package-sources/subprocess'; + +async function main() { + const args = await yargs + .usage('$0 ') + .positional('SUITENAME', { + descripton: 'Name of the test suite to run', + type: 'string', + demandOption: true, + }) + .option('test', { + descripton: 'Test pattern to selectively run tests', + alias: 't', + type: 'string', + requiresArg: true, + }) + .option('use-source', { + descripton: 'Use TypeScript packages from the given source repository (or "auto")', + alias: 's', + type: 'string', + requiresArg: true, + }) + .option('use-cli-release', { + descripton: 'Run the current tests against the CLI at the given version', + alias: 'u', + type: 'string', + requiresArg: true, + }) + .option('auto-source', { + alias: 'a', + description: 'Automatically find the source tree from the current working directory', + type: 'boolean', + requiresArg: false, + }) + .option('runInBand', { + descripton: 'Run all tests in one Node process', + alias: 'i', + type: 'boolean', + }) + .options('framework-version', { + description: 'Framework version to use, if different than the CLI version (not all suites respect this)', + alias: 'f', + type: 'string', + }) + .options('verbose', { + alias: 'v', + description: 'Run in verbose mode', + type: 'boolean', + requiresArg: false, + }) + .options('passWithNoTests', { + description: 'Allow passing if the test suite is not found (default true when IS_CANARY mode, false otherwise)', + type: 'boolean', + requiresArg: false, + }) + .help() + .strictOptions() + .showHelpOnFail(false) + .argv; + + const suiteName = args._[0] as string; + if (!suiteName) { + throw new Error('Usage: run-suite '); + } + + let packageSource: undefined | IPackageSourceSetup; + function usePackageSource(s: IPackageSourceSetup) { + if (packageSource) { + throw new Error('Cannot specify two package sources'); + } + packageSource = s; + } + + if (args['use-source'] || args['auto-source']) { + if (args['framework-version']) { + throw new Error('Cannot use --framework-version with --use-source'); + } + + const root = args['use-source'] && args['use-source'] !== 'auto' + ? args['use-source'] + : await autoFindRoot(); + + usePackageSource(new RepoPackageSourceSetup(root)); + } else if (args['use-cli-release']) { + usePackageSource(new ReleasePackageSourceSetup(args['use-cli-release'], args['framework-version'])); + } + if (!packageSource) { + throw new Error('Specify either --use-source or --use-cli-release'); + } + + console.log(`Package source: ${packageSource.description}`); + console.log(`Test suite: ${suiteName}`); + + await packageSource.prepare(); + serializeForSubprocess(packageSource); + + if (args.verbose) { + process.env.VERBOSE = '1'; + } + + // Motivation behind this behavior: when adding a new test suite to the pipeline, because of the way our + // Pipeline package works, the suite would be added to the pipeline AND as a canary immediately. The canary + // would fail until the package was actually released, so for canaries we make an exception so that the initial + // canary would succeed even if the suite wasn't yet available. The fact that the suite is not optional in + // the pipeline protects us from typos. + const passWithNoTests = args.passWithNoTests ?? !!process.env.IS_CANARY; + + // Communicate with the config file (integ.jest.config.js) + process.env.TEST_SUITE_NAME = suiteName; + + try { + await jest.run([ + ...args.runInBand ? ['-i'] : [], + ...args.test ? ['-t', args.test] : [], + ...args.verbose ? ['--verbose'] : [], + ...passWithNoTests ? ['--passWithNoTests'] : [], + ], path.resolve(__dirname, '..', 'resources', 'integ.jest.config.js')); + + } finally { + await packageSource.cleanup(); + } +} + +main().catch(e => { + // eslint-disable-next-line no-console + console.error(e); + process.exitCode = 1; +}); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution new file mode 100755 index 0000000000000..99b7ad3606f7b --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./stage-distribution.js'); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts new file mode 100644 index 0000000000000..5bc53c28caead --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts @@ -0,0 +1,259 @@ +/* eslint-disable no-console */ +import * as path from 'path'; +import * as fs from 'fs-extra'; +import * as glob from 'glob'; +import * as yargs from 'yargs'; +import { shell } from '../lib'; +import { TestRepository } from '../lib/staging/codeartifact'; +import { uploadJavaPackages, mavenLogin } from '../lib/staging/maven'; +import { uploadNpmPackages, npmLogin } from '../lib/staging/npm'; +import { uploadDotnetPackages, nugetLogin } from '../lib/staging/nuget'; +import { uploadPythonPackages, pypiLogin } from '../lib/staging/pypi'; +import { UsageDir } from '../lib/staging/usage-dir'; + +async function main() { + await yargs + .usage('$0 ') + .option('npm', { + description: 'Upload NPM packages only', + type: 'boolean', + requiresArg: false, + }) + .option('python', { + description: 'Upload Python packages only', + type: 'boolean', + requiresArg: false, + }) + .option('java', { + description: 'Upload Java packages only', + type: 'boolean', + requiresArg: false, + }) + .option('dotnet', { + description: 'Upload Dotnet packages only', + type: 'boolean', + requiresArg: false, + }) + .command('publish ', 'Publish a given directory', cmd => cmd + .positional('DIRECTORY', { + descripton: 'Directory distribution', + type: 'string', + demandOption: true, + }) + .option('name', { + alias: 'n', + description: 'Name of the repository to create (default: generate unique name)', + type: 'string', + requiresArg: true, + }), async (args) => { + + await validateDirectory(args); + const repo = await (args.name ? TestRepository.newWithName(args.name) : TestRepository.newRandom()); + const usageDir = UsageDir.default(); + + await doLogin(repo, usageDir, args); + await publish(repo, usageDir, args); + + header('Done'); + usageDir.advertise(); + }) + .command('login', 'Login to a given repository', cmd => cmd + .option('name', { + alias: 'n', + description: 'Name of the repository to log in to', + type: 'string', + requiresArg: true, + demandOption: true, + }), async (args) => { + + const repo = TestRepository.existing(args.name); + const usageDir = UsageDir.default(); + + await doLogin(repo, usageDir, args); + + usageDir.advertise(); + }) + .command('run ', 'Publish and run a command', cmd => cmd + .positional('DIRECTORY', { + descripton: 'Directory distribution', + type: 'string', + demandOption: true, + }) + .positional('COMMAND', { + alias: 'c', + description: 'Run the given command with the packages staged', + type: 'string', + array: true, + demandOption: true, + }) + .option('cleanup', { + alias: 'C', + description: 'Cleanup the repository afterwards', + type: 'boolean', + default: true, + requiresArg: false, + }), async (args) => { + + await validateDirectory(args); + const repo = await TestRepository.newRandom(); + const usageDir = UsageDir.default(); + + await doLogin(repo, usageDir, args); + await publish(repo, usageDir, args); + + try { + await usageDir.activateInCurrentProcess(); + + await shell(args.COMMAND ?? [], { + shell: true, + show: 'always', + }); + + } finally { + if (args.cleanup) { + await repo.delete(); + } + } + }) + .command('cleanup', 'Clean up testing repository', cmd => cmd + .option('name', { + alias: 'n', + description: 'Name of the repository to cleanup (default: most recent)', + type: 'string', + requiresArg: true, + }), async (args) => { + + const usageDir = UsageDir.default(); + + let repositoryName = args.name; + if (!repositoryName) { + repositoryName = (await usageDir.currentEnv()).CODEARTIFACT_REPO; + } + + if (!repositoryName) { + console.log(`No --name given and no $CODEARTIFACT_REPO found in ${usageDir.directory}, nothing cleaned up`); + return; + } + + const repo = TestRepository.existing(repositoryName); + await repo.delete(); + }) + .command('gc', 'Clean up day-old testing repositories', cmd => cmd, async () => { + await TestRepository.gc(); + }) + .demandCommand(1, 'You must supply a command') + .help() + .strictOptions() + .showHelpOnFail(false) + .parse(); +} + +async function validateDirectory(args: { + DIRECTORY: string, +}) { + if (!await fs.pathExists(path.join(args.DIRECTORY, 'build.json'))) { + throw new Error(`${args.DIRECTORY} does not look like a CDK dist directory (build.json missing)`); + } +} + +async function doLogin(repo: TestRepository, usageDir: UsageDir, args: { + npm?: boolean; + python?: boolean; + java?: boolean; + dotnet?: boolean; +}) { + const login = await repo.loginInformation(); + + const oldEnv = await usageDir.currentEnv(); + + await usageDir.clean(); + await usageDir.addToEnv({ + CODEARTIFACT_REPO: login.repositoryName, + }); + + if (oldEnv.BUILD_VERSION) { + await usageDir.addToEnv({ + BUILD_VERSION: oldEnv.BUILD_VERSION, + }); + } + + const doRepo = whichRepos(args); + + await doRepo.npm(() => npmLogin(login, usageDir)); + await doRepo.python(() => pypiLogin(login, usageDir)); + await doRepo.java(() => mavenLogin(login, usageDir)); + await doRepo.dotnet(() => nugetLogin(login, usageDir)); +} + +async function publish(repo: TestRepository, usageDir: UsageDir, args: { + DIRECTORY: string, + npm?: boolean; + python?: boolean; + java?: boolean; + dotnet?: boolean; +}) { + const directory = `${args.DIRECTORY}`; + const login = await repo.loginInformation(); + + const doRepo = whichRepos(args); + + const buildJson = await fs.readJson(path.join(directory, 'build.json')); + await usageDir.addToEnv({ + BUILD_VERSION: buildJson.version, + }); + + await doRepo.npm(async () => { + header('NPM'); + await uploadNpmPackages(glob.sync(path.join(directory, 'js', '*.tgz')), login, usageDir); + }); + + await doRepo.python(async () => { + header('Python'); + await uploadPythonPackages(glob.sync(path.join(directory, 'python', '*')), login); + }); + + await doRepo.java(async () => { + header('Java'); + await uploadJavaPackages(glob.sync(path.join(directory, 'java', '**', '*.pom')), login, usageDir); + }); + + await doRepo.dotnet(async () => { + header('.NET'); + await uploadDotnetPackages(glob.sync(path.join(directory, 'dotnet', '**', '*.nupkg')), usageDir); + }); + + console.log('πŸ› Configuring packages for upstream versions'); + await repo.markAllUpstreamAllow(); +} + +function whichRepos(args: { + npm?: boolean; + python?: boolean; + java?: boolean; + dotnet?: boolean; +}) { + const all = args.npm === undefined && args.python === undefined && args.java === undefined && args.dotnet === undefined; + + const invoke = (block: () => Promise) => block(); + const skip = () => { }; + + return { + npm: args.npm || all ? invoke : skip, + python: args.python || all ? invoke : skip, + java: args.java || all ? invoke : skip, + dotnet: args.dotnet || all ? invoke : skip, + }; +} + +function header(caption: string) { + console.log(''); + console.log('/'.repeat(70)); + console.log(`// ${caption}`); + console.log(''); +} + +main().catch(e => { + // eslint-disable-next-line no-console + console.error(e); + process.exitCode = 1; +}); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/test-root b/packages/@aws-cdk-testing/cli-integ/bin/test-root new file mode 100755 index 0000000000000..d14248e4d4019 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/test-root @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./test-root.js'); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/test-root.ts b/packages/@aws-cdk-testing/cli-integ/bin/test-root.ts new file mode 100644 index 0000000000000..244194a7eb31c --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/bin/test-root.ts @@ -0,0 +1,3 @@ +import * as path from 'path'; +// eslint-disable-next-line no-console +console.log(path.resolve(__dirname, '..')); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression-against-current-code.sh b/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression-against-current-code.sh new file mode 100755 index 0000000000000..ff50aa5f69a2b --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression-against-current-code.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Run our integration tests in regression mode against the +# candidate version of the framework, which is the one we just packed. +# +set -euo pipefail +integdir=$(cd $(dirname $0) && pwd) + +source ${integdir}/test-cli-regression.bash + +run_regression_against_framework_version CANDIDATE_VERSION diff --git a/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression-against-latest-release.sh b/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression-against-latest-release.sh new file mode 100755 index 0000000000000..8b670eb7b793d --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression-against-latest-release.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Run our integration tests in regression mode against the +# previous version of the framework, relative to the version being packed now. +# +set -euo pipefail +integdir=$(cd $(dirname $0) && pwd) + +source ${integdir}/test-cli-regression.bash + +run_regression_against_framework_version PREVIOUS_VERSION diff --git a/packages/aws-cdk/test/integ/test-cli-regression.bash b/packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression.bash similarity index 100% rename from packages/aws-cdk/test/integ/test-cli-regression.bash rename to packages/@aws-cdk-testing/cli-integ/entrypoints/test-cli-regression.bash diff --git a/packages/@aws-cdk-testing/cli-integ/entrypoints/test.sh b/packages/@aws-cdk-testing/cli-integ/entrypoints/test.sh new file mode 100755 index 0000000000000..bf0ec0a7c5c68 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/entrypoints/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail +scriptdir=$(cd $(dirname $0) && pwd) + +echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' +echo 'CLI Integration Tests' +echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' + +cd $scriptdir + +source ../common/jest-test.bash +invokeJest "$@" diff --git a/packages/@aws-cdk-testing/cli-integ/jest.config.js b/packages/@aws-cdk-testing/cli-integ/jest.config.js new file mode 100644 index 0000000000000..30ba8fce114e2 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/jest.config.js @@ -0,0 +1,10 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/jest.config'); +module.exports = { + ...baseConfig, + coverageThreshold: { + global: { + statements: 20, + branches: 2, + }, + }, +}; diff --git a/packages/aws-cdk/test/integ/helpers/aws.ts b/packages/@aws-cdk-testing/cli-integ/lib/aws.ts similarity index 99% rename from packages/aws-cdk/test/integ/helpers/aws.ts rename to packages/@aws-cdk-testing/cli-integ/lib/aws.ts index beea3fca64768..289b87bf955a1 100644 --- a/packages/aws-cdk/test/integ/helpers/aws.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/aws.ts @@ -232,14 +232,14 @@ retry.abort = (e: Error): Error => { return e; }; -export async function sleep(ms: number) { - return new Promise(ok => setTimeout(ok, ms)); -} - export function outputFromStack(key: string, stack: AWS.CloudFormation.Stack): string | undefined { return (stack.Outputs ?? []).find(o => o.OutputKey === key)?.OutputValue; } +export async function sleep(ms: number) { + return new Promise(ok => setTimeout(ok, ms)); +} + function chainableCredentials(region: string): AWS.Credentials | undefined { const profileName = process.env.AWS_PROFILE; @@ -287,5 +287,4 @@ function chainableCredentials(region: string): AWS.Credentials | undefined { } return undefined; - -} +} \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/helpers/corking.ts b/packages/@aws-cdk-testing/cli-integ/lib/corking.ts similarity index 90% rename from packages/aws-cdk/test/integ/helpers/corking.ts rename to packages/@aws-cdk-testing/cli-integ/lib/corking.ts index c3970586ead03..f083270a028f5 100644 --- a/packages/aws-cdk/test/integ/helpers/corking.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/corking.ts @@ -25,4 +25,8 @@ export class MemoryStream extends stream.Writable { return new Promise(ok => strm.once('drain', ok)); } } + + public toString() { + return this.buffer().toString(); + } } diff --git a/packages/@aws-cdk-testing/cli-integ/lib/files.ts b/packages/@aws-cdk-testing/cli-integ/lib/files.ts new file mode 100644 index 0000000000000..186b1b0ff15f5 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/files.ts @@ -0,0 +1,81 @@ +import * as os from 'os'; +import * as path from 'path'; +import * as fs from 'fs-extra'; + +export async function rmFile(filename: string) { + if (await fs.pathExists(filename)) { + await fs.unlink(filename); + } +} + +export async function addToFile(filename: string, line: string) { + let contents = await fs.pathExists(filename) ? await fs.readFile(filename, { encoding: 'utf-8' }) : ''; + if (!contents.endsWith('\n')) { + contents += '\n'; + } + contents += line + '\n'; + + await writeFile(filename, contents); +} + +export async function writeFile(filename: string, contents: string) { + await fs.mkdirp(path.dirname(filename)); + await fs.writeFile(filename, contents, { encoding: 'utf-8' }); +} + +export async function copyDirectoryContents(dir: string, target: string) { + for (const file of await fs.readdir(path.join(dir), { encoding: 'utf-8' })) { + await fs.copyFile(path.join(dir, file), path.join(target, file)); + } +} + +export function findUp(name: string, directory: string = process.cwd()): string | undefined { + const absoluteDirectory = path.resolve(directory); + + const file = path.join(directory, name); + if (fs.existsSync(file)) { + return file; + } + + const { root } = path.parse(absoluteDirectory); + if (absoluteDirectory == root) { + return undefined; + } + + return findUp(name, path.dirname(absoluteDirectory)); +} + + +/** + * Docker-safe home directory + */ +export function homeDir() { + return os.userInfo().homedir ?? os.homedir(); +} + +export async function loadLines(filename: string): Promise { + return await fs.pathExists(filename) ? (await fs.readFile(filename, { encoding: 'utf-8' })).trim().split('\n') : []; +} + +export async function writeLines(filename: string, lines: string[]) { + // Must end in a newline or our bash script won't read it properly + await fs.writeFile(filename, lines.join('\n') + '\n', { encoding: 'utf-8' }); +} + +/** + * Update a spaceless ini file in place + */ +export function updateIniKey(lines: string[], key: string, value: string) { + const prefix = `${key}=`; + let found = false; + for (let i = 0; i < lines.length; i++) { + if (lines[i].startsWith(prefix)) { + lines[i] = prefix + value; + found = true; + break; + } + } + if (!found) { + lines.push(prefix + value); + } +} diff --git a/packages/@aws-cdk-testing/cli-integ/lib/github.ts b/packages/@aws-cdk-testing/cli-integ/lib/github.ts new file mode 100644 index 0000000000000..b483e5fb2fce8 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/github.ts @@ -0,0 +1,43 @@ +import { Octokit } from '@octokit/rest'; +import * as semver from 'semver'; + +export async function fetchPreviousVersion(token: string, options?: { + priorTo?: string, + majorVersion?: string, +}) { + const github = new Octokit({ auth: token }); + const releases = await github.repos.listReleases({ + owner: 'aws', + repo: 'aws-cdk', + }); + + // this returns a list in descending order, newest releases first + // opts for same major version where possible, falling back otherwise + // to previous major versions. + let previousMVRelease = undefined; + for (const release of releases.data) { + const version = release.name?.replace('v', ''); + if (!version) { continue; } + + // Any old version is fine + if (!options?.majorVersion && !options?.priorTo) { + return version; + } + + if (options?.majorVersion && `${semver.major(version)}` === options.majorVersion) { + return version; + } + + if (options?.priorTo && semver.lt(version, options?.priorTo) && semver.major(version) === semver.major(options.priorTo)) { + return version; + } + + // Otherwise return the most recent version that didn't match any + if (!previousMVRelease) { + previousMVRelease = version; + } + } + if (previousMVRelease) { return previousMVRelease; } + + throw new Error(`Unable to find previous version given ${JSON.stringify(options)}`); +}; \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/index.ts b/packages/@aws-cdk-testing/cli-integ/lib/index.ts new file mode 100644 index 0000000000000..32ab6ebcb83b4 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/index.ts @@ -0,0 +1,12 @@ +export * from './aws'; +export * from './corking'; +export * from './integ-test'; +export * from './memoize'; +export * from './resource-pool'; +export * from './with-sam'; +export * from './shell'; +export * from './with-aws'; +export * from './with-cdk-app'; +export * from './with-packages'; +export * from './with-temporary-directory'; +export * from './resources'; \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/helpers/test-helpers.ts b/packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts similarity index 61% rename from packages/aws-cdk/test/integ/helpers/test-helpers.ts rename to packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts index 5dc65f6ed492e..e529591c50d1e 100644 --- a/packages/aws-cdk/test/integ/helpers/test-helpers.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts @@ -2,9 +2,13 @@ import * as fs from 'fs'; import * as path from 'path'; import { MemoryStream } from './corking'; -const SKIP_TESTS = fs.readFileSync(path.join(__dirname, 'skip-tests.txt'), { encoding: 'utf-8' }).split('\n'); +const SKIP_TESTS = fs.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' }).split('\n'); -export type TestContext = { readonly output: NodeJS.WritableStream; }; +export interface TestContext { + readonly randomString: string; + readonly output: NodeJS.WritableStream; + log(s: string): void; +}; /** * A wrapper for jest's 'test' which takes regression-disabled tests into account and prints a banner @@ -31,19 +35,22 @@ export function integTest( output.write(`${name}\n`); output.write('================================================================\n'); - let success = true; try { - return await callback({ output }); + return await callback({ + output, + randomString: randomString(), + log(s: string) { + output.write(`${s}\n`); + }, + }); } catch (e) { - await output.flushTo(process.stderr); - process.stderr.write(`❌ ${e.toString()}\n`); - success = false; + output.write(e.message); + output.write(e.stack); + // Print output only if the test fails. Use 'console.log' so the output is buffered by + // jest and prints without a stack trace (if verbose: false). + // eslint-disable-next-line no-console + console.log(output.buffer().toString()); throw e; - } finally { - if (success) { - // Show people there's progress - process.stderr.write('βœ…'); - } } }, timeoutMillis); } @@ -51,3 +58,8 @@ export function integTest( function shouldSkip(testName: string) { return SKIP_TESTS.includes(testName); } + +export function randomString() { + // Crazy + return Math.random().toString(36).replace(/[^a-z0-9]+/g, ''); +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/lists.ts b/packages/@aws-cdk-testing/cli-integ/lib/lists.ts new file mode 100644 index 0000000000000..69f504a15474f --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/lists.ts @@ -0,0 +1,9 @@ +export function chunk(n: number, xs: A[]): A[][] { + const ret = new Array(); + + for (let i = 0; i < xs.length; i += n) { + ret.push(xs.slice(i, i + n)); + } + + return ret; +} \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/helpers/memoize.ts b/packages/@aws-cdk-testing/cli-integ/lib/memoize.ts similarity index 100% rename from packages/aws-cdk/test/integ/helpers/memoize.ts rename to packages/@aws-cdk-testing/cli-integ/lib/memoize.ts diff --git a/packages/@aws-cdk-testing/cli-integ/lib/npm.ts b/packages/@aws-cdk-testing/cli-integ/lib/npm.ts new file mode 100644 index 0000000000000..991599f010ba8 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/npm.ts @@ -0,0 +1,13 @@ +import { spawnSync } from 'child_process'; + +const MINIMUM_VERSION = '3.9'; + +/** + * Use NPM preinstalled on the machine to look up a list of TypeScript versions + */ +export function typescriptVersionsSync(): string[] { + const { stdout } = spawnSync('npm', ['--silent', 'view', `typescript@>=${MINIMUM_VERSION}`, 'version', '--json']); + + const versions: string[] = JSON.parse(stdout); + return Array.from(new Set(versions.map(v => v.split('.').slice(0, 2).join('.')))); +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/package-sources/release-source.ts b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/release-source.ts new file mode 100644 index 0000000000000..7d097630e26de --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/release-source.ts @@ -0,0 +1,77 @@ +import * as os from 'os'; +import * as path from 'path'; +import * as fs from 'fs-extra'; +import { copyDirectoryContents } from '../files'; +import { shell, rimraf, addToShellPath } from '../shell'; +import { IPackageSourceSetup, IPackageSource } from './source'; + +export class ReleasePackageSourceSetup implements IPackageSourceSetup { + readonly name = 'release'; + readonly description = `release @ ${this.version}`; + + private tempDir?: string; + + constructor(private readonly version: string, private readonly frameworkVersion?: string) { + } + + public async prepare(): Promise { + this.tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tmpcdk')); + fs.mkdirSync(this.tempDir, { recursive: true }); + + await shell(['node', require.resolve('npm'), 'install', `aws-cdk@${this.version}`], { + cwd: this.tempDir, + }); + + process.env.CDK_CLI_PATH = this.tempDir; + process.env.VERSION = this.version; + process.env.FRAMEWORK_VERSION = this.frameworkVersion ?? this.version; + } + + public async cleanup(): Promise { + if (this.tempDir) { + rimraf(this.tempDir); + } + } +} + +export class ReleasePackageSource implements IPackageSource { + private readonly cliPath: string; + private readonly version: string; + + constructor() { + this.cliPath = process.env.CDK_CLI_PATH!; + this.version = process.env.VERSION!; + } + + public async makeCliAvailable() { + addToShellPath(path.join(this.cliPath, 'node_modules', '.bin')); + } + + public assertJsiiPackagesAvailable() { + } + + public async initializeDotnetPackages(currentDir: string) { + if (process.env.CWD_FILES_DIR) { + await copyDirectoryContents(process.env.CWD_FILES_DIR, currentDir); + } + } + + public majorVersion() { + return this.version.split('.')[0] as string; + } + + public requestedFrameworkVersion() { + return process.env.FRAMEWORK_VERSION!; + } + + public requestedAlphaVersion(): string { + const frameworkVersion = this.requestedFrameworkVersion(); + if (frameworkVersion.includes('-rc.')) { + // For a pipeline release + return frameworkVersion.replace(/-rc\.\d+$/, '-alpha.999'); + } else { + // For a stable release + return `${frameworkVersion}-alpha.0`; + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-source.ts b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-source.ts new file mode 100644 index 0000000000000..d1d445d7bf931 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-source.ts @@ -0,0 +1,106 @@ +import * as os from 'os'; +import * as path from 'path'; +import * as fs from 'fs-extra'; +import { findUp } from '../files'; +import { shell, addToShellPath } from '../shell'; +import { IPackageSourceSetup, IPackageSource } from './source'; + +export class RepoPackageSourceSetup implements IPackageSourceSetup { + readonly name = 'repo'; + readonly description = `repo(${this.repoRoot})`; + + constructor(private readonly repoRoot: string) { + } + + public async prepare(): Promise { + if (!await fs.pathExists(path.join(this.repoRoot, 'package.json')) || !await fs.pathExists(path.join(this.repoRoot, 'yarn.lock'))) { + throw new Error(`${this.repoRoot}: does not look like the repository root`); + } + + process.env.REPO_ROOT = this.repoRoot; + process.env.REPO_PACKAGE_MAP = await writePackageMap(this.repoRoot); + addToShellPath(path.resolve(__dirname, 'repo-tools')); + } + + public async cleanup(): Promise { + } +} + +export class RepoPackageSource implements IPackageSource { + private readonly repoRoot: string; + + constructor() { + this.repoRoot = process.env.REPO_ROOT as string; + } + + public async makeCliAvailable() { + addToShellPath(path.join(this.repoRoot, 'packages', 'aws-cdk', 'bin')); + } + + public assertJsiiPackagesAvailable() { + throw new Error('jsii client packages are not available when using REPO source'); + } + + public async initializeDotnetPackages() { + } + + public majorVersion() { + const releaseJson = fs.readJsonSync(path.resolve(this.repoRoot, 'release.json')); + return releaseJson.majorVersion; + } + + public requestedFrameworkVersion(): string { + return '*'; + } + + public requestedAlphaVersion(): string { + return '*'; + } +} + +async function writePackageMap(repoRoot: string): Promise { + const packages = await findYarnPackages(repoRoot); + const fileName = path.join(os.tmpdir(), 'package-map.json'); + await fs.writeJson(fileName, packages); + return fileName; +} + +/** + * Cache monorepo discovery results, we only want to do this once per run + */ +const YARN_MONOREPO_CACHE: Record = {}; + +/** + * Return a { name -> directory } packages found in a Yarn monorepo + * + * Cached in YARN_MONOREPO_CACHE. + */ +async function findYarnPackages(root: string): Promise> { + if (!(root in YARN_MONOREPO_CACHE)) { + const output: YarnWorkspacesOutput = JSON.parse(await shell(['yarn', 'workspaces', '--silent', 'info'], { + captureStderr: false, + cwd: root, + show: 'error', + })); + + const ret: Record = {}; + for (const [k, v] of Object.entries(output)) { + ret[k] = path.join(root, v.location); + } + YARN_MONOREPO_CACHE[root] = ret; + } + return YARN_MONOREPO_CACHE[root]; +} + +/** + * Find the root directory of the repo from the current directory + */ +export async function autoFindRoot() { + const found = await findUp('release.json'); + if (!found) { + throw new Error(`Could not determine repository root: 'release.json' not found from ${process.cwd()}`); + } + return path.dirname(found); +} + +type YarnWorkspacesOutput = Record; diff --git a/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm new file mode 100644 index 0000000000000..ab3229febddc1 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./npm.js'); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm.ts b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm.ts new file mode 100644 index 0000000000000..5efcc3e4a865f --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm.ts @@ -0,0 +1,48 @@ +import * as child_process from 'child_process'; +import * as fs from 'fs-extra'; + +let argv = process.argv.slice(2); + +// eslint-disable-next-line no-console +console.log('fake npm'); + +if (argv[0] === 'install') { + if (!process.env.REPO_PACKAGE_MAP) { + throw new Error('REPO_PACKAGE_MAP not set'); + } + const repoPackageMap = fs.readJsonSync(process.env.REPO_PACKAGE_MAP, { encoding: 'utf-8' }); + + // Replace paths in the 'package.json' in the current directory + if (fs.pathExistsSync('package.json')) { + const packageJson = fs.readJsonSync('package.json', { encoding: 'utf-8' }); + for (const deps of [packageJson.dependencies ?? {}, packageJson.devDependencies ?? {}]) { + for (const [name, version] of Object.entries(deps)) { + deps[name] = repoPackageMap[name] ?? version; + } + } + fs.writeJsonSync('package.json', packageJson, { encoding: 'utf-8' }); + } + + // Replace package names on the command line + argv = argv.map(x => repoPackageMap[x] ?? x); +} + +//////////////////////////////////////////////////////////////////////// +// Shell out to original npm + +const child = child_process.spawn('node', [require.resolve('npm'), ...argv], { + shell: false, + stdio: ['ignore', 'inherit', 'inherit'], +}); + +child.once('error', e => { + // eslint-disable-next-line no-console + console.error(e); + process.exitCode = 1; +}); + +child.once('close', code => { + if (code) { + process.exitCode = code; + } +}); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/package-sources/source.ts b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/source.ts new file mode 100644 index 0000000000000..21e970701db94 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/source.ts @@ -0,0 +1,30 @@ +export interface IPackageSourceSetup { + readonly name: string; + readonly description: string; + + prepare(): Promise; + cleanup(): Promise; +} + +export interface IPackageSource { + makeCliAvailable(): Promise; + + assertJsiiPackagesAvailable(): void; + majorVersion(): string; + + initializeDotnetPackages(targetDir: string): Promise; + + /** + * Framework version if it's different than the CLI version + * + * Not all tests will respect this. + */ + requestedFrameworkVersion(): string; + + /** + * Versions of alpha packages if different than the CLI version + * + * Not all tests will respect this. + */ + requestedAlphaVersion(): string; +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/package-sources/subprocess.ts b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/subprocess.ts new file mode 100644 index 0000000000000..09f8fdd231a0b --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/package-sources/subprocess.ts @@ -0,0 +1,15 @@ +import { ReleasePackageSource } from './release-source'; +import { RepoPackageSource } from './repo-source'; +import { IPackageSourceSetup, IPackageSource } from './source'; + +export function serializeForSubprocess(s: IPackageSourceSetup) { + process.env.PACKAGE_SOURCE = s.name; +} + +export function packageSourceInSubprocess(): IPackageSource { + switch (process.env.PACKAGE_SOURCE) { + case 'repo': return new RepoPackageSource(); + case 'release': return new ReleasePackageSource(); + default: throw new Error(`Unrecognized package source: ${process.env.PACKAGE_SOURCE}`); + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/resource-pool.ts b/packages/@aws-cdk-testing/cli-integ/lib/resource-pool.ts new file mode 100644 index 0000000000000..1c10f54be562d --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/resource-pool.ts @@ -0,0 +1,144 @@ +import { ILock, XpMutex, XpMutexPool } from './xpmutex'; + +/** + * A class that holds a pool of resources and gives them out and returns them on-demand + * + * The resources will be given out front to back, when they are returned + * the most recently returned version will be given out again (for best + * cache coherency). + * + * If there are multiple consumers waiting for a resource, consumers are serviced + * in FIFO order for most fairness. + */ +export class ResourcePool { + public static withResources(name: string, resources: A[]) { + const pool = XpMutexPool.fromName(name); + return new ResourcePool(pool, resources); + } + + private readonly resources: ReadonlyArray; + private readonly mutexes: Record = {}; + private readonly locks: Record = {}; + + private constructor(private readonly pool: XpMutexPool, resources: A[]) { + if (resources.length === 0) { + throw new Error('Must have at least one resource in the pool'); + } + + // Shuffle to reduce contention + resources = [...resources]; + fisherYatesShuffle(resources); + this.resources = resources; + + for (const res of resources) { + this.mutexes[res] = this.pool.mutex(res); + } + } + + /** + * Take one value from the resource pool + * + * If no such value is currently available, wait until it is. + */ + public async take(): Promise> { + while (true) { + // Start a wait on the unlock now -- if the unlock signal comes after + // we try to acquire but before we start the wait, we might miss it. + const wait = this.pool.awaitUnlock(5000); + + for (const res of this.unlockedResources()) { + const lease = await this.tryObtainLease(res); + if (lease) { + // Ignore the wait (count as handled) + wait.then(() => {}, () => {}); + return lease; + } + } + + // None available, wait until one gets unlocked then try again + await wait; + } + } + + /** + * Execute a block using a single resource from the pool + */ + public async using(block: (x: A) => B | Promise): Promise { + const lease = await this.take(); + try { + return await block(lease.value); + } finally { + await lease.dispose(); + } + } + + private async tryObtainLease(value: A) { + const lock = await this.mutexes[value].tryAcquire(); + if (!lock) { + return undefined; + } + + this.locks[value] = lock; + return this.makeLease(value); + } + + private makeLease(value: A): ILease { + let disposed = false; + return { + value, + dispose: () => { + if (disposed) { + throw new Error('Calling dispose() on an already-disposed lease.'); + } + disposed = true; + return this.returnValue(value); + }, + }; + } + + /** + * When a value is returned: + * + * - If someone's waiting for it, give it to them + * - Otherwise put it back into the pool + */ + private async returnValue(value: string) { + const lock = this.locks[value]; + delete this.locks[value]; + await lock?.release(); + } + + /** + * Return all resources that we definitely don't own the locks for + */ + private unlockedResources(): A[] { + return this.resources.filter(res => !this.locks[res]); + } +} + +/** + * A single value taken from the pool + */ +export interface ILease { + /** + * The value obtained by the lease + */ + readonly value: A; + + /** + * Return the leased value to the pool + */ + dispose(): Promise; +} + +/** + * Shuffle an array in-place + */ +function fisherYatesShuffle(xs: A[]) { + for (let i = xs.length - 1; i >= 1; i--) { + const j = Math.floor(Math.random() * i); + const h = xs[j]; + xs[j] = xs[i]; + xs[i] = h; + } +} diff --git a/packages/@aws-cdk-testing/cli-integ/lib/resources.ts b/packages/@aws-cdk-testing/cli-integ/lib/resources.ts new file mode 100644 index 0000000000000..39ab24ab48f58 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/resources.ts @@ -0,0 +1,4 @@ +import * as path from 'path'; + +export const RESOURCES_DIR = path.resolve(__dirname, '..', 'resources'); + diff --git a/packages/@aws-cdk-testing/cli-integ/lib/shell.ts b/packages/@aws-cdk-testing/cli-integ/lib/shell.ts new file mode 100644 index 0000000000000..a969f9d99fc11 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/shell.ts @@ -0,0 +1,168 @@ +import * as child_process from 'child_process'; +import * as fs from 'fs'; +import * as path from 'path'; +import { TestContext } from './integ-test'; +import { TemporaryDirectoryContext } from './with-temporary-directory'; + +/** + * A shell command that does what you want + * + * Is platform-aware, handles errors nicely. + */ +export async function shell(command: string[], options: ShellOptions = {}): Promise { + if (options.modEnv && options.env) { + throw new Error('Use either env or modEnv but not both'); + } + + // Always output the command + (options.output ?? process.stdout).write(`πŸ’» ${command.join(' ')}\n`); + + let output: NodeJS.WritableStream | undefined = options.output ?? process.stdout; + switch (options.show ?? 'always') { + case 'always': + break; + case 'never': + case 'error': + output = undefined; + break; + } + + if (process.env.VERBOSE) { + output = process.stdout; + } + + const env = options.env ?? (options.modEnv ? { ...process.env, ...options.modEnv } : process.env); + + const child = child_process.spawn(command[0], command.slice(1), { + ...options, + env, + // Need this for Windows where we want .cmd and .bat to be found as well. + shell: true, + stdio: ['ignore', 'pipe', 'pipe'], + }); + + return new Promise((resolve, reject) => { + const stdout = new Array(); + const stderr = new Array(); + + child.stdout!.on('data', chunk => { + output?.write(chunk); + stdout.push(chunk); + }); + + child.stderr!.on('data', chunk => { + output?.write(chunk); + if (options.captureStderr ?? true) { + stderr.push(chunk); + } + }); + + child.once('error', reject); + + child.once('close', code => { + const stderrOutput = Buffer.concat(stderr).toString('utf-8'); + const stdoutOutput = Buffer.concat(stdout).toString('utf-8'); + const out = (options.onlyStderr ? stderrOutput : stdoutOutput + stderrOutput).trim(); + if (code === 0 || options.allowErrExit) { + resolve(out); + } else { + if (options.show === 'error') { + (options.output ?? process.stdout).write(out + '\n'); + } + reject(new Error(`'${command.join(' ')}' exited with error code ${code}.`)); + } + }); + }); +} + +export interface ShellOptions extends child_process.SpawnOptions { + /** + * Properties to add to 'env' + */ + readonly modEnv?: Record; + + /** + * Don't fail when exiting with an error + * + * @default false + */ + readonly allowErrExit?: boolean; + + /** + * Whether to capture stderr + * + * @default true + */ + readonly captureStderr?: boolean; + + /** + * Pass output here + * + * @default stdout unless quiet=true + */ + readonly output?: NodeJS.WritableStream; + + /** + * Only return stderr. For example, this is used to validate + * that when CI=true, all logs are sent to stdout. + * + * @default false + */ + readonly onlyStderr?: boolean; + + /** + * Don't log to stdout + * + * @default always + */ + readonly show?: 'always' | 'never' | 'error'; +} + +export class ShellHelper { + public static fromContext(context: TestContext & TemporaryDirectoryContext) { + return new ShellHelper(context.integTestDir, context.output); + } + + constructor( + private readonly _cwd: string, + private readonly _output: NodeJS.WritableStream) { } + + public async shell(command: string[], options: Omit = {}): Promise { + return shell(command, { + output: this._output, + cwd: this._cwd, + ...options, + }); + } +} + +/** + * rm -rf reimplementation, don't want to depend on an NPM package for this + */ +export function rimraf(fsPath: string) { + try { + const isDir = fs.lstatSync(fsPath).isDirectory(); + + if (isDir) { + for (const file of fs.readdirSync(fsPath)) { + rimraf(path.join(fsPath, file)); + } + fs.rmdirSync(fsPath); + } else { + fs.unlinkSync(fsPath); + } + } catch (e) { + // We will survive ENOENT + if (e.code !== 'ENOENT') { throw e; } + } +} + +export function addToShellPath(x: string) { + const parts = process.env.PATH?.split(':') ?? []; + + if (!parts.includes(x)) { + parts.unshift(x); + } + + process.env.PATH = parts.join(':'); +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/codeartifact.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/codeartifact.ts new file mode 100644 index 0000000000000..75c00a97ad9f0 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/codeartifact.ts @@ -0,0 +1,282 @@ +import * as AWS from 'aws-sdk'; +import { sleep } from '../aws'; + +const COLLECT_BY_TAG = 'collect-by'; +const REPO_LIFETIME_MS = 24 * 3600 * 1000; // One day + +export class TestRepository { + public static readonly DEFAULT_DOMAIN = 'test-cdk'; + + public static async newRandom() { + const qualifier = Math.random().toString(36).replace(/[^a-z0-9]+/g, ''); + + const repo = new TestRepository(`test-${qualifier}`); + await repo.prepare(); + return repo; + } + + public static async newWithName(name: string) { + const repo = new TestRepository(name); + await repo.prepare(); + return repo; + } + + public static existing(repositoryName: string) { + return new TestRepository(repositoryName); + } + + /** + * Garbage collect repositories + */ + public static async gc() { + if (!await TestRepository.existing('*dummy*').domainExists()) { + return; + } + + const codeArtifact = new AWS.CodeArtifact(); + + let nextToken: string | undefined; + do { + const page = await codeArtifact.listRepositories({ nextToken }).promise(); + + for (const repo of page.repositories ?? []) { + const tags = await codeArtifact.listTagsForResource({ resourceArn: repo.arn! }).promise(); + const collectable = tags?.tags?.find(t => t.key === COLLECT_BY_TAG && Number(t.value) < Date.now()); + if (collectable) { + // eslint-disable-next-line no-console + console.log('Deleting', repo.name); + await codeArtifact.deleteRepository({ + domain: repo.domainName!, + repository: repo.name!, + }).promise(); + } + } + + nextToken = page.nextToken; + } while (nextToken); + } + + public readonly npmUpstream = 'npm-upstream'; + public readonly pypiUpstream = 'pypi-upstream'; + public readonly nugetUpstream = 'nuget-upstream'; + public readonly mavenUpstream = 'maven-upstream'; + public readonly domain = TestRepository.DEFAULT_DOMAIN; + + private readonly codeArtifact = new AWS.CodeArtifact(); + + private _loginInformation: LoginInformation | undefined; + + private constructor(public readonly repositoryName: string) { + } + + public async prepare() { + await this.ensureDomain(); + await this.ensureUpstreams(); + + await this.ensureRepository(this.repositoryName, { + description: 'Testing repository', + upstreams: [ + this.npmUpstream, + this.pypiUpstream, + this.nugetUpstream, + this.mavenUpstream, + ], + tags: { + [COLLECT_BY_TAG]: `${Date.now() + REPO_LIFETIME_MS}`, + }, + }); + } + + public async loginInformation(): Promise { + if (this._loginInformation) { + return this._loginInformation; + } + + this._loginInformation = { + authToken: (await this.codeArtifact.getAuthorizationToken({ domain: this.domain, durationSeconds: 12 * 3600 }).promise()).authorizationToken!, + repositoryName: this.repositoryName, + npmEndpoint: (await this.codeArtifact.getRepositoryEndpoint({ domain: this.domain, repository: this.repositoryName, format: 'npm' }).promise()).repositoryEndpoint!, + mavenEndpoint: (await this.codeArtifact.getRepositoryEndpoint({ domain: this.domain, repository: this.repositoryName, format: 'maven' }).promise()).repositoryEndpoint!, + nugetEndpoint: (await this.codeArtifact.getRepositoryEndpoint({ domain: this.domain, repository: this.repositoryName, format: 'nuget' }).promise()).repositoryEndpoint!, + pypiEndpoint: (await this.codeArtifact.getRepositoryEndpoint({ domain: this.domain, repository: this.repositoryName, format: 'pypi' }).promise()).repositoryEndpoint!, + }; + return this._loginInformation; + } + + public async delete() { + try { + await this.codeArtifact.deleteRepository({ + domain: this.domain, + repository: this.repositoryName, + }).promise(); + + // eslint-disable-next-line no-console + console.log('Deleted', this.repositoryName); + } catch (e) { + if (e.code !== 'ResourceNotFoundException') { throw e; } + // Okay + } + } + + /** + * List all packages and mark them as "allow upstream versions". + * + * If we don't do this and we publish `foo@2.3.4-rc.0`, then we can't + * download `foo@2.3.0` anymore because by default CodeArtifact will + * block different versions from the same package. + */ + public async markAllUpstreamAllow() { + for await (const pkg of this.listPackages({ upstream: 'BLOCK' })) { + await retryThrottled(() => this.codeArtifact.putPackageOriginConfiguration({ + domain: this.domain, + repository: this.repositoryName, + + format: pkg.format!, + package: pkg.package!, + namespace: pkg.namespace!, + restrictions: { + publish: 'ALLOW', + upstream: 'ALLOW', + }, + }).promise()); + } + } + + private async ensureDomain() { + if (await this.domainExists()) { return; } + await this.codeArtifact.createDomain({ + domain: this.domain, + tags: [{ key: 'testing', value: 'true' }], + }).promise(); + } + + private async ensureUpstreams() { + await this.ensureRepository(this.npmUpstream, { + description: 'The upstream repository for NPM', + external: 'public:npmjs', + }); + await this.ensureRepository(this.mavenUpstream, { + description: 'The upstream repository for Maven', + external: 'public:maven-central', + }); + await this.ensureRepository(this.nugetUpstream, { + description: 'The upstream repository for NuGet', + external: 'public:nuget-org', + }); + await this.ensureRepository(this.pypiUpstream, { + description: 'The upstream repository for PyPI', + external: 'public:pypi', + }); + } + + private async ensureRepository(name: string, options?: { + readonly description?: string, + readonly external?: string, + readonly upstreams?: string[], + readonly tags?: Record, + }) { + if (await this.repositoryExists(name)) { return; } + + await this.codeArtifact.createRepository({ + domain: this.domain, + repository: name, + description: options?.description, + upstreams: options?.upstreams?.map(repositoryName => ({ repositoryName })), + tags: options?.tags ? Object.entries(options.tags).map(([key, value]) => ({ key, value })) : undefined, + }).promise(); + + if (options?.external) { + const externalConnection = options.external; + await retry(() => this.codeArtifact.associateExternalConnection({ + domain: this.domain, + repository: name, + externalConnection, + }).promise()); + } + } + + private async domainExists() { + try { + await this.codeArtifact.describeDomain({ domain: this.domain }).promise(); + return true; + } catch (e) { + if (e.code !== 'ResourceNotFoundException') { throw e; } + return false; + } + } + + private async repositoryExists(name: string) { + try { + await this.codeArtifact.describeRepository({ domain: this.domain, repository: name }).promise(); + return true; + } catch (e) { + if (e.code !== 'ResourceNotFoundException') { throw e; } + return false; + } + } + + private async* listPackages(filter: Pick = {}) { + let response = await retryThrottled(() => this.codeArtifact.listPackages({ + domain: this.domain, + repository: this.repositoryName, + ...filter, + }).promise()); + + while (true) { + for (const p of response.packages ?? []) { + yield p; + } + + if (!response.nextToken) { + break; + } + + response = await retryThrottled(() => this.codeArtifact.listPackages({ + domain: this.domain, + repository: this.repositoryName, + ...filter, + nextToken: response.nextToken, + }).promise()); + } + } +} + +async function retry(block: () => Promise) { + let attempts = 3; + while (true) { + try { + return await block(); + } catch (e) { + if (attempts-- === 0) { throw e; } + // eslint-disable-next-line no-console + console.debug(e.message); + await sleep(500); + } + } +} + +async function retryThrottled(block: () => Promise) { + let time = 100; + let attempts = 15; + while (true) { + try { + return await block(); + } catch (e) { + // eslint-disable-next-line no-console + console.debug(e.message); + if (e.code !== 'ThrottlingException') { throw e; } + if (attempts-- === 0) { throw e; } + await sleep(Math.floor(Math.random() * time)); + time *= 2; + } + } +} + +export interface LoginInformation { + readonly authToken: string; + readonly repositoryName: string; + readonly npmEndpoint: string; + readonly mavenEndpoint: string; + readonly nugetEndpoint: string; + readonly pypiEndpoint: string; +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/maven.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/maven.ts new file mode 100644 index 0000000000000..18bb6a83f1255 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/maven.ts @@ -0,0 +1,87 @@ +/* eslint-disable no-console */ +import * as path from 'path'; +import { writeFile } from '../files'; +import { shell } from '../shell'; +import { LoginInformation } from './codeartifact'; +import { parallelShell } from './parallel-shell'; +import { UsageDir } from './usage-dir'; + +// Do not try to JIT the Maven binary +const NO_JIT = '-XX:+TieredCompilation -XX:TieredStopAtLevel=1'; + +export async function mavenLogin(login: LoginInformation, usageDir: UsageDir) { + await writeMavenSettingsFile(settingsFile(usageDir), login); + + // Write env var + // Twiddle JVM settings a bit to make Maven survive running on a CodeBuild box. + await usageDir.addToEnv({ + MAVEN_OPTS: `-Duser.home=${usageDir.directory} ${NO_JIT} ${process.env.MAVEN_OPTS ?? ''}`.trim(), + }); +} + +function settingsFile(usageDir: UsageDir) { + // If we configure usageDir as a fake home directory Maven will find this file. + // (No other way to configure the settings file as part of the environment). + return path.join(usageDir.directory, '.m2', 'settings.xml'); +} + +export async function uploadJavaPackages(packages: string[], login: LoginInformation, usageDir: UsageDir) { + await parallelShell(packages, async (pkg, output) => { + console.log(`⏳ ${pkg}`); + + await shell(['mvn', + `--settings=${settingsFile(usageDir)}`, + 'org.apache.maven.plugins:maven-deploy-plugin:3.0.0:deploy-file', + `-Durl=${login.mavenEndpoint}`, + '-DrepositoryId=codeartifact', + `-DpomFile=${pkg}`, + `-Dfile=${pkg.replace(/.pom$/, '.jar')}`, + `-Dsources=${pkg.replace(/.pom$/, '-sources.jar')}`, + `-Djavadoc=${pkg.replace(/.pom$/, '-javadoc.jar')}`], { + output, + modEnv: { + // Do not try to JIT the Maven binary + MAVEN_OPTS: `${NO_JIT} ${process.env.MAVEN_OPTS ?? ''}`.trim(), + }, + }); + + console.log(`βœ… ${pkg}`); + }, + (pkg, output) => { + if (output.toString().includes('409 Conflict')) { + console.log(`❌ ${pkg}: already exists. Skipped.`); + return 'skip'; + } + return 'fail'; + }); +} + +export async function writeMavenSettingsFile(filename: string, login: LoginInformation) { + await writeFile(filename, ` + + + + codeartifact + aws + ${login.authToken} + + + + + default + + + codeartifact + ${login.mavenEndpoint} + + + + + + default + + `); +} diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts new file mode 100644 index 0000000000000..74db6eddc76a5 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts @@ -0,0 +1,62 @@ +/* eslint-disable no-console */ +import * as path from 'path'; +import { updateIniKey, loadLines, writeLines } from '../files'; +import { shell } from '../shell'; +import { LoginInformation } from './codeartifact'; +import { parallelShell } from './parallel-shell'; +import { UsageDir } from './usage-dir'; + +export async function npmLogin(login: LoginInformation, usageDir: UsageDir) { + // Creating an ~/.npmrc that references an envvar is what you're supposed to do. (https://docs.npmjs.com/private-modules/ci-server-config) + await writeNpmLoginToken(usageDir, login.npmEndpoint, '${NPM_TOKEN}'); + + // Add variables to env file + await usageDir.addToEnv(npmEnv(usageDir, login)); +} + +function npmEnv(usageDir: UsageDir, login: LoginInformation) { + return { + npm_config_userconfig: path.join(usageDir.directory, '.npmrc'), + npm_config_registry: login.npmEndpoint, + npm_config_always_auth: 'true', // Necessary for NPM 6, otherwise it will sometimes not pass the token + NPM_TOKEN: login.authToken, + }; +} + +export async function uploadNpmPackages(packages: string[], login: LoginInformation, usageDir: UsageDir) { + await parallelShell(packages, async (pkg, output) => { + console.log(`⏳ ${pkg}`); + + // path.resolve() is required -- if the filename ends up looking like `js/bla.tgz` then NPM thinks it's a short form GitHub name. + await shell(['node', require.resolve('npm'), 'publish', path.resolve(pkg)], { + modEnv: npmEnv(usageDir, login), + show: 'error', + output, + }); + + console.log(`βœ… ${pkg}`); + }, (pkg, output) => { + if (output.toString().includes('code EPUBLISHCONFLICT')) { + console.log(`❌ ${pkg}: already exists. Skipped.`); + return 'skip'; + } + if (output.toString().includes('code EPRIVATE')) { + console.log(`❌ ${pkg}: is private. Skipped.`); + return 'skip'; + } + return 'fail'; + }); +} + +async function writeNpmLoginToken(usageDir: UsageDir, endpoint: string, token: string) { + const rcFile = path.join(usageDir.directory, '.npmrc'); + const lines = await loadLines(rcFile); + + const key = `${endpoint.replace(/^https:/, '')}:_authToken`; + updateIniKey(lines, key, token); + + await writeLines(rcFile, lines); + return rcFile; +} + +// Environment variable, .npmrc in same directory as package.json or in home dir \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/nuget.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/nuget.ts new file mode 100644 index 0000000000000..91b4cde286f64 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/nuget.ts @@ -0,0 +1,75 @@ +/* eslint-disable no-console */ +import { writeFile } from '../files'; +import { shell } from '../shell'; +import { LoginInformation } from './codeartifact'; +import { parallelShell } from './parallel-shell'; +import { UsageDir } from './usage-dir'; + +export async function nugetLogin(login: LoginInformation, usageDir: UsageDir) { + // NuGet.Config MUST live in the current directory or in the home directory, and there is no environment + // variable to configure its location. + await writeNuGetConfigFile(usageDir.cwdFile('NuGet.Config'), login); +} + +export async function uploadDotnetPackages(packages: string[], usageDir: UsageDir) { + await usageDir.copyCwdFileHere('NuGet.Config'); + + await parallelShell(packages, async (pkg, output) => { + console.log(`⏳ ${pkg}`); + + await shell(['dotnet', 'nuget', 'push', + pkg, + '--source', 'CodeArtifact', + '--no-symbols', + '--force-english-output', + '--disable-buffering', + '--timeout', '600', + '--skip-duplicate'], { + output, + }); + + console.log(`βœ… ${pkg}`); + }, + (pkg, output) => { + if (output.toString().includes('Conflict')) { + console.log(`❌ ${pkg}: already exists. Skipped.`); + return 'skip'; + } + if (output.includes('System.Threading.AbandonedMutexException')) { + console.log(`♻️ ${pkg}: AbandonedMutexException. Probably a sign of throttling, retrying.`); + return 'retry'; + } + if (output.includes('Too Many Requests')) { + console.log(`♻️ ${pkg}: Too many requests. Retrying.`); + return 'retry'; + } + if (output.includes('System.IO.IOException: The system cannot open the device or file specified.')) { + console.log(`♻️ ${pkg}: Some error that we've seen before as a result of throttling. Retrying.`); + return 'retry'; + } + return 'fail'; + }); +} + +async function writeNuGetConfigFile(filename: string, login: LoginInformation) { + // `dotnet nuget push` has an `--api-key` parameter, but CodeArtifact + // does not support that. We must authenticate with Basic auth. + await writeFile(filename, ` + + + + + + + + + + + + + + +`); +} + +// NuGet.Config in current directory \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/parallel-shell.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/parallel-shell.ts new file mode 100644 index 0000000000000..53242e73a1239 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/parallel-shell.ts @@ -0,0 +1,52 @@ +import PQueue from 'p-queue'; +import { sleep } from '../aws'; +import { MemoryStream } from '../corking'; + + +export type ErrorResponse = 'fail' | 'skip' | 'retry'; + +/** + * Run a function in parallel with cached output + */ +export async function parallelShell( + inputs: A[], + block: (x: A, output: NodeJS.WritableStream) => Promise, + swallowError?: (x: A, output: string) => ErrorResponse, +) { + // Limit to 10 for now, too many instances of Maven exhaust the CodeBuild instance memory + const q = new PQueue({ concurrency: Number(process.env.CONCURRENCY) || 10 }); + await q.addAll(inputs.map(input => async () => { + let attempts = 10; + let sleepMs = 500; + while (true) { + const output = new MemoryStream(); + try { + await block(input, output); + return; + } catch (e) { + switch (swallowError?.(input, output.toString())) { + case 'skip': + return; + + case 'retry': + if (--attempts > 0) { + await sleep(Math.floor(Math.random() * sleepMs)); + sleepMs *= 2; + continue; + } + break; + + case 'fail': + case undefined: + break; + } + + // eslint-disable-next-line no-console + console.error(output.toString()); + throw e; + } + } + })); + + await q.onEmpty(); +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/pypi.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/pypi.ts new file mode 100644 index 0000000000000..6308a95ce3b5b --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/pypi.ts @@ -0,0 +1,50 @@ +/* eslint-disable no-console */ +import * as path from 'path'; +import { writeFile } from '../files'; +import { shell } from '../shell'; +import { LoginInformation } from './codeartifact'; +import { parallelShell } from './parallel-shell'; +import { UsageDir } from './usage-dir'; + +export async function pypiLogin(login: LoginInformation, usageDir: UsageDir) { + // Write pip config file and set environment var + await writeFile(path.join(usageDir.directory, 'pip.conf'), [ + '[global]', + `index-url = https://aws:${login.authToken}@${login.pypiEndpoint.replace(/^https:\/\//, '')}simple/`, + ].join('\n')); + await usageDir.addToEnv({ + PIP_CONFIG_FILE: `${usageDir.directory}/pip.conf`, + }); +} + +export async function uploadPythonPackages(packages: string[], login: LoginInformation) { + await shell(['pip', 'install', 'twine'], { show: 'error' }); + + // Even though twine supports uploading all packages in one go, we have to upload them + // individually since CodeArtifact does not support Twine's `--skip-existing`. Fun beans. + await parallelShell(packages, async (pkg, output) => { + console.log(`⏳ ${pkg}`); + + await shell(['twine', 'upload', '--verbose', pkg], { + modEnv: { + TWINE_USERNAME: 'aws', + TWINE_PASSWORD: login.authToken, + TWINE_REPOSITORY_URL: login.pypiEndpoint, + }, + show: 'error', + output, + }); + + console.log(`βœ… ${pkg}`); + }, (pkg, output) => { + if (output.toString().includes('This package is configured to block new versions') || output.toString().includes('409 Conflict')) { + console.log(`❌ ${pkg}: already exists. Skipped.`); + return 'skip'; + } + if (output.includes('429 Too Many Requests ')) { + console.log(`♻️ ${pkg}: 429 Too Many Requests. Retrying.`); + return 'retry'; + } + return 'fail'; + }); +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/staging/usage-dir.ts b/packages/@aws-cdk-testing/cli-integ/lib/staging/usage-dir.ts new file mode 100644 index 0000000000000..055d85f875cb8 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/staging/usage-dir.ts @@ -0,0 +1,99 @@ +import * as path from 'path'; +import * as fs from 'fs-extra'; +import { copyDirectoryContents, homeDir, loadLines, updateIniKey, writeLines } from '../files'; + +export const DEFAULT_USAGE_DIR = path.join(homeDir(), '.codeartifact/usage'); + +/** + * The usage directory is where we write per-session config files to access the CodeArtifact repository. + * + * Some config files may be written in a system-global location, but they will not be active unless the + * contents of this directory have been sourced/copied into the current terminal. + * + * CONTRACT + * + * There are two special entries: + * + * - `env`, a file with `key=value` entries for environment variables to set. + * - `cwd/`, a directory with files that need to be copied into the current directory before each command. + * + * Other than these, code may write tempfiles to this directory if it wants, but there is no meaning + * implied for other files. + */ +export class UsageDir { + public static default() { + return new UsageDir(DEFAULT_USAGE_DIR); + } + + public readonly envFile: string; + public readonly cwdDir: string; + + private constructor(public readonly directory: string) { + this.envFile = path.join(this.directory, 'env'); + this.cwdDir = path.join(this.directory, 'cwd'); + } + + public async clean() { + await fs.rm(this.directory, { recursive: true, force: true }); + await fs.mkdirp(path.join(this.directory, 'cwd')); + await fs.writeFile(path.join(this.directory, 'env'), '', { encoding: 'utf-8' }); + + await this.addToEnv({ + CWD_FILES_DIR: path.join(this.directory, 'cwd'), + }); + + // Write a bash helper to load these settings + await fs.writeFile(path.join(this.directory, 'activate.bash'), [ + `while read -u10 line; do [[ -z $line ]] || export "$line"; done 10<${this.directory}/env`, + 'cp -R $CWD_FILES_DIR/ .', // Copy files from directory even if it is empty + ].join('\n'), { encoding: 'utf-8' }); + } + + public async addToEnv(settings: Record) { + const lines = await loadLines(this.envFile); + for (const [k, v] of Object.entries(settings)) { + updateIniKey(lines, k, v); + } + await writeLines(this.envFile, lines); + } + + public async currentEnv(): Promise> { + const lines = await loadLines(this.envFile); + + const splitter = /^([a-zA-Z0-9_-]+)\s*=\s*(.*)$/; + + const ret: Record = {}; + for (const line of lines) { + const m = line.match(splitter); + if (m) { + ret[m[1]] = m[2]; + } + } + return ret; + } + + public cwdFile(filename: string) { + return path.join(this.cwdDir, filename); + } + + public async activateInCurrentProcess() { + for (const [k, v] of Object.entries(await this.currentEnv())) { + process.env[k] = v; + } + + await copyDirectoryContents(this.cwdDir, '.'); + } + + public async copyCwdFileHere(...filenames: string[]) { + for (const file of filenames) { + await fs.copyFile(path.join(this.cwdDir, file), file); + } + } + + public advertise() { + // eslint-disable-next-line no-console + console.log('To activate these settings in the current terminal:'); + // eslint-disable-next-line no-console + console.log(` source ${this.directory}/activate.bash`); + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/lib/with-aws.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-aws.ts new file mode 100644 index 0000000000000..a18b6d6db4af4 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-aws.ts @@ -0,0 +1,63 @@ +import { AwsClients } from './aws'; +import { TestContext } from './integ-test'; +import { ResourcePool } from './resource-pool'; + +export type AwsContext = { readonly aws: AwsClients }; + +/** + * Higher order function to execute a block with an AWS client setup + * + * Allocate the next region from the REGION pool and dispose it afterwards. + */ +export function withAws(block: (context: A & AwsContext) => Promise) { + return (context: A) => regionPool().using(async (region) => { + const aws = await AwsClients.forRegion(region, context.output); + await sanityCheck(aws); + + return block({ ...context, aws }); + }); +} + +let _regionPool: undefined | ResourcePool; +export function regionPool(): ResourcePool { + if (_regionPool !== undefined) { + return _regionPool; + } + + const REGIONS = process.env.AWS_REGIONS + ? process.env.AWS_REGIONS.split(',') + : [process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? 'us-east-1']; + + // eslint-disable-next-line no-console + console.log(`Using regions: ${REGIONS}\n`); + + _regionPool = ResourcePool.withResources('aws_regions', REGIONS); + return _regionPool; +} + +/** + * Perform a one-time quick sanity check that the AWS clients have properly configured credentials + * + * If we don't do this, calls are going to fail and they'll be retried and everything will take + * forever before the user notices a simple misconfiguration. + * + * We can't check for the presence of environment variables since credentials could come from + * anywhere, so do simple account retrieval. + * + * Only do it once per process. + */ +async function sanityCheck(aws: AwsClients) { + if (sanityChecked === undefined) { + try { + await aws.account(); + sanityChecked = true; + } catch (e) { + sanityChecked = false; + throw new Error(`AWS credentials probably not configured, got error: ${e.message}`); + } + } + if (!sanityChecked) { + throw new Error('AWS credentials probably not configured, see previous error'); + } +} +let sanityChecked: boolean | undefined; \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/helpers/cdk.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts similarity index 65% rename from packages/aws-cdk/test/integ/helpers/cdk.ts rename to packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts index 6b95f2d5d44f1..efc14dbaf17c0 100644 --- a/packages/aws-cdk/test/integ/helpers/cdk.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts @@ -1,80 +1,14 @@ -import * as child_process from 'child_process'; +/* eslint-disable no-console */ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import { outputFromStack, AwsClients } from './aws'; -import { memoize0 } from './memoize'; -import { ResourcePool } from './resource-pool'; -import { TestContext } from './test-helpers'; - -const REGIONS = process.env.AWS_REGIONS - ? process.env.AWS_REGIONS.split(',') - : [process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? 'us-east-1']; - -export const FRAMEWORK_VERSION = process.env.FRAMEWORK_VERSION ?? '*'; - -export let MAJOR_VERSION = FRAMEWORK_VERSION.split('.')[0]; -if (MAJOR_VERSION === '*') { - if (process.env.REPO_ROOT) { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const releaseJson = require(path.resolve(process.env.REPO_ROOT, 'release.json')); - MAJOR_VERSION = `${releaseJson.majorVersion}`; - } else { - // eslint-disable-next-line no-console - console.error('[WARNING] Have to guess at major version. Guessing version 1 to not break anything, but this should not happen'); - MAJOR_VERSION = '1'; - } -} - -process.stdout.write(`Using regions: ${REGIONS}\n`); -process.stdout.write(`Using framework version: ${FRAMEWORK_VERSION} (major version ${MAJOR_VERSION})\n`); - -const REGION_POOL = new ResourcePool(REGIONS); - - -/** - * Cache monorepo discovery results, we only want to do this once per run - */ -const YARN_MONOREPO_CACHE: Record = {}; - -/** - * Return a { name -> directory } packages found in a Yarn monorepo - * - * Cached in YARN_MONOREPO_CACHE. - */ -export async function findYarnPackages(root: string): Promise> { - if (!(root in YARN_MONOREPO_CACHE)) { - const output: YarnWorkspacesOutput = JSON.parse(await shell(['yarn', 'workspaces', '--silent', 'info'], { - captureStderr: false, - cwd: root, - })); - - const ret: Record = {}; - for (const [k, v] of Object.entries(output)) { - ret[k] = path.join(root, v.location); - } - YARN_MONOREPO_CACHE[root] = ret; - } - return YARN_MONOREPO_CACHE[root]; -} - -type YarnWorkspacesOutput = Record; - -export type AwsContext = { readonly aws: AwsClients }; - -/** - * Higher order function to execute a block with an AWS client setup - * - * Allocate the next region from the REGION pool and dispose it afterwards. - */ -export function withAws(block: (context: A & AwsContext) => Promise) { - return (context: A) => REGION_POOL.using(async (region) => { - const aws = await AwsClients.forRegion(region, context.output); - await sanityCheck(aws); - - return block({ ...context, aws }); - }); -} +import { TestContext } from './integ-test'; +import { IPackageSource } from './package-sources/source'; +import { packageSourceInSubprocess } from './package-sources/subprocess'; +import { RESOURCES_DIR } from './resources'; +import { shell, ShellOptions, ShellHelper, rimraf } from './shell'; +import { AwsContext, withAws } from './with-aws'; /** * Higher order function to execute a block with a CDK app fixture @@ -86,7 +20,7 @@ export function withAws(block: (context: A & AwsContext) */ export function withCdkApp(block: (context: TestFixture) => Promise) { return async (context: A) => { - const randy = randomString(); + const randy = context.randomString; const stackNamePrefix = `cdktest-${randy}`; const integTestDir = path.join(os.tmpdir(), `cdk-integ-${randy}`); @@ -94,18 +28,19 @@ export function withCdkApp(block: (context: context.output.write(` Test directory: ${integTestDir}\n`); context.output.write(` Region: ${context.aws.region}\n`); - await cloneDirectory(path.join(__dirname, '..', 'cli', 'app'), integTestDir, context.output); + await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', 'app'), integTestDir, context.output); const fixture = new TestFixture( integTestDir, stackNamePrefix, context.output, - context.aws); + context.aws, + context.randomString); let success = true; try { - const installationVersion = FRAMEWORK_VERSION; + const installationVersion = fixture.packages.requestedFrameworkVersion(); - if (MAJOR_VERSION === '1') { + if (fixture.packages.majorVersion() === '1') { await installNpmPackages(fixture, { '@aws-cdk/core': installationVersion, '@aws-cdk/aws-sns': installationVersion, @@ -134,7 +69,7 @@ export function withCdkApp(block: (context: throw e; } finally { if (process.env.INTEG_NO_CLEAN) { - process.stderr.write(`Left test directory in '${integTestDir}' ($INTEG_NO_CLEAN)\n`); + context.log(`Left test directory in '${integTestDir}' ($INTEG_NO_CLEAN)\n`); } else { await fixture.dispose(success); } @@ -149,7 +84,7 @@ export function withMonolithicCfnIncludeCdkApp(block: (co throw new Error('The UBERPACKAGE environment variable is required for running this test!'); } - const randy = randomString(); + const randy = context.randomString; const stackNamePrefix = `cdk-uber-cfn-include-${randy}`; const integTestDir = path.join(os.tmpdir(), `cdk-uber-cfn-include-${randy}`); @@ -157,18 +92,19 @@ export function withMonolithicCfnIncludeCdkApp(block: (co context.output.write(` Test directory: ${integTestDir}\n`); const awsClients = await AwsClients.default(context.output); - await cloneDirectory(path.join(__dirname, '..', 'uberpackage', 'cfn-include-app'), integTestDir, context.output); + await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', 'cfn-include-app'), integTestDir, context.output); const fixture = new TestFixture( integTestDir, stackNamePrefix, context.output, awsClients, + context.randomString, ); let success = true; try { await installNpmPackages(fixture, { - [uberPackage]: FRAMEWORK_VERSION ?? '*', + [uberPackage]: fixture.packages.requestedFrameworkVersion(), }); await block(fixture); @@ -177,7 +113,7 @@ export function withMonolithicCfnIncludeCdkApp(block: (co throw e; } finally { if (process.env.INTEG_NO_CLEAN) { - process.stderr.write(`Left test directory in '${integTestDir}' ($INTEG_NO_CLEAN)\n`); + context.log(`Left test directory in '${integTestDir}' ($INTEG_NO_CLEAN)`); } else { await fixture.dispose(success); } @@ -199,40 +135,6 @@ export function withDefaultFixture(block: (context: TestFixture) => Promise; - - /** - * Don't fail when exiting with an error - * - * @default false - */ - allowErrExit?: boolean; - - /** - * Whether to capture stderr - * - * @default true - */ - captureStderr?: boolean; - - /** - * Pass output here - */ - output?: NodeJS.WritableStream; - - /** - * Only return stderr. For example, this is used to validate - * that when CI=true, all logs are sent to stdout. - * - * @default false - */ - onlyStderr?: boolean; -} - export interface CdkCliOptions extends ShellOptions { options?: string[]; neverRequireApproval?: boolean; @@ -315,29 +217,27 @@ export interface CdkModernBootstrapCommandOptions extends CommonCdkBootstrapComm readonly customPermissionsBoundary?: string; } -export class TestFixture { - public readonly qualifier = randomString().slice(0, 10); +export class TestFixture extends ShellHelper { + public readonly qualifier = this.randomString.slice(0, 10); private readonly bucketsToDelete = new Array(); + public readonly packages: IPackageSource; constructor( public readonly integTestDir: string, public readonly stackNamePrefix: string, public readonly output: NodeJS.WritableStream, - public readonly aws: AwsClients) { + public readonly aws: AwsClients, + public readonly randomString: string) { + + super(integTestDir, output); + + this.packages = packageSourceInSubprocess(); } public log(s: string) { this.output.write(`${s}\n`); } - public async shell(command: string[], options: Omit = {}): Promise { - return shell(command, { - output: this.output, - cwd: this.integTestDir, - ...options, - }); - } - public async cdkDeploy(stackNames: string | string[], options: CdkCliOptions = {}) { stackNames = typeof stackNames === 'string' ? [stackNames] : stackNames; @@ -445,13 +345,15 @@ export class TestFixture { public async cdk(args: string[], options: CdkCliOptions = {}) { const verbose = options.verbose ?? true; + await this.packages.makeCliAvailable(); + return this.shell(['cdk', ...(verbose ? ['-v'] : []), ...args], { ...options, modEnv: { AWS_REGION: this.aws.region, AWS_DEFAULT_REGION: this.aws.region, STACK_NAME_PREFIX: this.stackNamePrefix, - PACKAGE_LAYOUT_VERSION: MAJOR_VERSION, + PACKAGE_LAYOUT_VERSION: this.packages.majorVersion(), ...options.modEnv, }, }); @@ -559,33 +461,6 @@ export class TestFixture { } } -/** - * Perform a one-time quick sanity check that the AWS clients has properly configured credentials - * - * If we don't do this, calls are going to fail and they'll be retried and everything will take - * forever before the user notices a simple misconfiguration. - * - * We can't check for the presence of environment variables since credentials could come from - * anywhere, so do simple account retrieval. - * - * Only do it once per process. - */ -async function sanityCheck(aws: AwsClients) { - if (sanityChecked === undefined) { - try { - await aws.account(); - sanityChecked = true; - } catch (e) { - sanityChecked = false; - throw new Error(`AWS credentials probably not configured, got error: ${e.message}`); - } - } - if (!sanityChecked) { - throw new Error('AWS credentials probably not configured, see previous error'); - } -} -let sanityChecked: boolean | undefined; - /** * Make sure that the given environment is bootstrapped * @@ -611,89 +486,10 @@ async function ensureBootstrapped(fixture: TestFixture) { ALREADY_BOOTSTRAPPED_IN_THIS_RUN.add(envSpecifier); } -/** - * A shell command that does what you want - * - * Is platform-aware, handles errors nicely. - */ -export async function shell(command: string[], options: ShellOptions = {}): Promise { - if (options.modEnv && options.env) { - throw new Error('Use either env or modEnv but not both'); - } - - options.output?.write(`πŸ’» ${command.join(' ')}\n`); - - const env = options.env ?? (options.modEnv ? { ...process.env, ...options.modEnv } : undefined); - - const child = child_process.spawn(command[0], command.slice(1), { - ...options, - env, - // Need this for Windows where we want .cmd and .bat to be found as well. - shell: true, - stdio: ['ignore', 'pipe', 'pipe'], - }); - - return new Promise((resolve, reject) => { - const stdout = new Array(); - const stderr = new Array(); - - child.stdout!.on('data', chunk => { - options.output?.write(chunk); - stdout.push(chunk); - }); - - child.stderr!.on('data', chunk => { - options.output?.write(chunk); - if (options.captureStderr ?? true) { - stderr.push(chunk); - } - }); - - child.once('error', reject); - - child.once('close', code => { - const stderrOutput = Buffer.concat(stderr).toString('utf-8'); - const stdoutOutput = Buffer.concat(stdout).toString('utf-8'); - const output = (options.onlyStderr ? stderrOutput : stdoutOutput + stderrOutput).trim(); - if (code === 0 || options.allowErrExit) { - resolve(output); - } else { - reject(new Error(`'${command.join(' ')}' exited with error code ${code}. Output: \n${output}`)); - } - }); - }); -} - function defined(x: A): x is NonNullable { return x !== undefined; } -/** - * rm -rf reimplementation, don't want to depend on an NPM package for this - */ -export function rimraf(fsPath: string) { - try { - const isDir = fs.lstatSync(fsPath).isDirectory(); - - if (isDir) { - for (const file of fs.readdirSync(fsPath)) { - rimraf(path.join(fsPath, file)); - } - fs.rmdirSync(fsPath); - } else { - fs.unlinkSync(fsPath); - } - } catch (e) { - // We will survive ENOENT - if (e.code !== 'ENOENT') { throw e; } - } -} - -export function randomString() { - // Crazy - return Math.random().toString(36).replace(/[^a-z0-9]+/g, ''); -} - /** * Install the given NPM packages, identified by their names and versions * @@ -713,17 +509,6 @@ export function randomString() { * for Node's dependency lookup mechanism). */ export async function installNpmPackages(fixture: TestFixture, packages: Record) { - if (process.env.REPO_ROOT) { - const monoRepo = await findYarnPackages(process.env.REPO_ROOT); - - // Replace the install target with the physical location of this package - for (const key of Object.keys(packages)) { - if (key in monoRepo) { - packages[key] = monoRepo[key]; - } - } - } - fs.writeFileSync(path.join(fixture.integTestDir, 'package.json'), JSON.stringify({ name: 'cdk-integ-tests', private: true, @@ -732,25 +517,7 @@ export async function installNpmPackages(fixture: TestFixture, packages: Record< }, undefined, 2), { encoding: 'utf-8' }); // Now install that `package.json` using NPM7 - const npm7 = await installNpm7(); - await fixture.shell([npm7, 'install']); + await fixture.shell(['node', require.resolve('npm'), 'install']); } -/** - * Install NPM7 somewhere on the machine and return the path to its binary. - * - * - We install NPM7 explicitly so we don't have to depend on the environment. - * - The install is cached so we don't have to install it over and over again - * for every test. - */ -const installNpm7 = memoize0(async (): Promise => { - const installDir = path.join(os.tmpdir(), 'cdk-integ-npm7'); - await shell(['rm', '-rf', installDir]); - await shell(['mkdir', '-p', installDir]); - - await shell(['npm', 'install', 'npm@7'], { cwd: installDir }); - - return path.join(installDir, 'node_modules', '.bin', 'npm'); -}); - const ALREADY_BOOTSTRAPPED_IN_THIS_RUN = new Set(); diff --git a/packages/@aws-cdk-testing/cli-integ/lib/with-packages.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-packages.ts new file mode 100644 index 0000000000000..f835fee3b333a --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-packages.ts @@ -0,0 +1,15 @@ +import { IPackageSource } from './package-sources/source'; +import { packageSourceInSubprocess } from './package-sources/subprocess'; + +export interface PackageContext { + readonly packages: IPackageSource; +} + +export function withPackages(block: (context: A & PackageContext) => Promise) { + return async (context: A) => { + return block({ + ...context, + packages: packageSourceInSubprocess(), + }); + }; +} \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/helpers/sam.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-sam.ts similarity index 88% rename from packages/aws-cdk/test/integ/helpers/sam.ts rename to packages/@aws-cdk-testing/cli-integ/lib/with-sam.ts index 13683f88caf2e..1016e4b113923 100644 --- a/packages/aws-cdk/test/integ/helpers/sam.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-sam.ts @@ -3,15 +3,11 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import axios from 'axios'; -import { AwsClients } from './aws'; -import { - AwsContext, - cloneDirectory, FRAMEWORK_VERSION, installNpmPackages, - MAJOR_VERSION, - randomString, rimraf, ShellOptions, - TestFixture, withAws, -} from './cdk'; -import { TestContext } from './test-helpers'; +import { TestContext } from './integ-test'; +import { RESOURCES_DIR } from './resources'; +import { ShellOptions, rimraf } from './shell'; +import { AwsContext, withAws } from './with-aws'; +import { cloneDirectory, installNpmPackages, TestFixture } from './with-cdk-app'; export interface ActionOutput { @@ -20,32 +16,32 @@ export interface ActionOutput { shellOutput?: string; } - /** * Higher order function to execute a block with a SAM Integration CDK app fixture */ export function withSamIntegrationCdkApp(block: (context: SamIntegrationTestFixture) => Promise) { return async (context: A) => { - const randy = randomString(); + const randy = context.randomString; const stackNamePrefix = `cdktest-${randy}`; const integTestDir = path.join(os.tmpdir(), `cdk-integ-${randy}`); - context.output.write(` Stack prefix: ${stackNamePrefix}\n`); - context.output.write(` Test directory: ${integTestDir}\n`); - context.output.write(` Region: ${context.aws.region}\n`); + context.log(` Stack prefix: ${stackNamePrefix}\n`); + context.log(` Test directory: ${integTestDir}\n`); + context.log(` Region: ${context.aws.region}\n`); - await cloneDirectory(path.join(__dirname, '..', 'cli', 'sam_cdk_integ_app'), integTestDir, context.output); + await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', 'sam_cdk_integ_app'), integTestDir, context.output); const fixture = new SamIntegrationTestFixture( integTestDir, stackNamePrefix, context.output, - context.aws); + context.aws, + context.randomString); let success = true; try { - const installationVersion = FRAMEWORK_VERSION; + const installationVersion = fixture.packages.requestedFrameworkVersion(); - if (MAJOR_VERSION === '1') { + if (fixture.packages.majorVersion() === '1') { await installNpmPackages(fixture, { '@aws-cdk/aws-iam': installationVersion, '@aws-cdk/aws-apigateway': installationVersion, @@ -58,7 +54,7 @@ export function withSamIntegrationCdkApp(blo 'constructs': '^3', }); } else { - const alphaInstallationVersion = installationVersion.includes('rc') ? installationVersion.replace('rc', 'alpha') : `${installationVersion}-alpha.0`; + const alphaInstallationVersion = fixture.packages.requestedAlphaVersion(); await installNpmPackages(fixture, { 'aws-cdk-lib': installationVersion, '@aws-cdk/aws-lambda-go-alpha': alphaInstallationVersion, @@ -76,7 +72,7 @@ export function withSamIntegrationCdkApp(blo throw e; } finally { if (process.env.INTEG_NO_CLEAN) { - process.stderr.write(`Left test directory in '${integTestDir}' ($INTEG_NO_CLEAN)\n`); + context.log(`Left test directory in '${integTestDir}' ($INTEG_NO_CLEAN)\n`); } else { await fixture.dispose(success); } @@ -121,14 +117,6 @@ export function withSamIntegrationFixture(block: (context: SamIntegrationTestFix } export class SamIntegrationTestFixture extends TestFixture { - constructor( - public readonly integTestDir: string, - public readonly stackNamePrefix: string, - public readonly output: NodeJS.WritableStream, - public readonly aws: AwsClients) { - super(integTestDir, stackNamePrefix, output, aws); - } - public async samShell(command: string[], filter?: string, action?: () => any, options: Omit = {}): Promise { return shellWithAction(command, filter, action, { output: this.output, diff --git a/packages/@aws-cdk-testing/cli-integ/lib/with-temporary-directory.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-temporary-directory.ts new file mode 100644 index 0000000000000..0ff0336940114 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-temporary-directory.ts @@ -0,0 +1,35 @@ +import * as fs from 'fs'; +import * as os from 'os'; +import * as path from 'path'; +import { TestContext } from './integ-test'; +import { rimraf } from './shell'; + +export interface TemporaryDirectoryContext { + readonly integTestDir: string; +} + +export function withTemporaryDirectory(block: (context: A & TemporaryDirectoryContext) => Promise) { + return async (context: A) => { + const integTestDir = path.join(os.tmpdir(), `cdk-integ-${context.randomString}`); + + fs.mkdirSync(integTestDir, { recursive: true }); + + try { + await block({ + ...context, + integTestDir, + }); + + // Clean up in case of success + if (process.env.SKIP_CLEANUP) { + context.log(`Left test directory in '${integTestDir}' ($SKIP_CLEANUP)\n`); + } else { + rimraf(integTestDir); + } + } catch (e) { + context.log(`Left test directory in '${integTestDir}'\n`); + throw e; + } + }; +} + diff --git a/packages/@aws-cdk-testing/cli-integ/lib/xpmutex.ts b/packages/@aws-cdk-testing/cli-integ/lib/xpmutex.ts new file mode 100644 index 0000000000000..4687164a1b5ee --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/lib/xpmutex.ts @@ -0,0 +1,218 @@ +import { watch, promises as fs, mkdirSync } from 'fs'; +import * as os from 'os'; +import * as path from 'path'; + +export class XpMutexPool { + public static fromDirectory(directory: string) { + mkdirSync(directory, { recursive: true }); + return new XpMutexPool(directory); + } + + public static fromName(name: string) { + return XpMutexPool.fromDirectory(path.join(os.tmpdir(), name)); + } + + private readonly waitingResolvers = new Set<() => void>(); + private watcher: ReturnType | undefined; + + private constructor(public readonly directory: string) { + this.startWatch(); + } + + public mutex(name: string) { + return new XpMutex(this, name); + } + + /** + * Await an unlock event + * + * (An unlock event is when a file in the directory gets deleted, with a tiny + * random sleep attached to it). + */ + public awaitUnlock(maxWaitMs?: number): Promise { + const wait = new Promise(ok => { + this.waitingResolvers.add(async () => { + await randomSleep(10); + ok(); + }); + }); + + if (maxWaitMs) { + return Promise.race([wait, sleep(maxWaitMs)]); + } else { + return wait; + } + } + + private startWatch() { + this.watcher = watch(this.directory); + (this.watcher as any).unref(); // @types doesn't know about this but it exists + this.watcher.on('change', async (eventType, fname) => { + // Only trigger on 'deletes'. + // After receiving the event, we check if the file exists. + // - If no: the file was deleted! Huzzah, this counts as a wakeup. + // - If yes: either the file was just created (in which case we don't need to wakeup) + // or the event was due to a delete but someone raced us to it and claimed the + // file already (in which case we also don't need to wake up). + if (eventType === 'rename' && !await fileExists(path.join(this.directory, fname.toString()))) { + this.notifyWaiters(); + } + }); + this.watcher.on('error', async (e) => { + // eslint-disable-next-line no-console + console.error(e); + await randomSleep(100); + this.startWatch(); + }); + } + + private notifyWaiters() { + for (const promise of this.waitingResolvers) { + promise(); + } + this.waitingResolvers.clear(); + } +} + +/** + * Cross-process mutex + * + * Uses the presence of a file on disk and `fs.watch` to represent the mutex + * and discover unlocks. + */ +export class XpMutex { + private readonly fileName: string; + + constructor(private readonly pool: XpMutexPool, public readonly mutexName: string) { + this.fileName = path.join(pool.directory, `${mutexName}.mutex`); + } + + /** + * Try to acquire the lock (may fail) + */ + public async tryAcquire(): Promise { + while (true) { + // Acquire lock by being the one to create the file + try { + return await this.writePidFile('wx'); // Fails if the file already exists + } catch (e) { + if (e.code !== 'EEXIST') { throw e; } + } + + // File already exists. Read the contents, see if it's an existent PID (if so, the lock is taken) + const ownerPid = await this.readPidFile(); + if (ownerPid === undefined) { + // File got deleted just now, maybe we can acquire it again + continue; + } + if (processExists(ownerPid)) { + return undefined; + } + + // If not, the lock is stale and will never be released anymore. We may + // delete it and acquire it anyway, but we may be racing someone else trying + // to do the same. Solve this as follows: + // - Try to acquire a lock that gives us permissions to declare the existing lock stale. + // - Sleep a small random period to reduce contention on this operation + await randomSleep(10); + const innerMux = new XpMutex(this.pool, `${this.mutexName}.${ownerPid}`); + const innerLock = await innerMux.tryAcquire(); + if (!innerLock) { + return undefined; + } + + // We may not release the 'inner lock' we used to acquire the rights to declare the other + // lock stale until we release the actual lock itself. If we did, other contenders might + // see it released while they're still in this fallback block and accidentally steal + // from a new legitimate owner. + return this.writePidFile('w', innerLock); // Force write lock file, attach inner lock as well + } + } + + /** + * Acquire the lock, waiting until we can + */ + public async acquire(): Promise { + while (true) { + // Start the wait here, so we don't miss the signal if it comes after + // we try but before we sleep. + // + // We also periodically retry anyway since we may have missed the delete + // signal due to unfortunate timing. + const wait = this.pool.awaitUnlock(5000); + + const lock = await this.acquire(); + if (lock) { + // Ignore the wait (count as handled) + wait.then(() => {}, () => {}); + return lock; + } + + await wait; + await randomSleep(100); + } + } + + private async readPidFile(): Promise { + const deadLine = Date.now() + 1000; + while (Date.now() < deadLine) { + let contents; + try { + contents = await fs.readFile(this.fileName, { encoding: 'utf-8' }); + } catch (e) { + if (e.code === 'ENOENT') { return undefined; } + throw e; + } + + // Retry until we've seen the full contents + if (contents.endsWith('.')) { return parseInt(contents.substring(0, contents.length - 1), 10); } + await sleep(10); + } + + throw new Error(`${this.fileName} was never completely written`); + } + + private async writePidFile(mode: string, additionalLock?: ILock): Promise { + const fd = await fs.open(this.fileName, mode); // May fail if the file already exists + await fd.write(`${process.pid}.`); // Period guards against partial reads + await fd.close(); + + return { + release: async () => { + await fs.unlink(this.fileName); + await additionalLock?.release(); + }, + }; + } +} + +export interface ILock { + release(): Promise; +} + +async function fileExists(fileName: string) { + try { + await fs.stat(fileName); + return true; + } catch (e) { + if (e.code === 'ENOENT') { return false; } + throw e; + } +} + +function processExists(pid: number) { + try { + process.kill(pid, 0); + return true; + } catch (e) { + return false; + } +} + +function sleep(ms: number): Promise { + return new Promise(ok => (setTimeout(ok, ms) as any).unref()); +} + +function randomSleep(ms: number) { + return sleep(Math.floor(Math.random() * ms)); +} diff --git a/packages/@aws-cdk-testing/cli-integ/package.json b/packages/@aws-cdk-testing/cli-integ/package.json new file mode 100644 index 0000000000000..87664899ef841 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/package.json @@ -0,0 +1,73 @@ +{ + "name": "@aws-cdk-testing/cli-integ", + "description": "Integration tests for the AWS CDK CLI", + "version": "0.0.0", + "bin": { + "run-suite": "bin/run-suite", + "download-and-run-old-tests": "bin/download-and-run-old-tests", + "query-github": "bin/query-github", + "apply-patches": "bin/apply-patches", + "test-root": "bin/test-root", + "stage-distribution": "bin/stage-distribution" + }, + "scripts": { + "build": "cdk-build", + "watch": "cdk-watch", + "lint": "cdk-lint", + "pkglint": "pkglint -f", + "test": "cdk-test", + "package": "cdk-package", + "build+test": "yarn build && yarn test", + "build+extract": "yarn build", + "build+test+package": "yarn build+test && yarn package", + "build+test+extract": "yarn build+test" + }, + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^14.18.31", + "@aws-cdk/cdk-build-tools": "0.0.0", + "@types/semver": "^7.3.12", + "@types/yargs": "^17.0.13", + "@types/fs-extra": "^9.0.0", + "@types/glob": "^7.2.0", + "@types/npm": "^7.19.0", + "@aws-cdk/pkglint": "0.0.0" + }, + "dependencies": { + "@octokit/rest": "^18.12.0", + "jest": "^27.5.1", + "aws-sdk": "^2.1211.0", + "axios": "^0.27.2", + "jest-junit": "^14.0.0", + "semver": "^7.3.8", + "ts-mock-imports": "^1.3.8", + "yargs": "^17.5.0", + "glob": "^7.2.3", + "p-queue": "^6.6.2", + "fs-extra": "^9.1.0", + "npm": "^8.11.0" + }, + "repository": { + "url": "https://github.com/aws/aws-cdk.git", + "type": "git", + "directory": "packages/@aws-cdk-testing/cli-integ" + }, + "keywords": [ + "aws", + "cdk" + ], + "homepage": "https://github.com/aws/aws-cdk", + "engines": { + "node": ">= 14.15.0" + }, + "stability": "experimental", + "maturity": "experimental", + "publishConfig": { + "tag": "latest" + } +} diff --git a/packages/aws-cdk/test/integ/cli/app/app.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/app.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js diff --git a/packages/aws-cdk/test/integ/cli/app/cdk.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/cdk.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/cdk.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/cdk.json diff --git a/packages/aws-cdk/test/integ/cli/app/docker/Dockerfile b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/docker/Dockerfile similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/docker/Dockerfile rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/docker/Dockerfile diff --git a/packages/aws-cdk/test/integ/cli/app/docker/Dockerfile.Custom b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/docker/Dockerfile.Custom similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/docker/Dockerfile.Custom rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/docker/Dockerfile.Custom diff --git a/packages/aws-cdk/test/integ/cli/app/lambda/index.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/lambda/index.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/lambda/index.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/lambda/index.js diff --git a/packages/aws-cdk/test/integ/cli/app/lambda/response.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/lambda/response.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/lambda/response.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/lambda/response.json diff --git a/packages/aws-cdk/test/integ/cli/app/nested-stack.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/nested-stack.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/app/nested-stack.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/nested-stack.js diff --git a/packages/aws-cdk/test/integ/uberpackage/cfn-include-app/.gitignore b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/.gitignore similarity index 100% rename from packages/aws-cdk/test/integ/uberpackage/cfn-include-app/.gitignore rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/.gitignore diff --git a/packages/aws-cdk/test/integ/uberpackage/cfn-include-app/cdk.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/cdk.json similarity index 100% rename from packages/aws-cdk/test/integ/uberpackage/cfn-include-app/cdk.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/cdk.json diff --git a/packages/aws-cdk/test/integ/uberpackage/cfn-include-app/cfn-include-app.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/cfn-include-app.js similarity index 100% rename from packages/aws-cdk/test/integ/uberpackage/cfn-include-app/cfn-include-app.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/cfn-include-app.js diff --git a/packages/aws-cdk/test/integ/uberpackage/cfn-include-app/example-template.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/example-template.json similarity index 100% rename from packages/aws-cdk/test/integ/uberpackage/cfn-include-app/example-template.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/cfn-include-app/example-template.json diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/bin/test-app.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/bin/test-app.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/bin/test-app.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/bin/test-app.js diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/cdk.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/cdk.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/cdk.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/cdk.json diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/lib/nested-stack.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/lib/nested-stack.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/lib/nested-stack.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/lib/nested-stack.js diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/lib/test-stack.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/lib/test-stack.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/lib/test-stack.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/lib/test-stack.js diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/.no-packagejson-validator b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/.no-packagejson-validator similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/.no-packagejson-validator rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/.no-packagejson-validator diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/Dockerfile b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/Dockerfile similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/Dockerfile rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/Dockerfile diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/app.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/app.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/app.js rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/app.js diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/package.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/package.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/package.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/package.json diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.mod b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.mod similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.mod rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.mod diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.sum b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.sum similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.sum rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/go/GoFunctionConstruct/go.sum diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/go/GoFunctionConstruct/main.go b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/go/GoFunctionConstruct/main.go similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/go/GoFunctionConstruct/main.go rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/go/GoFunctionConstruct/main.go diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/.no-packagejson-validator b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/.no-packagejson-validator similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/.no-packagejson-validator rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/.no-packagejson-validator diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/app.ts b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/app.ts similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/app.ts rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/app.ts diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package-lock.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package-lock.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package-lock.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package-lock.json diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package.json b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package.json rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/nodejs/NodeJsFunctionConstruct/package.json diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Function/app.py b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Function/app.py similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Function/app.py rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Function/app.py diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Function/requirements.txt b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Function/requirements.txt similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Function/requirements.txt rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Function/requirements.txt diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Layer/layer_version_dependency.py b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Layer/layer_version_dependency.py similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Layer/layer_version_dependency.py rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Layer/layer_version_dependency.py diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Layer/requirements.txt b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Layer/requirements.txt similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/python/Layer/requirements.txt rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/python/Layer/requirements.txt diff --git a/packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/rest-api-definition.yaml b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/rest-api-definition.yaml similarity index 100% rename from packages/aws-cdk/test/integ/cli/sam_cdk_integ_app/src/rest-api-definition.yaml rename to packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/src/rest-api-definition.yaml diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.119.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.119.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.119.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.119.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.119.0/cli.integtest.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.119.0/cli.integtest.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.119.0/cli.integtest.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.119.0/cli.integtest.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.130.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.130.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.130.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.130.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.130.0/app/app.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.130.0/app/app.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.130.0/app/app.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.130.0/app/app.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.130.0/bootstrapping.integtest.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.130.0/bootstrapping.integtest.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.130.0/bootstrapping.integtest.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.130.0/bootstrapping.integtest.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.44.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.44.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.44.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.44.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.44.0/bootstrapping.integtest.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.44.0/bootstrapping.integtest.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.44.0/bootstrapping.integtest.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.44.0/bootstrapping.integtest.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.44.0/test.sh b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.44.0/test.sh similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.44.0/test.sh rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.44.0/test.sh diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.61.1/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.61.1/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.61.1/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.61.1/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.61.1/skip-tests.txt b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.61.1/skip-tests.txt similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.61.1/skip-tests.txt rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.61.1/skip-tests.txt diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.62.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.62.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.62.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.62.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.62.0/aws-helpers.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.62.0/aws-helpers.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.62.0/aws-helpers.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.62.0/aws-helpers.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.63.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.63.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.63.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.63.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.63.0/skip-tests.txt b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.63.0/skip-tests.txt similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.63.0/skip-tests.txt rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.63.0/skip-tests.txt diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.64.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.64.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.64.0/cdk-helpers.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.0/cdk-helpers.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.64.0/cdk-helpers.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.0/cdk-helpers.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.64.0/cli.integtest.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.0/cli.integtest.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.64.0/cli.integtest.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.0/cli.integtest.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.64.1/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.1/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.64.1/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.1/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.64.1/cdk-helpers.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.1/cdk-helpers.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.64.1/cdk-helpers.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.1/cdk-helpers.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.64.1/cli.integtest.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.1/cli.integtest.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.64.1/cli.integtest.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.64.1/cli.integtest.js diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.67.0/NOTES.md b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.67.0/NOTES.md similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.67.0/NOTES.md rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.67.0/NOTES.md diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/v1.67.0/cdk-helpers.js b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.67.0/cdk-helpers.js similarity index 100% rename from packages/aws-cdk/test/integ/cli-regression-patches/v1.67.0/cdk-helpers.js rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v1.67.0/cdk-helpers.js diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/0.36.0/InitStack.template.json b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/0.36.0/InitStack.template.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/0.36.0/InitStack.template.json rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/0.36.0/InitStack.template.json diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/0.36.0/cdk.out b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/0.36.0/cdk.out similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/0.36.0/cdk.out rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/0.36.0/cdk.out diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/0.36.0/manifest.json b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/0.36.0/manifest.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/0.36.0/manifest.json rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/0.36.0/manifest.json diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-lookup-default-vpc/InitStack.template.json b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-lookup-default-vpc/InitStack.template.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-lookup-default-vpc/InitStack.template.json rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-lookup-default-vpc/InitStack.template.json diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-lookup-default-vpc/cdk.out b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-lookup-default-vpc/cdk.out similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-lookup-default-vpc/cdk.out rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-lookup-default-vpc/cdk.out diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-lookup-default-vpc/manifest.json.js b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-lookup-default-vpc/manifest.json.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-lookup-default-vpc/manifest.json.js rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-lookup-default-vpc/manifest.json.js diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-request-azs/InitStack.template.json b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-request-azs/InitStack.template.json similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-request-azs/InitStack.template.json rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-request-azs/InitStack.template.json diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-request-azs/cdk.out b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-request-azs/cdk.out similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-request-azs/cdk.out rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-request-azs/cdk.out diff --git a/packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-request-azs/manifest.json.js b/packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-request-azs/manifest.json.js similarity index 100% rename from packages/aws-cdk/test/integ/cli/cloud-assemblies/1.10.0-request-azs/manifest.json.js rename to packages/@aws-cdk-testing/cli-integ/resources/cloud-assemblies/1.10.0-request-azs/manifest.json.js diff --git a/packages/@aws-cdk-testing/cli-integ/resources/integ.jest.config.js b/packages/@aws-cdk-testing/cli-integ/resources/integ.jest.config.js new file mode 100644 index 0000000000000..e72d95ff70da6 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/resources/integ.jest.config.js @@ -0,0 +1,25 @@ +const path = require('path'); + +const rootDir = path.resolve(__dirname, '..', 'tests', process.env.TEST_SUITE_NAME); + +if (rootDir.includes('node_modules')) { + // Jest < 28 under no circumstances supports loading test if there's node_modules anywhere in the path, + // and Jest >= 28 requires a newer TypeScript version than the one we support. + throw new Error(`This package must not be 'npm install'ed (found node_modules in dir: ${rootDir})`); +} + +module.exports = { + rootDir, + testMatch: [`**/*.integtest.js`], + moduleFileExtensions: ["js"], + + testEnvironment: "node", + testTimeout: 300000, + + // Affects test.concurrent(), these are self-limiting anyway + maxConcurrency: 10, + reporters: [ + "default", + [ "jest-junit", { suiteName: "jest tests", outputDirectory: "coverage" } ] + ] +}; diff --git a/packages/aws-cdk/test/integ/helpers/skip-tests.txt b/packages/@aws-cdk-testing/cli-integ/skip-tests.txt similarity index 100% rename from packages/aws-cdk/test/integ/helpers/skip-tests.txt rename to packages/@aws-cdk-testing/cli-integ/skip-tests.txt diff --git a/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts b/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts new file mode 100644 index 0000000000000..18f153778bb5f --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts @@ -0,0 +1,84 @@ +import { sleep } from '../lib'; +import { ResourcePool } from '../lib/resource-pool'; + +const POOL_NAME = 'resource-pool.test'; + +test('take and dispose', async () => { + const pool = ResourcePool.withResources(POOL_NAME, ['a']); + const take1 = pool.take(); + const take2 = pool.take(); + + let released = false; + + const lease1 = await take1; + // awaiting 'take2' would now block but we add an async + // handler to it to flip a boolean to see when it gets activated. + void(take2.then(() => released = true)); + + expect(lease1.value).toEqual('a'); + await waitTick(); + expect(released).toEqual(false); + + await lease1.dispose(); + await waitTick(); // This works because setImmediate is scheduled in LIFO order + + const lease2 = await take2; + await lease2.dispose(); + expect(released).toEqual(true); +}); + +test('double dispose throws', async () => { + const pool = ResourcePool.withResources(POOL_NAME, ['a']); + const lease = await pool.take(); + + await lease.dispose(); + expect(() => lease.dispose()).toThrow(); +}); + +test('somewhat balance', async () => { + const counters = { + a: 0, + b: 0, + c: 0, + d: 0, + e: 0, + }; + const N = 100; + let maxConcurrency = 0; + let concurrency = 0; + + const keys = Object.keys(counters) as Array ; + const pool = ResourcePool.withResources(POOL_NAME, keys); + await Promise.all(Array.from(range(N)).map(() => + pool.using(async (x) => { + counters[x] += 1; + concurrency += 1; + maxConcurrency = Math.max(maxConcurrency, concurrency); + try { + await sleep(10); + } finally { + concurrency -= 1; + } + }), + )); + + // Regardless of which resource(s) we used, the total count should add up to N + const sum = Object.values(counters).reduce((a, b) => a + b, 0); + expect(sum).toEqual(N); + // There was concurrency + expect(maxConcurrency).toBeGreaterThan(2); + // All counters are used + for (const count of Object.values(counters)) { + expect(count).toBeGreaterThan(0); + } +}); + +function waitTick() { + return new Promise(setImmediate); +} + +function* range(n: number) { + for (let i = 0; i < n; i++) { + yield i; + } +} \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/cli/README.md b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/README.md similarity index 99% rename from packages/aws-cdk/test/integ/cli/README.md rename to packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/README.md index 0a174245e8504..a26666bff695e 100644 --- a/packages/aws-cdk/test/integ/cli/README.md +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/README.md @@ -17,7 +17,6 @@ Running against a failing dist build: .../CMkBR4V$ package/test/integ/run-against-dist package/test/integ/cli/test.sh ``` - ## Adding tests Even though tests are now written in TypeScript, this does not diff --git a/packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts similarity index 96% rename from packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts rename to packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts index 037b241f3bc92..0666443dce013 100644 --- a/packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts @@ -1,13 +1,8 @@ import * as fs from 'fs'; import * as path from 'path'; -import { randomString, withDefaultFixture } from '../helpers/cdk'; -import { integTest } from '../helpers/test-helpers'; - -const timeout = process.env.CODEBUILD_BUILD_ID ? // if the process is running in CodeBuild - 3_600_000 : // 1 hour - 600_000; // 10 minutes -jest.setTimeout(timeout); -process.stdout.write(`bootstrapping.integtest.ts: Setting jest time out to ${timeout} ms`); +import { integTest, randomString, withDefaultFixture } from '../../lib'; + +jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime integTest('can bootstrap without execution', withDefaultFixture(async (fixture) => { const bootstrapStackName = fixture.bootstrapStackName; diff --git a/packages/aws-cdk/test/integ/cli/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts similarity index 93% rename from packages/aws-cdk/test/integ/cli/cli.integtest.ts rename to packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index bac932e23ea4b..eea6797aeb99e 100644 --- a/packages/aws-cdk/test/integ/cli/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -1,12 +1,9 @@ import { promises as fs, existsSync } from 'fs'; import * as os from 'os'; import * as path from 'path'; -import { retry, sleep } from '../helpers/aws'; -import { cloneDirectory, MAJOR_VERSION, shell, withDefaultFixture } from '../helpers/cdk'; -import { randomInteger, withSamIntegrationFixture } from '../helpers/sam'; -import { integTest } from '../helpers/test-helpers'; +import { integTest, cloneDirectory, shell, withDefaultFixture, retry, sleep, randomInteger, withSamIntegrationFixture, RESOURCES_DIR } from '../../lib'; -jest.setTimeout(600_000); +jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime describe('ci', () => { integTest('output to stderr', withDefaultFixture(async (fixture) => { @@ -486,86 +483,88 @@ integTest('deploy with notification ARN', withDefaultFixture(async (fixture) => } })); -if (MAJOR_VERSION === '1') { - // NOTE: this doesn't currently work with modern-style synthesis, as the bootstrap - // role by default will not have permission to iam:PassRole the created role. - integTest('deploy with role', withDefaultFixture(async (fixture) => { - const roleName = `${fixture.stackNamePrefix}-test-role`; - - await deleteRole(); +// NOTE: this doesn't currently work with modern-style synthesis, as the bootstrap +// role by default will not have permission to iam:PassRole the created role. +integTest('deploy with role', withDefaultFixture(async (fixture) => { + if (fixture.packages.majorVersion() !== '1') { + return; // Nothing to do + } - const createResponse = await fixture.aws.iam('createRole', { + const roleName = `${fixture.stackNamePrefix}-test-role`; + + await deleteRole(); + + const createResponse = await fixture.aws.iam('createRole', { + RoleName: roleName, + AssumeRolePolicyDocument: JSON.stringify({ + Version: '2012-10-17', + Statement: [{ + Action: 'sts:AssumeRole', + Principal: { Service: 'cloudformation.amazonaws.com' }, + Effect: 'Allow', + }, { + Action: 'sts:AssumeRole', + Principal: { AWS: (await fixture.aws.sts('getCallerIdentity', {})).Arn }, + Effect: 'Allow', + }], + }), + }); + const roleArn = createResponse.Role.Arn; + try { + await fixture.aws.iam('putRolePolicy', { RoleName: roleName, - AssumeRolePolicyDocument: JSON.stringify({ + PolicyName: 'DefaultPolicy', + PolicyDocument: JSON.stringify({ Version: '2012-10-17', Statement: [{ - Action: 'sts:AssumeRole', - Principal: { Service: 'cloudformation.amazonaws.com' }, - Effect: 'Allow', - }, { - Action: 'sts:AssumeRole', - Principal: { AWS: (await fixture.aws.sts('getCallerIdentity', {})).Arn }, + Action: '*', + Resource: '*', Effect: 'Allow', }], }), }); - const roleArn = createResponse.Role.Arn; - try { - await fixture.aws.iam('putRolePolicy', { - RoleName: roleName, - PolicyName: 'DefaultPolicy', - PolicyDocument: JSON.stringify({ - Version: '2012-10-17', - Statement: [{ - Action: '*', - Resource: '*', - Effect: 'Allow', - }], - }), - }); - await retry(fixture.output, 'Trying to assume fresh role', retry.forSeconds(300), async () => { - await fixture.aws.sts('assumeRole', { - RoleArn: roleArn, - RoleSessionName: 'testing', - }); + await retry(fixture.output, 'Trying to assume fresh role', retry.forSeconds(300), async () => { + await fixture.aws.sts('assumeRole', { + RoleArn: roleArn, + RoleSessionName: 'testing', }); + }); - // In principle, the role has replicated from 'us-east-1' to wherever we're testing. - // Give it a little more sleep to make sure CloudFormation is not hitting a box - // that doesn't have it yet. - await sleep(5000); + // In principle, the role has replicated from 'us-east-1' to wherever we're testing. + // Give it a little more sleep to make sure CloudFormation is not hitting a box + // that doesn't have it yet. + await sleep(5000); - await fixture.cdkDeploy('test-2', { - options: ['--role-arn', roleArn], - }); + await fixture.cdkDeploy('test-2', { + options: ['--role-arn', roleArn], + }); - // Immediately delete the stack again before we delete the role. - // - // Since roles are sticky, if we delete the role before the stack, subsequent DeleteStack - // operations will fail when CloudFormation tries to assume the role that's already gone. - await fixture.cdkDestroy('test-2'); + // Immediately delete the stack again before we delete the role. + // + // Since roles are sticky, if we delete the role before the stack, subsequent DeleteStack + // operations will fail when CloudFormation tries to assume the role that's already gone. + await fixture.cdkDestroy('test-2'); - } finally { - await deleteRole(); - } + } finally { + await deleteRole(); + } - async function deleteRole() { - try { - for (const policyName of (await fixture.aws.iam('listRolePolicies', { RoleName: roleName })).PolicyNames) { - await fixture.aws.iam('deleteRolePolicy', { - RoleName: roleName, - PolicyName: policyName, - }); - } - await fixture.aws.iam('deleteRole', { RoleName: roleName }); - } catch (e) { - if (e.message.indexOf('cannot be found') > -1) { return; } - throw e; + async function deleteRole() { + try { + for (const policyName of (await fixture.aws.iam('listRolePolicies', { RoleName: roleName })).PolicyNames) { + await fixture.aws.iam('deleteRolePolicy', { + RoleName: roleName, + PolicyName: policyName, + }); } + await fixture.aws.iam('deleteRole', { RoleName: roleName }); + } catch (e) { + if (e.message.indexOf('cannot be found') > -1) { return; } + throw e; } - })); -} + } +})); integTest('cdk diff', withDefaultFixture(async (fixture) => { const diff1 = await fixture.cdk(['diff', fixture.fullStackName('test-1')]); @@ -791,7 +790,7 @@ integTest('failed deploy does not hang', withDefaultFixture(async (fixture) => { integTest('can still load old assemblies', withDefaultFixture(async (fixture) => { const cxAsmDir = path.join(os.tmpdir(), 'cdk-integ-cx'); - const testAssembliesDirectory = path.join(__dirname, 'cloud-assemblies'); + const testAssembliesDirectory = path.join(RESOURCES_DIR, 'cloud-assemblies'); for (const asmdir of await listChildDirs(testAssembliesDirectory)) { fixture.log(`ASSEMBLY ${asmdir}`); await cloneDirectory(asmdir, cxAsmDir); diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-csharp/init-csharp.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-csharp/init-csharp.integtest.ts new file mode 100644 index 0000000000000..a36b1d628347e --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-csharp/init-csharp.integtest.ts @@ -0,0 +1,16 @@ +import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib'; + +['app', 'sample-app'].forEach(template => { + integTest(`init Cβ™― ${template}`, withTemporaryDirectory(withPackages(async (context) => { + context.packages.assertJsiiPackagesAvailable(); + + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'csharp', template]); + await context.packages.initializeDotnetPackages(context.integTestDir); + await shell.shell(['cdk', 'synth']); + }))); +}); + + diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-fsharp/init-fsharp.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-fsharp/init-fsharp.integtest.ts new file mode 100644 index 0000000000000..fdc1fca2d4cd1 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-fsharp/init-fsharp.integtest.ts @@ -0,0 +1,15 @@ +import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib'; + +['app', 'sample-app'].forEach(template => { + integTest(`init Fβ™― ${template}`, withTemporaryDirectory(withPackages(async (context) => { + context.packages.assertJsiiPackagesAvailable(); + + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'fsharp', template]); + await context.packages.initializeDotnetPackages(context.integTestDir); + await shell.shell(['cdk', 'synth']); + }))); +}); + diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-java/init-java.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-java/init-java.integtest.ts new file mode 100644 index 0000000000000..48d5b38b1e2db --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-java/init-java.integtest.ts @@ -0,0 +1,14 @@ +import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib'; + +['app', 'sample-app'].forEach(template => { + integTest(`init java ${template}`, withTemporaryDirectory(withPackages(async (context) => { + context.packages.assertJsiiPackagesAvailable(); + + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'java', template]); + await shell.shell(['mvn', 'package']); + await shell.shell(['cdk', 'synth']); + }))); +}); diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-javascript/init-javascript.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-javascript/init-javascript.integtest.ts new file mode 100644 index 0000000000000..8fc4be4bf64fb --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-javascript/init-javascript.integtest.ts @@ -0,0 +1,15 @@ +import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib'; + +['app', 'sample-app'].forEach(template => { + integTest(`init javascript ${template}`, withTemporaryDirectory(withPackages(async (context) => { + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'javascript', template]); + await shell.shell(['npm', 'prune']); + await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies + await shell.shell(['npm', 'run', 'test']); + + await shell.shell(['cdk', 'synth']); + }))); +}); diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-python/init-python.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-python/init-python.integtest.ts new file mode 100644 index 0000000000000..f7839fd9a0e15 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-python/init-python.integtest.ts @@ -0,0 +1,20 @@ +import * as path from 'path'; +import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib'; + +['app', 'sample-app'].forEach(template => { + integTest(`init python ${template}`, withTemporaryDirectory(withPackages(async (context) => { + context.packages.assertJsiiPackagesAvailable(); + + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'python', template]); + const venvPath = path.resolve(context.integTestDir, '.venv'); + const venv = { PATH: `${venvPath}/bin:${process.env.PATH}`, VIRTUAL_ENV: venvPath }; + + await shell.shell([`${venvPath}/bin/pip`, 'install', '-r', 'requirements.txt'], { modEnv: venv }); + await shell.shell([`${venvPath}/bin/pip`, 'install', '-r', 'requirements-dev.txt'], { modEnv: venv }); + await shell.shell([`${venvPath}/bin/pytest`], { modEnv: venv }); + await shell.shell(['cdk', 'synth'], { modEnv: venv }); + }))); +}); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-typescript-app/init-typescript-app.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-typescript-app/init-typescript-app.integtest.ts new file mode 100644 index 0000000000000..158764ef3c973 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-typescript-app/init-typescript-app.integtest.ts @@ -0,0 +1,58 @@ +import { promises as fs } from 'fs'; +import * as path from 'path'; +import { integTest, withTemporaryDirectory, ShellHelper, withPackages, TemporaryDirectoryContext } from '../../lib'; +import { typescriptVersionsSync } from '../../lib/npm'; + +['app', 'sample-app'].forEach(template => { + integTest(`typescript init ${template}`, withTemporaryDirectory(withPackages(async (context) => { + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'typescript', template]); + + await shell.shell(['npm', 'prune']); + await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies + await shell.shell(['npm', 'run', 'build']); + await shell.shell(['npm', 'run', 'test']); + + await shell.shell(['cdk', 'synth']); + }))); +}); + +/** + * Test our generated code with various versions of TypeScript + */ +typescriptVersionsSync().forEach(tsVersion => { + integTest(`typescript ${tsVersion} init app`, withTemporaryDirectory(withPackages(async (context) => { + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['node', '--version']); + await shell.shell(['npm', '--version']); + + await shell.shell(['cdk', 'init', '-l', 'typescript', 'app', '--generate-only']); + + // Necessary because recent versions of ts-jest require TypeScript>=4.3 but we + // still want to test with older versions as well. + await removeDevDependencies(context); + + await shell.shell(['npm', 'install', '--save-dev', `typescript@${tsVersion}`]); + await shell.shell(['npm', 'install']); // Older versions of npm require this to be a separate step from the one above + await shell.shell(['npx', 'tsc', '--version']); + await shell.shell(['npm', 'prune']); + await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies + + // We just removed the 'jest' dependency so remove the tests as well because they won't compile + await shell.shell(['rm', '-rf', 'test/']); + + await shell.shell(['npm', 'run', 'build']); + await shell.shell(['cdk', 'synth']); + }))); +}); + +async function removeDevDependencies(context: TemporaryDirectoryContext) { + const filename = path.join(context.integTestDir, 'package.json'); + const pj = JSON.parse(await fs.readFile(filename, { encoding: 'utf-8' })); + delete pj.devDependencies; + await fs.writeFile(filename, JSON.stringify(pj, undefined, 2), { encoding: 'utf-8' }); +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-typescript-lib/init-typescript-lib.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-typescript-lib/init-typescript-lib.integtest.ts new file mode 100644 index 0000000000000..12472c82709cc --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-typescript-lib/init-typescript-lib.integtest.ts @@ -0,0 +1,13 @@ +import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib'; + +integTest('typescript init lib', withTemporaryDirectory(withPackages(async (context) => { + const shell = ShellHelper.fromContext(context); + await context.packages.makeCliAvailable(); + + await shell.shell(['cdk', 'init', '-l', 'typescript', 'lib']); + + await shell.shell(['npm', 'prune']); + await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies + await shell.shell(['npm', 'run', 'build']); + await shell.shell(['npm', 'run', 'test']); +}))); \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/uberpackage/uberpackage.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/uberpackage/uberpackage.integtest.ts similarity index 69% rename from packages/aws-cdk/test/integ/uberpackage/uberpackage.integtest.ts rename to packages/@aws-cdk-testing/cli-integ/tests/uberpackage/uberpackage.integtest.ts index 6521e4c8113a0..ee924b783f377 100644 --- a/packages/aws-cdk/test/integ/uberpackage/uberpackage.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/uberpackage/uberpackage.integtest.ts @@ -1,5 +1,4 @@ -import { withMonolithicCfnIncludeCdkApp } from '../helpers/cdk'; -import { integTest } from '../helpers/test-helpers'; +import { integTest, withMonolithicCfnIncludeCdkApp } from '../../lib'; jest.setTimeout(600_000); diff --git a/packages/@aws-cdk-testing/cli-integ/tsconfig.json b/packages/@aws-cdk-testing/cli-integ/tsconfig.json new file mode 100644 index 0000000000000..f03765e562835 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "lib": ["es2019", "es2020", "dom"], + "strict": true, + "alwaysStrict": true, + "declaration": true, + "inlineSourceMap": true, + "inlineSources": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "resolveJsonModule": true, + "composite": true, + "incremental": true + }, + "include": [ + "**/*.ts", + "**/*.d.ts" + ], + "exclude": [ + "resources/**/*" + ] +} diff --git a/packages/@aws-cdk/aws-apprunner/README.md b/packages/@aws-cdk/aws-apprunner/README.md index de5aa782b26df..ffbec457413ab 100644 --- a/packages/@aws-cdk/aws-apprunner/README.md +++ b/packages/@aws-cdk/aws-apprunner/README.md @@ -160,3 +160,39 @@ new apprunner.Service(this, 'Service', { vpcConnector, }); ``` + +## Secrets Manager + +To include environment variables integrated with AWS Secrets Manager, use the `environmentSecrets` attribute. +You can use the `addSecret` method from the App Runner `Service` class to include secrets from outside the +service definition. + +```ts +import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import * as ssm from '@aws-cdk/aws-ssm'; + +declare const stack: Stack; + +const secret = new secretsmanager.Secret(stack, 'Secret'); +const parameter = ssm.StringParameter.fromSecureStringParameterAttributes(stack, 'Parameter', { + parameterName: '/name', + version: 1, +}); + +const service = new apprunner.Service(stack, 'Service', { + source: apprunner.Source.fromEcrPublic({ + imageConfiguration: { + port: 8000, + environmentSecrets: { + SECRET: apprunner.Secret.fromSecretsManager(secret), + PARAMETER: apprunner.Secret.fromSsmParameter(parameter), + SECRET_ID: apprunner.Secret.fromSecretsManagerVersion(secret, { versionId: 'version-id' }), + SECRET_STAGE: apprunner.Secret.fromSecretsManagerVersion(secret, { versionStage: 'version-stage' }), + }, + }, + imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + }) +}); + +service.addSecret('LATER_SECRET', apprunner.Secret.fromSecretsManager(secret, 'field')); +``` diff --git a/packages/@aws-cdk/aws-apprunner/lib/service.ts b/packages/@aws-cdk/aws-apprunner/lib/service.ts index a37b5b6d40104..4ab5553ad0442 100644 --- a/packages/@aws-cdk/aws-apprunner/lib/service.ts +++ b/packages/@aws-cdk/aws-apprunner/lib/service.ts @@ -1,6 +1,8 @@ import * as ecr from '@aws-cdk/aws-ecr'; import * as assets from '@aws-cdk/aws-ecr-assets'; import * as iam from '@aws-cdk/aws-iam'; +import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnService } from './apprunner.generated'; @@ -160,6 +162,14 @@ export class Runtime { private constructor(public readonly name: string) { } } +/** + * The environment secret for the service. + */ +interface EnvironmentSecret { + readonly name: string; + readonly value: string; +} + /** * The environment variable for the service. */ @@ -227,7 +237,6 @@ export interface GithubRepositoryProps { readonly connection: GitHubConnection; } - /** * Properties of the image repository for `Source.fromEcrPublic()` */ @@ -238,6 +247,7 @@ export interface EcrPublicProps { * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imageconfiguration.html#cfn-apprunner-service-imageconfiguration-port */ readonly imageConfiguration?: ImageConfiguration; + /** * The ECR Public image URI. */ @@ -254,16 +264,19 @@ export interface EcrProps { * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imageconfiguration.html#cfn-apprunner-service-imageconfiguration-port */ readonly imageConfiguration?: ImageConfiguration; + /** * Represents the ECR repository. */ readonly repository: ecr.IRepository; + /** * Image tag. * @default - 'latest' * @deprecated use `tagOrDigest` */ readonly tag?: string; + /** * Image tag or digest (digests must start with `sha256:`). * @default - 'latest' @@ -281,12 +294,31 @@ export interface AssetProps { * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imageconfiguration.html#cfn-apprunner-service-imageconfiguration-port */ readonly imageConfiguration?: ImageConfiguration; + /** * Represents the docker image asset. */ readonly asset: assets.DockerImageAsset; } +/** + * Specify the secret's version id or version stage + */ +export interface SecretVersionInfo { + /** + * version id of the secret + * + * @default - use default version id + */ + readonly versionId?: string; + + /** + * version stage of the secret + * + * @default - use default version stage + */ + readonly versionStage?: string; +} /** * Represents the App Runner service source. @@ -298,24 +330,28 @@ export abstract class Source { public static fromGitHub(props: GithubRepositoryProps): GithubSource { return new GithubSource(props); } + /** * Source from the ECR repository. */ public static fromEcr(props: EcrProps): EcrSource { return new EcrSource(props); } + /** * Source from the ECR Public repository. */ public static fromEcrPublic(props: EcrPublicProps): EcrPublicSource { return new EcrPublicSource(props); } + /** * Source from local assets. */ public static fromAsset(props: AssetProps): AssetSource { return new AssetSource(props); } + /** * Called when the Job is initialized to allow this object to bind. */ @@ -348,6 +384,7 @@ export class GithubSource extends Source { }; } } + /** * Represents the service source from ECR. */ @@ -430,8 +467,23 @@ export interface ImageConfiguration { * Environment variables that are available to your running App Runner service. * * @default - no environment variables + * @deprecated use environmentVariables. */ - readonly environment?: { [key: string]: string }; + readonly environment?: { [key: string]: string } + + /** + * Environment variables that are available to your running App Runner service. + * + * @default - no environment variables + */ + readonly environmentVariables?: { [key: string]: string }; + + /** + * Environment secrets that are available to your running App Runner service. + * + * @default - no environment secrets + */ + readonly environmentSecrets?: { [key: string]: Secret; }; /** * An optional command that App Runner runs to start the application in the source image. @@ -666,9 +718,24 @@ export interface CodeConfigurationValues { * The environment variables that are available to your running App Runner service. * * @default - no environment variables. + * @deprecated use environmentVariables. */ readonly environment?: { [key: string]: string }; + /** + * The environment variables that are available to your running App Runner service. + * + * @default - no environment variables. + */ + readonly environmentVariables?: { [key: string]: string }; + + /** + * The environment secrets that are available to your running App Runner service. + * + * @default - no environment secrets. + */ + readonly environmentSecrets?: { [key: string]: Secret }; + /** * The command App Runner runs to start your application. * @@ -690,6 +757,7 @@ export class GitHubConnection { public static fromConnectionArn(arn: string): GitHubConnection { return new GitHubConnection(arn); } + /** * The ARN of the Connection for App Runner service to connect to the repository. */ @@ -739,6 +807,74 @@ export interface IService extends cdk.IResource { readonly serviceArn: string; } +/** + * A secret environment variable. + */ +export abstract class Secret { + /** + * Creates an environment variable value from a parameter stored in AWS + * Systems Manager Parameter Store. + */ + public static fromSsmParameter(parameter: ssm.IParameter): Secret { + return { + arn: parameter.parameterArn, + grantRead: grantee => parameter.grantRead(grantee), + }; + } + + /** + * Creates a environment variable value from a secret stored in AWS Secrets + * Manager. + * + * @param secret the secret stored in AWS Secrets Manager + * @param field the name of the field with the value that you want to set as + * the environment variable value. Only values in JSON format are supported. + * If you do not specify a JSON field, then the full content of the secret is + * used. + */ + public static fromSecretsManager(secret: secretsmanager.ISecret, field?: string): Secret { + return { + arn: field ? `${secret.secretArn}:${field}::` : secret.secretArn, + hasField: !!field, + grantRead: grantee => secret.grantRead(grantee), + }; + } + + /** + * Creates a environment variable value from a secret stored in AWS Secrets + * Manager. + * + * @param secret the secret stored in AWS Secrets Manager + * @param versionInfo the version information to reference the secret + * @param field the name of the field with the value that you want to set as + * the environment variable value. Only values in JSON format are supported. + * If you do not specify a JSON field, then the full content of the secret is + * used. + */ + public static fromSecretsManagerVersion(secret: secretsmanager.ISecret, versionInfo: SecretVersionInfo, field?: string): Secret { + return { + arn: `${secret.secretArn}:${field ?? ''}:${versionInfo.versionStage ?? ''}:${versionInfo.versionId ?? ''}`, + hasField: !!field, + grantRead: grantee => secret.grantRead(grantee), + }; + } + + /** + * The ARN of the secret + */ + public abstract readonly arn: string; + + /** + * Whether this secret uses a specific JSON field + */ + public abstract readonly hasField?: boolean; + + /** + * Grants reading the secret to a principal + */ + public abstract grantRead(grantee: iam.IGrantable): iam.Grant; +} + /** * The App Runner Service. */ @@ -778,11 +914,35 @@ export class Service extends cdk.Resource { } private readonly props: ServiceProps; private accessRole?: iam.IRole; + private instanceRole?: iam.IRole; private source: SourceConfig; + /** - * Environment variables for this service + * Environment variables for this service. + * + * @deprecated use environmentVariables. */ - private environment?: { [key: string]: string } = {}; + readonly environment: { [key: string]: string } = {}; + + /** + * Environment variables for this service. + */ + private environmentVariables: { [key: string]: string } = {}; + + /** + * Environment secrets for this service. + */ + private environmentSecrets: { [key: string]: Secret; } = {}; + + /** + * Environment secrets for this service. + */ + private readonly secrets: EnvironmentSecret[] = [] + + /** + * Environment variables for this service. + */ + private readonly variables: EnvironmentVariable[] = [] /** * The ARN of the Service. @@ -821,25 +981,36 @@ export class Service extends cdk.Resource { this.source = source; this.props = props; - // generate an IAM role only when ImageRepositoryType is ECR and props.role is undefined + this.environmentVariables = this.getEnvironmentVariables(); + this.environmentSecrets = this.getEnvironmentSecrets(); + + // generate an IAM role only when ImageRepositoryType is ECR and props.accessRole is undefined this.accessRole = (this.source.imageRepository?.imageRepositoryType == ImageRepositoryType.ECR) ? - this.props.accessRole ? this.props.accessRole : this.generateDefaultRole() : undefined; + this.props.accessRole ?? this.generateDefaultRole() : undefined; - if (source.codeRepository?.codeConfiguration.configurationSource == ConfigurationSourceType.REPOSITORY && - source.codeRepository?.codeConfiguration.configurationValues) { + // generalte an IAM role only when environmentSecrets has values and props.instanceRole is undefined + this.instanceRole = (Object.keys(this.environmentSecrets).length > 0 && !this.props.instanceRole) ? + this.createInstanceRole() : this.props.instanceRole; + + if (this.source.codeRepository?.codeConfiguration.configurationSource == ConfigurationSourceType.REPOSITORY && + this.source.codeRepository?.codeConfiguration.configurationValues) { throw new Error('configurationValues cannot be provided if the ConfigurationSource is Repository'); } const resource = new CfnService(this, 'Resource', { instanceConfiguration: { - cpu: props.cpu?.unit, - memory: props.memory?.unit, - instanceRoleArn: props.instanceRole?.roleArn, + cpu: this.props.cpu?.unit, + memory: this.props.memory?.unit, + instanceRoleArn: this.instanceRole?.roleArn, }, sourceConfiguration: { authenticationConfiguration: this.renderAuthenticationConfiguration(), - imageRepository: source.imageRepository ? this.renderImageRepository() : undefined, - codeRepository: source.codeRepository ? this.renderCodeConfiguration() : undefined, + imageRepository: this.source.imageRepository ? + this.renderImageRepository(this.source.imageRepository!) : + undefined, + codeRepository: this.source.codeRepository ? + this.renderCodeConfiguration(this.source.codeRepository!.codeConfiguration.configurationValues!) : + undefined, }, networkConfiguration: { egressConfiguration: { @@ -850,8 +1021,8 @@ export class Service extends cdk.Resource { }); // grant required privileges for the role - if (source.ecrRepository && this.accessRole) { - source.ecrRepository.grantPull(this.accessRole); + if (this.source.ecrRepository && this.accessRole) { + this.source.ecrRepository.grantPull(this.accessRole); } this.serviceArn = resource.attrServiceArn; @@ -860,71 +1031,149 @@ export class Service extends cdk.Resource { this.serviceStatus = resource.attrStatus; this.serviceName = resource.ref; } + + /** + * This method adds an environment variable to the App Runner service. + */ + public addEnvironmentVariable(name: string, value: string) { + this.variables.push({ name: name, value: value }); + } + + /** + * This method adds a secret as environment variable to the App Runner service. + */ + public addSecret(name: string, secret: Secret) { + if (!this.instanceRole) { + this.instanceRole = this.createInstanceRole(); + } + secret.grantRead(this.instanceRole); + this.secrets.push({ name: name, value: secret.arn }); + } + + /** + * This method generates an Instance Role. Needed if using secrets and props.instanceRole is undefined + * @returns iam.IRole + */ + private createInstanceRole(): iam.IRole { + return new iam.Role(this, 'InstanceRole', { + assumedBy: new iam.ServicePrincipal('tasks.apprunner.amazonaws.com'), + roleName: cdk.PhysicalName.GENERATE_IF_NEEDED, + }); + } + + /** + * This method generates an Access Role only when ImageRepositoryType is ECR and props.accessRole is undefined + * @returns iam.IRole + */ + private generateDefaultRole(): iam.Role { + const accessRole = new iam.Role(this, 'AccessRole', { + assumedBy: new iam.ServicePrincipal('build.apprunner.amazonaws.com'), + }); + accessRole.addToPrincipalPolicy(new iam.PolicyStatement({ + actions: ['ecr:GetAuthorizationToken'], + resources: ['*'], + })); + this.accessRole = accessRole; + return accessRole; + } + + private getEnvironmentSecrets(): { [key: string]: Secret } { + let secrets = this.source.codeRepository?.codeConfiguration.configurationValues?.environmentSecrets ?? + this.source.imageRepository?.imageConfiguration?.environmentSecrets; + + return secrets || {}; + } + + private getEnvironmentVariables(): { [key: string]: string } { + let codeEnv = [ + this.source.codeRepository?.codeConfiguration.configurationValues?.environmentVariables, + this.source.codeRepository?.codeConfiguration.configurationValues?.environment, + ]; + let imageEnv = [ + this.source.imageRepository?.imageConfiguration?.environmentVariables, + this.source.imageRepository?.imageConfiguration?.environment, + ]; + + if (codeEnv.every(el => el !== undefined) || imageEnv.every(el => el !== undefined)) { + throw new Error([ + 'You cannot set both \'environmentVariables\' and \'environment\' properties.', + 'Please only use environmentVariables, as environment is deprecated.', + ].join(' ')); + } + + return codeEnv.find(el => el !== undefined) || imageEnv.find(el => el !== undefined) || {}; + } + private renderAuthenticationConfiguration(): AuthenticationConfiguration { return { accessRoleArn: this.accessRole?.roleArn, connectionArn: this.source.codeRepository?.connection?.connectionArn, }; } - private renderCodeConfiguration() { + + private renderCodeConfiguration(props: CodeConfigurationValues) { return { codeConfiguration: { configurationSource: this.source.codeRepository!.codeConfiguration.configurationSource, // codeConfigurationValues will be ignored if configurationSource is REPOSITORY codeConfigurationValues: this.source.codeRepository!.codeConfiguration.configurationValues ? - this.renderCodeConfigurationValues(this.source.codeRepository!.codeConfiguration.configurationValues) : undefined, + this.renderCodeConfigurationValues(props) : + undefined, }, repositoryUrl: this.source.codeRepository!.repositoryUrl, sourceCodeVersion: this.source.codeRepository!.sourceCodeVersion, }; - } + private renderCodeConfigurationValues(props: CodeConfigurationValues): any { - this.environment = props.environment; return { port: props.port, buildCommand: props.buildCommand, runtime: props.runtime.name, runtimeEnvironmentVariables: this.renderEnvironmentVariables(), + runtimeEnvironmentSecrets: this.renderEnvironmentSecrets(), startCommand: props.startCommand, }; } - private renderImageRepository(): any { - const repo = this.source.imageRepository!; - this.environment = repo.imageConfiguration?.environment; - return Object.assign(repo, { - imageConfiguration: { - port: repo.imageConfiguration?.port?.toString(), - startCommand: repo.imageConfiguration?.startCommand, - runtimeEnvironmentVariables: this.renderEnvironmentVariables(), - }, - }); - } private renderEnvironmentVariables(): EnvironmentVariable[] | undefined { - if (this.environment) { - let env: EnvironmentVariable[] = []; - for (const [key, value] of Object.entries(this.environment)) { + if (Object.keys(this.environmentVariables).length > 0) { + for (const [key, value] of Object.entries(this.environmentVariables)) { if (key.startsWith('AWSAPPRUNNER')) { throw new Error(`Environment variable key ${key} with a prefix of AWSAPPRUNNER is not allowed`); } - env.push({ name: key, value: value }); + this.variables.push({ name: key, value: value }); } - return env; + return this.variables; } else { return undefined; } } - private generateDefaultRole(): iam.Role { - const accessRole = new iam.Role(this, 'AccessRole', { - assumedBy: new iam.ServicePrincipal('build.apprunner.amazonaws.com'), + private renderEnvironmentSecrets(): EnvironmentSecret[] | undefined { + if (Object.keys(this.environmentSecrets).length > 0 && this.instanceRole) { + for (const [key, value] of Object.entries(this.environmentSecrets)) { + if (key.startsWith('AWSAPPRUNNER')) { + throw new Error(`Environment secret key ${key} with a prefix of AWSAPPRUNNER is not allowed`); + } + + value.grantRead(this.instanceRole); + this.secrets.push({ name: key, value: value.arn }); + } + return this.secrets; + } else { + return undefined; + } + } + + private renderImageRepository(repo: ImageRepository): any { + return Object.assign(repo, { + imageConfiguration: { + port: repo.imageConfiguration?.port?.toString(), + startCommand: repo.imageConfiguration?.startCommand, + runtimeEnvironmentVariables: this.renderEnvironmentVariables(), + runtimeEnvironmentSecrets: this.renderEnvironmentSecrets(), + }, }); - accessRole.addToPrincipalPolicy(new iam.PolicyStatement({ - actions: ['ecr:GetAuthorizationToken'], - resources: ['*'], - })); - this.accessRole = accessRole; - return accessRole; } } diff --git a/packages/@aws-cdk/aws-apprunner/package.json b/packages/@aws-cdk/aws-apprunner/package.json index e05b1991509b8..e4c4e7747b193 100644 --- a/packages/@aws-cdk/aws-apprunner/package.json +++ b/packages/@aws-cdk/aws-apprunner/package.json @@ -83,27 +83,39 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/assertions": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", - "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^27.5.2" + "@types/jest": "^27.5.2", + "constructs": "^10.0.0" }, "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", - "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "constructs": "^10.0.0" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", - "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-apprunner/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-apprunner/rosetta/default.ts-fixture index b74a57c217fbd..585b54c64cf81 100644 --- a/packages/@aws-cdk/aws-apprunner/rosetta/default.ts-fixture +++ b/packages/@aws-cdk/aws-apprunner/rosetta/default.ts-fixture @@ -1,5 +1,5 @@ // Fixture with packages imported, but nothing else -import { Stack } from '@aws-cdk/core'; +import { Stack, SecretValue } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as apprunner from '@aws-cdk/aws-apprunner'; import * as path from 'path'; diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets.json new file mode 100644 index 0000000000000..6a1de7aa5e5dd --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.template.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/cdk.out b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ-apprunner-secrets-manager.assets.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ-apprunner-secrets-manager.assets.json new file mode 100644 index 0000000000000..0d2a4279683d7 --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ-apprunner-secrets-manager.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "9c8d514c785fb19cbd23269b19753175ccbb3324a5998af72a0855c5dff09e83": { + "source": { + "path": "integ-apprunner-secrets-manager.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "9c8d514c785fb19cbd23269b19753175ccbb3324a5998af72a0855c5dff09e83.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ-apprunner-secrets-manager.template.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ-apprunner-secrets-manager.template.json new file mode 100644 index 0000000000000..48ed28d733e26 --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ-apprunner-secrets-manager.template.json @@ -0,0 +1,225 @@ +{ + "Resources": { + "SecretA720EF05": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "SecretString": "{\"password\":\"mySecretPassword\",\"apikey\":\"mySecretApiKey\"}" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "String0BA8456E": { + "Type": "AWS::SSM::Parameter", + "Properties": { + "Type": "String", + "Value": "Abc123", + "Name": "/My/Public/Parameter" + } + }, + "Service8InstanceRole6CC2A03A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "tasks.apprunner.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "Service8InstanceRoleDefaultPolicy7BC4087D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": { + "Ref": "SecretA720EF05" + } + }, + { + "Action": [ + "ssm:DescribeParameters", + "ssm:GetParameter", + "ssm:GetParameterHistory", + "ssm:GetParameters" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ssm:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":parameter/My/Public/Parameter" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Service8InstanceRoleDefaultPolicy7BC4087D", + "Roles": [ + { + "Ref": "Service8InstanceRole6CC2A03A" + } + ] + } + }, + "Service86269A78B": { + "Type": "AWS::AppRunner::Service", + "Properties": { + "SourceConfiguration": { + "AuthenticationConfiguration": {}, + "ImageRepository": { + "ImageConfiguration": { + "Port": "8000", + "RuntimeEnvironmentSecrets": [ + { + "Name": "PASSWORD", + "Value": { + "Fn::Join": [ + "", + [ + { + "Ref": "SecretA720EF05" + }, + ":password::" + ] + ] + } + }, + { + "Name": "PARAMETER", + "Value": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ssm:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":parameter/My/Public/Parameter" + ] + ] + } + }, + { + "Name": "API_KEY", + "Value": { + "Fn::Join": [ + "", + [ + { + "Ref": "SecretA720EF05" + }, + ":apikey::" + ] + ] + } + } + ] + }, + "ImageIdentifier": "public.ecr.aws/aws-containers/hello-app-runner:latest", + "ImageRepositoryType": "ECR_PUBLIC" + } + }, + "InstanceConfiguration": { + "InstanceRoleArn": { + "Fn::GetAtt": [ + "Service8InstanceRole6CC2A03A", + "Arn" + ] + } + }, + "NetworkConfiguration": { + "EgressConfiguration": { + "EgressType": "DEFAULT" + } + } + } + } + }, + "Outputs": { + "URL8": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Fn::GetAtt": [ + "Service86269A78B", + "ServiceUrl" + ] + } + ] + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ.json new file mode 100644 index 0000000000000..0be359a9018cc --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "29.0.0", + "testCases": { + "AppRunnerSecretsManger/DefaultTest": { + "stacks": [ + "integ-apprunner-secrets-manager" + ], + "assertionStack": "AppRunnerSecretsManger/DefaultTest/DeployAssert", + "assertionStackName": "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/manifest.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/manifest.json new file mode 100644 index 0000000000000..6161ee5dd7214 --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/manifest.json @@ -0,0 +1,141 @@ +{ + "version": "29.0.0", + "artifacts": { + "integ-apprunner-secrets-manager.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-apprunner-secrets-manager.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-apprunner-secrets-manager": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-apprunner-secrets-manager.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9c8d514c785fb19cbd23269b19753175ccbb3324a5998af72a0855c5dff09e83.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-apprunner-secrets-manager.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-apprunner-secrets-manager.assets" + ], + "metadata": { + "/integ-apprunner-secrets-manager/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SecretA720EF05" + } + ], + "/integ-apprunner-secrets-manager/String/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "String0BA8456E" + } + ], + "/integ-apprunner-secrets-manager/Service8/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Service8InstanceRole6CC2A03A" + } + ], + "/integ-apprunner-secrets-manager/Service8/InstanceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Service8InstanceRoleDefaultPolicy7BC4087D" + } + ], + "/integ-apprunner-secrets-manager/Service8/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Service86269A78B" + } + ], + "/integ-apprunner-secrets-manager/URL8": [ + { + "type": "aws:cdk:logicalId", + "data": "URL8" + } + ], + "/integ-apprunner-secrets-manager/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-apprunner-secrets-manager/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-apprunner-secrets-manager" + }, + "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "AppRunnerSecretsMangerDefaultTestDeployAssert6B977D95.assets" + ], + "metadata": { + "/AppRunnerSecretsManger/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/AppRunnerSecretsManger/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "AppRunnerSecretsManger/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/tree.json b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/tree.json new file mode 100644 index 0000000000000..dea6f76b6f788 --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.js.snapshot/tree.json @@ -0,0 +1,382 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-apprunner-secrets-manager": { + "id": "integ-apprunner-secrets-manager", + "path": "integ-apprunner-secrets-manager", + "children": { + "Secret": { + "id": "Secret", + "path": "integ-apprunner-secrets-manager/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-apprunner-secrets-manager/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "secretString": "{\"password\":\"mySecretPassword\",\"apikey\":\"mySecretApiKey\"}" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.Secret", + "version": "0.0.0" + } + }, + "String": { + "id": "String", + "path": "integ-apprunner-secrets-manager/String", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-apprunner-secrets-manager/String/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SSM::Parameter", + "aws:cdk:cloudformation:props": { + "type": "String", + "value": "Abc123", + "name": "/My/Public/Parameter" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ssm.CfnParameter", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ssm.StringParameter", + "version": "0.0.0" + } + }, + "Parameter": { + "id": "Parameter", + "path": "integ-apprunner-secrets-manager/Parameter", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Service8": { + "id": "Service8", + "path": "integ-apprunner-secrets-manager/Service8", + "children": { + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-apprunner-secrets-manager/Service8/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-apprunner-secrets-manager/Service8/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-apprunner-secrets-manager/Service8/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "tasks.apprunner.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "integ-apprunner-secrets-manager/Service8/InstanceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-apprunner-secrets-manager/Service8/InstanceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": { + "Ref": "SecretA720EF05" + } + }, + { + "Action": [ + "ssm:DescribeParameters", + "ssm:GetParameter", + "ssm:GetParameterHistory", + "ssm:GetParameters" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ssm:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":parameter/My/Public/Parameter" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "Service8InstanceRoleDefaultPolicy7BC4087D", + "roles": [ + { + "Ref": "Service8InstanceRole6CC2A03A" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-apprunner-secrets-manager/Service8/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppRunner::Service", + "aws:cdk:cloudformation:props": { + "sourceConfiguration": { + "authenticationConfiguration": {}, + "imageRepository": { + "imageConfiguration": { + "port": "8000", + "runtimeEnvironmentSecrets": [ + { + "name": "PASSWORD", + "value": { + "Fn::Join": [ + "", + [ + { + "Ref": "SecretA720EF05" + }, + ":password::" + ] + ] + } + }, + { + "name": "PARAMETER", + "value": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ssm:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":parameter/My/Public/Parameter" + ] + ] + } + }, + { + "name": "API_KEY", + "value": { + "Fn::Join": [ + "", + [ + { + "Ref": "SecretA720EF05" + }, + ":apikey::" + ] + ] + } + } + ] + }, + "imageIdentifier": "public.ecr.aws/aws-containers/hello-app-runner:latest", + "imageRepositoryType": "ECR_PUBLIC" + } + }, + "instanceConfiguration": { + "instanceRoleArn": { + "Fn::GetAtt": [ + "Service8InstanceRole6CC2A03A", + "Arn" + ] + } + }, + "networkConfiguration": { + "egressConfiguration": { + "egressType": "DEFAULT" + } + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-apprunner.CfnService", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-apprunner.Service", + "version": "0.0.0" + } + }, + "URL8": { + "id": "URL8", + "path": "integ-apprunner-secrets-manager/URL8", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-apprunner-secrets-manager/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-apprunner-secrets-manager/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "AppRunnerSecretsManger": { + "id": "AppRunnerSecretsManger", + "path": "AppRunnerSecretsManger", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "AppRunnerSecretsManger/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "AppRunnerSecretsManger/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.209" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "AppRunnerSecretsManger/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "AppRunnerSecretsManger/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "AppRunnerSecretsManger/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.209" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.ts b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.ts new file mode 100644 index 0000000000000..2adc7193cfee1 --- /dev/null +++ b/packages/@aws-cdk/aws-apprunner/test/integ.service-secrets-manager.ts @@ -0,0 +1,50 @@ +import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import * as ssm from '@aws-cdk/aws-ssm'; +import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import * as apprunner from '../lib'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'integ-apprunner-secrets-manager'); + +// Scenario 8: Create the service from ECR public with secrets manager environment variable +const secret = new secretsmanager.Secret(stack, 'Secret', { + secretObjectValue: { + password: cdk.SecretValue.unsafePlainText('mySecretPassword'), + apikey: cdk.SecretValue.unsafePlainText('mySecretApiKey'), + }, +}); + +new ssm.StringParameter(stack, 'String', { + parameterName: '/My/Public/Parameter', + stringValue: 'Abc123', +}); + +const parameter = ssm.StringParameter.fromSecureStringParameterAttributes(stack, 'Parameter', { + parameterName: '/My/Public/Parameter', + version: 1, +}); + +const service8 = new apprunner.Service(stack, 'Service8', { + source: apprunner.Source.fromEcrPublic({ + imageConfiguration: { + port: 8000, + environmentSecrets: { + PASSWORD: apprunner.Secret.fromSecretsManager(secret, 'password'), + PARAMETER: apprunner.Secret.fromSsmParameter(parameter), + }, + }, + imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + }), +}); + +service8.addSecret('API_KEY', apprunner.Secret.fromSecretsManager(secret, 'apikey')); + +new cdk.CfnOutput(stack, 'URL8', { value: `https://${service8.serviceUrl}` }); + +new integ.IntegTest(app, 'AppRunnerSecretsManger', { + testCases: [stack], +}); + +app.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apprunner/test/service.test.ts b/packages/@aws-cdk/aws-apprunner/test/service.test.ts index ed41689c9f255..a5e4604278194 100644 --- a/packages/@aws-cdk/aws-apprunner/test/service.test.ts +++ b/packages/@aws-cdk/aws-apprunner/test/service.test.ts @@ -4,20 +4,25 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecr from '@aws-cdk/aws-ecr'; import * as ecr_assets from '@aws-cdk/aws-ecr-assets'; import * as iam from '@aws-cdk/aws-iam'; +import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import * as ssm from '@aws-cdk/aws-ssm'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import { Service, GitHubConnection, Runtime, Source, Cpu, Memory, ConfigurationSourceType, VpcConnector } from '../lib'; +import * as apprunner from '../lib'; test('create a service with ECR Public(image repository type: ECR_PUBLIC)', () => { // GIVEN const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageConfiguration: { port: 8000 }, imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), }); + + // THEN // we should have the service Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { SourceConfiguration: { @@ -43,19 +48,22 @@ test('custom environment variables and start commands are allowed for imageConfi const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + const service = new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageConfiguration: { port: 8000, - environment: { - foo: 'fooval', - bar: 'barval', + environmentVariables: { + TEST_ENVIRONMENT_VARIABLE: 'test environment variable value', }, startCommand: '/root/start-command.sh', }, imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), }); + + service.addEnvironmentVariable('SECOND_ENVIRONEMENT_VARIABLE', 'second test value'); + + // THEN // we should have the service Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { SourceConfiguration: { @@ -65,12 +73,136 @@ test('custom environment variables and start commands are allowed for imageConfi Port: '8000', RuntimeEnvironmentVariables: [ { - Name: 'foo', - Value: 'fooval', + Name: 'TEST_ENVIRONMENT_VARIABLE', + Value: 'test environment variable value', + }, + { + Name: 'SECOND_ENVIRONEMENT_VARIABLE', + Value: 'second test value', + }, + ], + StartCommand: '/root/start-command.sh', + }, + ImageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + ImageRepositoryType: 'ECR_PUBLIC', + }, + }, + NetworkConfiguration: { + EgressConfiguration: { + EgressType: 'DEFAULT', + }, + }, + }); +}); + +test('custom environment secrets and start commands are allowed for imageConfiguration with defined port', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'demo-stack'); + // WHEN + const secret = new secretsmanager.Secret(stack, 'Secret'); + const parameter = ssm.StringParameter.fromSecureStringParameterAttributes(stack, 'Parameter', { + parameterName: '/name', + version: 1, + }); + + const service = new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ + imageConfiguration: { + port: 8000, + environmentSecrets: { + SECRET: apprunner.Secret.fromSecretsManager(secret), + PARAMETER: apprunner.Secret.fromSsmParameter(parameter), + SECRET_ID: apprunner.Secret.fromSecretsManagerVersion(secret, { versionId: 'version-id' }), + SECRET_STAGE: apprunner.Secret.fromSecretsManagerVersion(secret, { versionStage: 'version-stage' }), + }, + startCommand: '/root/start-command.sh', + }, + imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + }), + }); + + service.addSecret('LATER_SECRET', apprunner.Secret.fromSecretsManager(secret, 'field')); + + // THEN + // we should have the service + Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { + SourceConfiguration: { + AuthenticationConfiguration: {}, + ImageRepository: { + ImageConfiguration: { + Port: '8000', + RuntimeEnvironmentSecrets: [ + { + Name: 'SECRET', + Value: { + Ref: 'SecretA720EF05', + }, + }, + { + Name: 'PARAMETER', + Value: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':ssm:', + { + Ref: 'AWS::Region', + }, + ':', + { + Ref: 'AWS::AccountId', + }, + ':parameter/name', + ], + ], + }, }, { - Name: 'bar', - Value: 'barval', + Name: 'SECRET_ID', + Value: { + 'Fn::Join': [ + '', + [ + { + Ref: 'SecretA720EF05', + }, + ':::version-id', + ], + ], + }, + }, + { + Name: 'SECRET_STAGE', + Value: { + 'Fn::Join': [ + '', + [ + { + Ref: 'SecretA720EF05', + }, + '::version-stage:', + ], + ], + }, + }, + { + Name: 'LATER_SECRET', + Value: { + 'Fn::Join': [ + '', + [ + { + Ref: 'SecretA720EF05', + }, + ':field::', + ], + ], + }, }, ], StartCommand: '/root/start-command.sh', @@ -92,18 +224,21 @@ test('custom environment variables and start commands are allowed for imageConfi const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + const service = new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageConfiguration: { - environment: { - foo: 'fooval', - bar: 'barval', + environmentVariables: { + TEST_ENVIRONMENT_VARIABLE: 'test environment variable value', }, startCommand: '/root/start-command.sh', }, imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), }); + + service.addEnvironmentVariable('SECOND_ENVIRONEMENT_VARIABLE', 'second test value'); + + // THEN // we should have the service Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { SourceConfiguration: { @@ -112,12 +247,134 @@ test('custom environment variables and start commands are allowed for imageConfi ImageConfiguration: { RuntimeEnvironmentVariables: [ { - Name: 'foo', - Value: 'fooval', + Name: 'TEST_ENVIRONMENT_VARIABLE', + Value: 'test environment variable value', }, { - Name: 'bar', - Value: 'barval', + Name: 'SECOND_ENVIRONEMENT_VARIABLE', + Value: 'second test value', + }, + ], + StartCommand: '/root/start-command.sh', + }, + ImageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + ImageRepositoryType: 'ECR_PUBLIC', + }, + }, + NetworkConfiguration: { + EgressConfiguration: { + EgressType: 'DEFAULT', + }, + }, + }); +}); + +test('custom environment secrets and start commands are allowed for imageConfiguration with port undefined', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'demo-stack'); + // WHEN + const secret = new secretsmanager.Secret(stack, 'Secret'); + const parameter = ssm.StringParameter.fromSecureStringParameterAttributes(stack, 'Parameter', { + parameterName: '/name', + version: 1, + }); + + const service = new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ + imageConfiguration: { + environmentSecrets: { + SECRET: apprunner.Secret.fromSecretsManager(secret), + PARAMETER: apprunner.Secret.fromSsmParameter(parameter), + SECRET_ID: apprunner.Secret.fromSecretsManagerVersion(secret, { versionId: 'version-id' }), + SECRET_STAGE: apprunner.Secret.fromSecretsManagerVersion(secret, { versionStage: 'version-stage' }), + }, + startCommand: '/root/start-command.sh', + }, + imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + }), + }); + + service.addSecret('LATER_SECRET', apprunner.Secret.fromSecretsManager(secret, 'field')); + + // THEN + // we should have the service + Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { + SourceConfiguration: { + AuthenticationConfiguration: {}, + ImageRepository: { + ImageConfiguration: { + RuntimeEnvironmentSecrets: [ + { + Name: 'SECRET', + Value: { + Ref: 'SecretA720EF05', + }, + }, + { + Name: 'PARAMETER', + Value: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':ssm:', + { + Ref: 'AWS::Region', + }, + ':', + { + Ref: 'AWS::AccountId', + }, + ':parameter/name', + ], + ], + }, + }, + { + Name: 'SECRET_ID', + Value: { + 'Fn::Join': [ + '', + [ + { + Ref: 'SecretA720EF05', + }, + ':::version-id', + ], + ], + }, + }, + { + Name: 'SECRET_STAGE', + Value: { + 'Fn::Join': [ + '', + [ + { + Ref: 'SecretA720EF05', + }, + '::version-stage:', + ], + ], + }, + }, + { + Name: 'LATER_SECRET', + Value: { + 'Fn::Join': [ + '', + [ + { + Ref: 'SecretA720EF05', + }, + ':field::', + ], + ], + }, }, ], StartCommand: '/root/start-command.sh', @@ -139,8 +396,8 @@ test('create a service from existing ECR repository(image repository type: ECR)' const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'Service', { - source: Source.fromEcr({ + new apprunner.Service(stack, 'Service', { + source: apprunner.Source.fromEcr({ imageConfiguration: { port: 80 }, repository: ecr.Repository.fromRepositoryName(stack, 'NginxRepository', 'nginx'), }), @@ -215,8 +472,8 @@ test('create a service with local assets(image repository type: ECR)', () => { const dockerAsset = new ecr_assets.DockerImageAsset(stack, 'Assets', { directory: path.join(__dirname, './docker.assets'), }); - new Service(stack, 'DemoService', { - source: Source.fromAsset({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromAsset({ imageConfiguration: { port: 8000 }, asset: dockerAsset, }), @@ -273,12 +530,12 @@ test('create a service with github repository', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromGitHub({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromGitHub({ repositoryUrl: 'https://github.com/aws-containers/hello-app-runner', branch: 'main', - configurationSource: ConfigurationSourceType.REPOSITORY, - connection: GitHubConnection.fromConnectionArn('MOCK'), + configurationSource: apprunner.ConfigurationSourceType.REPOSITORY, + connection: apprunner.GitHubConnection.fromConnectionArn('MOCK'), }), }); @@ -313,15 +570,15 @@ test('create a service with github repository - undefined branch name is allowed const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromGitHub({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromGitHub({ repositoryUrl: 'https://github.com/aws-containers/hello-app-runner', - configurationSource: ConfigurationSourceType.API, + configurationSource: apprunner.ConfigurationSourceType.API, codeConfigurationValues: { - runtime: Runtime.PYTHON_3, + runtime: apprunner.Runtime.PYTHON_3, port: '8000', }, - connection: GitHubConnection.fromConnectionArn('MOCK'), + connection: apprunner.GitHubConnection.fromConnectionArn('MOCK'), }), }); @@ -360,24 +617,25 @@ test('create a service with github repository - buildCommand, environment and st const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromGitHub({ + const service = new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromGitHub({ repositoryUrl: 'https://github.com/aws-containers/hello-app-runner', - configurationSource: ConfigurationSourceType.API, + configurationSource: apprunner.ConfigurationSourceType.API, codeConfigurationValues: { - runtime: Runtime.PYTHON_3, + runtime: apprunner.Runtime.PYTHON_3, port: '8000', buildCommand: '/root/build.sh', - environment: { - foo: 'fooval', - bar: 'barval', + environmentVariables: { + TEST_ENVIRONMENT_VARIABLE: 'test environment variable value', }, startCommand: '/root/start.sh', }, - connection: GitHubConnection.fromConnectionArn('MOCK'), + connection: apprunner.GitHubConnection.fromConnectionArn('MOCK'), }), }); + service.addEnvironmentVariable('SECOND_ENVIRONEMENT_VARIABLE', 'second test value'); + // THEN // we should have the service with the branch value as 'main' Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { @@ -393,12 +651,12 @@ test('create a service with github repository - buildCommand, environment and st BuildCommand: '/root/build.sh', RuntimeEnvironmentVariables: [ { - Name: 'foo', - Value: 'fooval', + Name: 'TEST_ENVIRONMENT_VARIABLE', + Value: 'test environment variable value', }, { - Name: 'bar', - Value: 'barval', + Name: 'SECOND_ENVIRONEMENT_VARIABLE', + Value: 'second test value', }, ], StartCommand: '/root/start.sh', @@ -426,7 +684,7 @@ test('import from service name', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - const svc = Service.fromServiceName(stack, 'ImportService', 'ExistingService'); + const svc = apprunner.Service.fromServiceName(stack, 'ImportService', 'ExistingService'); // THEN expect(svc).toHaveProperty('serviceName'); expect(svc).toHaveProperty('serviceArn'); @@ -437,7 +695,7 @@ test('import from service attributes', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - const svc = Service.fromServiceAttributes(stack, 'ImportService', { + const svc = apprunner.Service.fromServiceAttributes(stack, 'ImportService', { serviceName: 'mock', serviceArn: 'mock', serviceStatus: 'mock', @@ -456,8 +714,8 @@ test('undefined imageConfiguration port is allowed', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'Service', { - source: Source.fromEcrPublic({ + new apprunner.Service(stack, 'Service', { + source: apprunner.Source.fromEcrPublic({ imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), }); @@ -488,8 +746,8 @@ test('custom IAM access role and instance role are allowed', () => { const dockerAsset = new ecr_assets.DockerImageAsset(stack, 'Assets', { directory: path.join(__dirname, './docker.assets'), }); - new Service(stack, 'DemoService', { - source: Source.fromAsset({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromAsset({ asset: dockerAsset, imageConfiguration: { port: 8000 }, }), @@ -546,12 +804,12 @@ test('cpu and memory properties are allowed', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), - cpu: Cpu.ONE_VCPU, - memory: Memory.THREE_GB, + cpu: apprunner.Cpu.ONE_VCPU, + memory: apprunner.Memory.THREE_GB, }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { @@ -572,12 +830,12 @@ test('custom cpu and memory units are allowed', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'demo-stack'); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), - cpu: Cpu.of('Some vCPU'), - memory: Memory.of('Some GB'), + cpu: apprunner.Cpu.of('Some vCPU'), + memory: apprunner.Memory.of('Some GB'), }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', { @@ -600,10 +858,10 @@ test('environment variable with a prefix of AWSAPPRUNNER should throw an error', // WHEN // we should have the service expect(() => { - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageConfiguration: { - environment: { + environmentVariables: { AWSAPPRUNNER_FOO: 'bar', }, }, @@ -613,6 +871,28 @@ test('environment variable with a prefix of AWSAPPRUNNER should throw an error', }).toThrow('Environment variable key AWSAPPRUNNER_FOO with a prefix of AWSAPPRUNNER is not allowed'); }); +test('environment secrets with a prefix of AWSAPPRUNNER should throw an error', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'demo-stack'); + const secret = new secretsmanager.Secret(stack, 'Secret'); + + // WHEN + // we should have the service + expect(() => { + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ + imageConfiguration: { + environmentSecrets: { + AWSAPPRUNNER_FOO: apprunner.Secret.fromSecretsManager(secret), + }, + }, + imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + }), + }); + }).toThrow('Environment secret key AWSAPPRUNNER_FOO with a prefix of AWSAPPRUNNER is not allowed'); +}); + test('specifying a vpcConnector should assign the service to it and set the egressType to VPC', () => { // GIVEN const app = new cdk.App(); @@ -624,15 +904,15 @@ test('specifying a vpcConnector should assign the service to it and set the egre const securityGroup = new ec2.SecurityGroup(stack, 'SecurityGroup', { vpc }); - const vpcConnector = new VpcConnector(stack, 'VpcConnector', { + const vpcConnector = new apprunner.VpcConnector(stack, 'VpcConnector', { securityGroups: [securityGroup], vpc, vpcSubnets: vpc.selectSubnets({ subnetType: ec2.SubnetType.PUBLIC }), vpcConnectorName: 'MyVpcConnector', }); // WHEN - new Service(stack, 'DemoService', { - source: Source.fromEcrPublic({ + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', }), vpcConnector, @@ -671,4 +951,25 @@ test('specifying a vpcConnector should assign the service to it and set the egre ], VpcConnectorName: 'MyVpcConnector', }); +}); + +testDeprecated('Using both environmentVariables and environment should throw an error', () => { + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'demo-stack'); + + expect(() => { + new apprunner.Service(stack, 'DemoService', { + source: apprunner.Source.fromEcrPublic({ + imageConfiguration: { + environmentVariables: { + AWSAPPRUNNER_FOO: 'bar', + }, + environment: { + AWSAPPRUNNER_FOO: 'bar', + }, + }, + imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', + }), + }); + }).toThrow(/You cannot set both \'environmentVariables\' and \'environment\' properties./); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/package.json b/packages/@aws-cdk/aws-appstream/package.json index c5bfa02cf5de7..7bdc99e06f575 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -83,6 +83,8 @@ "devDependencies": { "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", + "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2" diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/asset.e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041.bundle/index.js b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/asset.e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041.bundle/index.js new file mode 100644 index 0000000000000..bbbe0310bc3dd --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/asset.e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041.bundle/index.js @@ -0,0 +1,1051 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failuresHere = /* @__PURE__ */ new Map(); + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; + return this; + } + get isSuccess() { + return !this._hasFailed; + } + hasFailed() { + return this._hasFailed; + } + get failCount() { + return this._failCount; + } + get failCost() { + return this._cost; + } + compose(id, inner) { + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } + } + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ + matcher: this, + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); + let patternIdx = 0; + let actualIdx = 0; + const matches = new SparseMatrix(); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (matcherName == "absent" || matcherName == "anyValue") { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); + patternIdx++; + } + } + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [a], + message: `Unexpected key ${a}` + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [patternKey], + message: `Missing key '${patternKey}'` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(patternKey, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + if (getType(actual) !== "string") { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: matchResult.renderMismatch() + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/cdk.out b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/cdk.out new file mode 100644 index 0000000000000..145739f539580 --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/fleettestDefaultTestDeployAssert9067216F.assets.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/fleettestDefaultTestDeployAssert9067216F.assets.json new file mode 100644 index 0000000000000..e91707cbe239f --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/fleettestDefaultTestDeployAssert9067216F.assets.json @@ -0,0 +1,32 @@ +{ + "version": "22.0.0", + "files": { + "e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041": { + "source": { + "path": "asset.e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041.bundle", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "8911073233f2efdc6a92d463a6a5da8f015989571b4e69466ea1d2328ce3b75b": { + "source": { + "path": "fleettestDefaultTestDeployAssert9067216F.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "8911073233f2efdc6a92d463a6a5da8f015989571b4e69466ea1d2328ce3b75b.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/fleettestDefaultTestDeployAssert9067216F.template.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/fleettestDefaultTestDeployAssert9067216F.template.json new file mode 100644 index 0000000000000..e3135d0516995 --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/fleettestDefaultTestDeployAssert9067216F.template.json @@ -0,0 +1,134 @@ +{ + "Resources": { + "AwsApiCallAppStreamdescribeFleets": { + "Type": "Custom::DeployAssert@SdkCallAppStreamdescribeFleets", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "AppStream", + "api": "describeFleets", + "expected": "{\"$ObjectLike\":{\"Fleets\":[{\"State\":\"RUNNING\"}]}}", + "parameters": { + "Names": [ + { + "Fn::ImportValue": "integ-appstream-fleet:ExportsOutputRefMyFleet2DDF6411" + } + ] + }, + "flattenResponse": "false", + "salt": "1673180608482" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "appstream:DescribeFleets" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ] + } + } + ] + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Runtime": "nodejs14.x", + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "e452e213d7f0cc8e3f721cfec0fe9d623c51052282e9df20c641a723b612f041.zip" + }, + "Timeout": 120, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + } + }, + "Outputs": { + "AssertionResultsAwsApiCallAppStreamdescribeFleets": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallAppStreamdescribeFleets", + "assertion" + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ-appstream-fleet.assets.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ-appstream-fleet.assets.json new file mode 100644 index 0000000000000..f7e470e3e4fea --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ-appstream-fleet.assets.json @@ -0,0 +1,19 @@ +{ + "version": "22.0.0", + "files": { + "5f9fe4d8145c4eeb8dc77cd8e867cf2e6b3b0736819b9ccaf63e5fcee2891cc5": { + "source": { + "path": "integ-appstream-fleet.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5f9fe4d8145c4eeb8dc77cd8e867cf2e6b3b0736819b9ccaf63e5fcee2891cc5.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ-appstream-fleet.template.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ-appstream-fleet.template.json new file mode 100644 index 0000000000000..ab2859b4e7506 --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ-appstream-fleet.template.json @@ -0,0 +1,62 @@ +{ + "Resources": { + "MyFleet": { + "Type": "AWS::AppStream::Fleet", + "Properties": { + "InstanceType": "stream.standard.small", + "Name": "MyFleet", + "ComputeCapacity": { + "DesiredInstances": 1 + }, + "ImageName": "AppStream-AmazonLinux2-09-21-2022" + }, + "CreationPolicy": { + "StartFleet": true + } + } + }, + "Outputs": { + "ExportsOutputRefMyFleet2DDF6411": { + "Value": { + "Ref": "MyFleet" + }, + "Export": { + "Name": "integ-appstream-fleet:ExportsOutputRefMyFleet2DDF6411" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ.json new file mode 100644 index 0000000000000..93ccf43a7db6a --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "22.0.0", + "testCases": { + "fleet-test/DefaultTest": { + "stacks": [ + "integ-appstream-fleet" + ], + "assertionStack": "fleet-test/DefaultTest/DeployAssert", + "assertionStackName": "fleettestDefaultTestDeployAssert9067216F" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/manifest.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/manifest.json new file mode 100644 index 0000000000000..5f59a737409ce --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/manifest.json @@ -0,0 +1,142 @@ +{ + "version": "22.0.0", + "artifacts": { + "integ-appstream-fleet.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-appstream-fleet.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-appstream-fleet": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-appstream-fleet.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5f9fe4d8145c4eeb8dc77cd8e867cf2e6b3b0736819b9ccaf63e5fcee2891cc5.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-appstream-fleet.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-appstream-fleet.assets" + ], + "metadata": { + "/integ-appstream-fleet/MyFleet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFleet" + } + ], + "/integ-appstream-fleet/Exports/Output{\"Ref\":\"MyFleet\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefMyFleet2DDF6411" + } + ], + "/integ-appstream-fleet/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-appstream-fleet/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-appstream-fleet" + }, + "fleettestDefaultTestDeployAssert9067216F.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "fleettestDefaultTestDeployAssert9067216F.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "fleettestDefaultTestDeployAssert9067216F": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "fleettestDefaultTestDeployAssert9067216F.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8911073233f2efdc6a92d463a6a5da8f015989571b4e69466ea1d2328ce3b75b.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "fleettestDefaultTestDeployAssert9067216F.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-appstream-fleet", + "fleettestDefaultTestDeployAssert9067216F.assets" + ], + "metadata": { + "/fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallAppStreamdescribeFleets" + } + ], + "/fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAwsApiCallAppStreamdescribeFleets" + } + ], + "/fleet-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" + } + ], + "/fleet-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" + } + ], + "/fleet-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/fleet-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "fleet-test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/tree.json b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/tree.json new file mode 100644 index 0000000000000..fa76a7cd5d85b --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.js.snapshot/tree.json @@ -0,0 +1,226 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-appstream-fleet": { + "id": "integ-appstream-fleet", + "path": "integ-appstream-fleet", + "children": { + "MyFleet": { + "id": "MyFleet", + "path": "integ-appstream-fleet/MyFleet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppStream::Fleet", + "aws:cdk:cloudformation:props": { + "instanceType": "stream.standard.small", + "name": "MyFleet", + "computeCapacity": { + "desiredInstances": 1 + }, + "imageName": "AppStream-AmazonLinux2-09-21-2022" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appstream.CfnFleet", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "integ-appstream-fleet/Exports", + "children": { + "Output{\"Ref\":\"MyFleet\"}": { + "id": "Output{\"Ref\":\"MyFleet\"}", + "path": "integ-appstream-fleet/Exports/Output{\"Ref\":\"MyFleet\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-appstream-fleet/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-appstream-fleet/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "fleet-test": { + "id": "fleet-test", + "path": "fleet-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "fleet-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "fleet-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "fleet-test/DefaultTest/DeployAssert", + "children": { + "AwsApiCallAppStreamdescribeFleets": { + "id": "AwsApiCallAppStreamdescribeFleets", + "path": "fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/Default", + "children": { + "Default": { + "id": "Default", + "path": "fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "fleet-test/DefaultTest/DeployAssert/AwsApiCallAppStreamdescribeFleets/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AwsApiCall", + "version": "0.0.0" + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81": { + "id": "SingletonFunction1488541a7b23466481b69b4408076b81", + "path": "fleet-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "children": { + "Staging": { + "id": "Staging", + "path": "fleet-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "fleet-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "fleet-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "fleet-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "fleet-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appstream/test/integ.fleet.ts b/packages/@aws-cdk/aws-appstream/test/integ.fleet.ts new file mode 100644 index 0000000000000..aaab190a456ec --- /dev/null +++ b/packages/@aws-cdk/aws-appstream/test/integ.fleet.ts @@ -0,0 +1,44 @@ +import * as cdk from '@aws-cdk/core'; +import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests'; +import * as appstream from '../lib'; + +/* + * Before this test can run you need to visit the AppStream console once and click fleets. + * This will create the necessary AmazonAppStreamServiceAccess service role. + * + * Stack verification steps: + * * aws appstream describe-fleets --region us-east-1 + * The command should return a json with an array Fleets containing one with a Name MyFleet and a State of RUNNING. + */ + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'integ-appstream-fleet'); + +const fleet = new appstream.CfnFleet(stack, 'MyFleet', { + instanceType: 'stream.standard.small', + name: 'MyFleet', + computeCapacity: { + desiredInstances: 1, + }, + imageName: 'AppStream-AmazonLinux2-09-21-2022', +}); +fleet.cfnOptions.creationPolicy = { + startFleet: true, +}; + +const testCase = new IntegTest(app, 'fleet-test', { + testCases: [stack], +}); + +const describe = testCase.assertions.awsApiCall('AppStream', 'describeFleets', { + Names: [fleet.ref], +}); + +// assert the results +describe.expect(ExpectedResult.objectLike({ + Fleets: [{ + State: 'RUNNING', + }], +})); + +app.synth(); diff --git a/packages/@aws-cdk/aws-appsync/README.md b/packages/@aws-cdk/aws-appsync/README.md index 52d041f0c2fe8..815a1b7ab0699 100644 --- a/packages/@aws-cdk/aws-appsync/README.md +++ b/packages/@aws-cdk/aws-appsync/README.md @@ -258,7 +258,7 @@ import * as opensearch from '@aws-cdk/aws-opensearchservice'; const user = new iam.User(this, 'User'); const domain = new opensearch.Domain(this, 'Domain', { - version: opensearch.EngineVersion.OPENSEARCH_1_3, + version: opensearch.EngineVersion.OPENSEARCH_2_3, removalPolicy: RemovalPolicy.DESTROY, fineGrainedAccessControl: { masterUserArn: user.userArn }, encryptionAtRest: { enabled: true }, diff --git a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts index 0f7f16a37f0ab..00d4f2a0159df 100644 --- a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts +++ b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts @@ -534,7 +534,7 @@ export class GraphqlApi extends GraphqlApiBase { const config = modes.find((mode: AuthorizationMode) => { return mode.authorizationType === AuthorizationType.LAMBDA && mode.lambdaAuthorizerConfig; })?.lambdaAuthorizerConfig; - config?.handler.addPermission('appsync', { + config?.handler.addPermission(`${id}-appsync`, { principal: new ServicePrincipal('appsync.amazonaws.com'), action: 'lambda:InvokeFunction', }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts index 7331fdfd907e7..e46494ce563fc 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts @@ -684,6 +684,59 @@ describe('AppSync Lambda Authorization', () => { }); + test('Attach Lambda Authorization to two or more graphql api', () => { + // WHEN + new appsync.GraphqlApi(stack, 'api1', { + name: 'api1', + schema: appsync.SchemaFile.fromAsset( + path.join(__dirname, 'appsync.test.graphql'), + ), + authorizationConfig: { + defaultAuthorization: { + authorizationType: appsync.AuthorizationType.LAMBDA, + lambdaAuthorizerConfig: { + handler: fn, + }, + }, + }, + }); + + new appsync.GraphqlApi(stack, 'api2', { + name: 'api2', + schema: appsync.SchemaFile.fromAsset( + path.join(__dirname, 'appsync.test.graphql'), + ), + authorizationConfig: { + defaultAuthorization: { + authorizationType: appsync.AuthorizationType.LAMBDA, + lambdaAuthorizerConfig: { + handler: fn, + }, + }, + }, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties( + 'AWS::AppSync::GraphQLApi', + { + AuthenticationType: 'AWS_LAMBDA', + LambdaAuthorizerConfig: { + AuthorizerUri: { + 'Fn::GetAtt': ['authfunction96361832', 'Arn'], + }, + }, + }, + ); + + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Permission', { + Action: 'lambda:InvokeFunction', + FunctionName: { + 'Fn::GetAtt': ['authfunction96361832', 'Arn'], + }, + }); + }); + test('Lambda authorization configurable in default authorization', () => { // WHEN new appsync.GraphqlApi(stack, 'api', { diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.assets.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.assets.json index a7da3cc32abc0..4779f5cbb1c5c 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.assets.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.assets.json @@ -1,7 +1,7 @@ { - "version": "22.0.0", + "version": "29.0.0", "files": { - "cbf69265acb5253067d9fc78cec3e7b151737dc0ba84d10aedd04a2c12f84bc4": { + "f8a2a9f9e0d429354b6c00646ad4364f5e46ab6ceecf270d2ff59b9befcba8b5": { "source": { "path": "appsync-opensearch.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cbf69265acb5253067d9fc78cec3e7b151737dc0ba84d10aedd04a2c12f84bc4.json", + "objectKey": "f8a2a9f9e0d429354b6c00646ad4364f5e46ab6ceecf270d2ff59b9befcba8b5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.template.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.template.json index 9b3b8ea1cb382..d754b3115a94f 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.template.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.template.json @@ -36,7 +36,7 @@ "EncryptionAtRestOptions": { "Enabled": true }, - "EngineVersion": "OpenSearch_1.3", + "EngineVersion": "OpenSearch_2.3", "LogPublishingOptions": {}, "NodeToNodeEncryptionOptions": { "Enabled": true diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/cdk.out b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/cdk.out index 145739f539580..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"22.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/integ.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/integ.json index 9082fbbe8ed5d..bb6303b9a3102 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "22.0.0", + "version": "29.0.0", "testCases": { - "integ.graphql-opensearch": { + "opensearch-2.3-stack/DefaultTest": { "stacks": [ "appsync-opensearch" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "opensearch-2.3-stack/DefaultTest/DeployAssert", + "assertionStackName": "opensearch23stackDefaultTestDeployAssert16E12129" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/manifest.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/manifest.json index 81e53a3ee447f..b2fd7635f79eb 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "29.0.0", "artifacts": { "appsync-opensearch.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cbf69265acb5253067d9fc78cec3e7b151737dc0ba84d10aedd04a2c12f84bc4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f8a2a9f9e0d429354b6c00646ad4364f5e46ab6ceecf270d2ff59b9befcba8b5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -98,18 +98,56 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ] + }, + "displayName": "appsync-opensearch" + }, + "opensearch23stackDefaultTestDeployAssert16E12129.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "opensearch23stackDefaultTestDeployAssert16E12129.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "opensearch23stackDefaultTestDeployAssert16E12129": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "opensearch23stackDefaultTestDeployAssert16E12129.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "opensearch23stackDefaultTestDeployAssert16E12129.assets" ], - "apidsQuerygetTestsResolver5C6FBB59": [ + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "opensearch23stackDefaultTestDeployAssert16E12129.assets" + ], + "metadata": { + "/opensearch-2.3-stack/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/opensearch-2.3-stack/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "apidsQuerygetTestsResolver5C6FBB59", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "CheckBootstrapVersion" } ] }, - "displayName": "appsync-opensearch" + "displayName": "opensearch-2.3-stack/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/opensearch23stackDefaultTestDeployAssert16E12129.assets.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/opensearch23stackDefaultTestDeployAssert16E12129.assets.json new file mode 100644 index 0000000000000..b3ad2c593e0e2 --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/opensearch23stackDefaultTestDeployAssert16E12129.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "opensearch23stackDefaultTestDeployAssert16E12129.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/opensearch23stackDefaultTestDeployAssert16E12129.template.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/opensearch23stackDefaultTestDeployAssert16E12129.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/opensearch23stackDefaultTestDeployAssert16E12129.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/tree.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/tree.json index 7c9f3a92a3545..038e752c0e9d7 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/tree.json @@ -70,7 +70,7 @@ "encryptionAtRestOptions": { "enabled": true }, - "engineVersion": "OpenSearch_1.3", + "engineVersion": "OpenSearch_2.3", "logPublishingOptions": {}, "nodeToNodeEncryptionOptions": { "enabled": true @@ -383,12 +383,66 @@ "version": "0.0.0" } }, + "opensearch-2.3-stack": { + "id": "opensearch-2.3-stack", + "path": "opensearch-2.3-stack", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "opensearch-2.3-stack/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "opensearch-2.3-stack/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.209" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "opensearch-2.3-stack/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "opensearch-2.3-stack/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "opensearch-2.3-stack/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, "Tree": { "id": "Tree", "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.182" + "version": "10.1.209" } } }, diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.ts b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.ts index 67d283b7ca1e6..daf75dad88555 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.ts +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.ts @@ -2,65 +2,78 @@ import * as path from 'path'; import { User } from '@aws-cdk/aws-iam'; import * as opensearch from '@aws-cdk/aws-opensearchservice'; import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; +import { Construct } from 'constructs'; import * as appsync from '../lib'; -const app = new cdk.App(); -const stack = new cdk.Stack(app, 'appsync-opensearch'); -const user = new User(stack, 'User'); -const domain = new opensearch.Domain(stack, 'Domain', { - version: opensearch.EngineVersion.OPENSEARCH_1_3, - removalPolicy: cdk.RemovalPolicy.DESTROY, - fineGrainedAccessControl: { - masterUserArn: user.userArn, - }, - encryptionAtRest: { - enabled: true, - }, - nodeToNodeEncryption: true, - enforceHttps: true, -}); - -const api = new appsync.GraphqlApi(stack, 'api', { - name: 'api', - schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'appsync.test.graphql')), -}); +class OpensSearch23Stack extends cdk.Stack { + constructor(scope: Construct) { + super(scope, 'appsync-opensearch'); -const ds = api.addOpenSearchDataSource('ds', domain); + const user = new User(this, 'User'); -ds.createResolver('QueryGetTests', { - typeName: 'Query', - fieldName: 'getTests', - requestMappingTemplate: appsync.MappingTemplate.fromString(JSON.stringify({ - version: '2017-02-28', - operation: 'GET', - path: '/id/post/_search', - params: { - headers: {}, - queryString: {}, - body: { - from: 0, - size: 50, + const domain = new opensearch.Domain(this, 'Domain', { + version: opensearch.EngineVersion.OPENSEARCH_2_3, + removalPolicy: cdk.RemovalPolicy.DESTROY, + fineGrainedAccessControl: { + masterUserArn: user.userArn, }, - }, - })), - responseMappingTemplate: appsync.MappingTemplate.fromString(JSON.stringify({ - version: '2017-02-28', - operation: 'GET', - path: '/id/post/_search', - params: { - headers: {}, - queryString: {}, - body: { - from: 0, - size: 50, - query: { - term: { - author: '$util.toJson($context.arguments.author)', + encryptionAtRest: { + enabled: true, + }, + nodeToNodeEncryption: true, + enforceHttps: true, + }); + + const api = new appsync.GraphqlApi(this, 'api', { + name: 'api', + schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'appsync.test.graphql')), + }); + + const ds = api.addOpenSearchDataSource('ds', domain); + + ds.createResolver('QueryGetTests', { + typeName: 'Query', + fieldName: 'getTests', + requestMappingTemplate: appsync.MappingTemplate.fromString(JSON.stringify({ + version: '2017-02-28', + operation: 'GET', + path: '/id/post/_search', + params: { + headers: {}, + queryString: {}, + body: { + from: 0, + size: 50, }, }, - }, - }, - })), + })), + responseMappingTemplate: appsync.MappingTemplate.fromString(JSON.stringify({ + version: '2017-02-28', + operation: 'GET', + path: '/id/post/_search', + params: { + headers: {}, + queryString: {}, + body: { + from: 0, + size: 50, + query: { + term: { + author: '$util.toJson($context.arguments.author)', + }, + }, + }, + }, + })), + }); + } +} + +const app = new cdk.App(); +const testCase = new OpensSearch23Stack(app); +new IntegTest(app, 'opensearch-2.3-stack', { + testCases: [testCase], }); app.synth(); diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets.json new file mode 100644 index 0000000000000..dfa7c128d3268 --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.template.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/appsync-lambda-auth.assets.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/appsync-lambda-auth.assets.json new file mode 100644 index 0000000000000..e127812abf26f --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/appsync-lambda-auth.assets.json @@ -0,0 +1,32 @@ +{ + "version": "29.0.0", + "files": { + "df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443": { + "source": { + "path": "asset.df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "6318a3460f2277a0215d1d3dec988f54f73d1ebd0221c7a7cc4d2bcb6324b50f": { + "source": { + "path": "appsync-lambda-auth.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "6318a3460f2277a0215d1d3dec988f54f73d1ebd0221c7a7cc4d2bcb6324b50f.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/appsync-lambda-auth.template.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/appsync-lambda-auth.template.json new file mode 100644 index 0000000000000..a9950dc91b248 --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/appsync-lambda-auth.template.json @@ -0,0 +1,171 @@ +{ + "Resources": { + "funcServiceRoleA96CCB44": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "funcC3A0C2E2": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443.zip" + }, + "Role": { + "Fn::GetAtt": [ + "funcServiceRoleA96CCB44", + "Arn" + ] + }, + "Handler": "lambda-tutorial.handler", + "Runtime": "nodejs14.x" + }, + "DependsOn": [ + "funcServiceRoleA96CCB44" + ] + }, + "funcapi1appsync5C5BBFA1": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + }, + "Principal": "appsync.amazonaws.com" + } + }, + "funcapi2appsync0EE83EF2": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + }, + "Principal": "appsync.amazonaws.com" + } + }, + "api1A91238E2": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "AWS_LAMBDA", + "Name": "api1", + "LambdaAuthorizerConfig": { + "AuthorizerUri": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + } + } + } + }, + "api1SchemaFFA53DB6": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "api1A91238E2", + "ApiId" + ] + }, + "Definition": "type test {\n version: String!\n}\ntype Query {\n getTests: [test]!\n}\ntype Mutation {\n addTest(version: String!): test\n}\n" + } + }, + "api2C4850CEA": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "AWS_LAMBDA", + "Name": "api2", + "LambdaAuthorizerConfig": { + "AuthorizerUri": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + } + } + } + }, + "api2SchemaD5C26031": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "api2C4850CEA", + "ApiId" + ] + }, + "Definition": "type test {\n version: String!\n}\ntype Query {\n getTests: [test]!\n}\ntype Mutation {\n addTest(version: String!): test\n}\n" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/asset.df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443/lambda-tutorial.js b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/asset.df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443/lambda-tutorial.js new file mode 100644 index 0000000000000..5a08f83ef4f0a --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/asset.df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443/lambda-tutorial.js @@ -0,0 +1,70 @@ +exports.handler = (event, context, callback) => { + console.log("Received event {}", JSON.stringify(event, 3)); + var posts = { + "1": {"id": "1", "title": "First book", "author": "Author1", "url": "https://amazon.com/", "content": "SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1", "ups": "100", "downs": "10"}, + "2": {"id": "2", "title": "Second book", "author": "Author2", "url": "https://amazon.com", "content": "SAMPLE TEXT AUTHOR 2 SAMPLE TEXT AUTHOR 2 SAMPLE TEXT", "ups": "100", "downs": "10"}, + "3": {"id": "3", "title": "Third book", "author": "Author3", "url": null, "content": null, "ups": null, "downs": null }, + "4": {"id": "4", "title": "Fourth book", "author": "Author4", "url": "https://www.amazon.com/", "content": "SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4", "ups": "1000", "downs": "0"}, + "5": {"id": "5", "title": "Fifth book", "author": "Author5", "url": "https://www.amazon.com/", "content": "SAMPLE TEXT AUTHOR 5 SAMPLE TEXT AUTHOR 5 SAMPLE TEXT AUTHOR 5 SAMPLE TEXT AUTHOR 5 SAMPLE TEXT", "ups": "50", "downs": "0"} }; + + var relatedPosts = { + "1": [posts['4']], + "2": [posts['3'], posts['5']], + "3": [posts['2'], posts['1']], + "4": [posts['2'], posts['1']], + "5": [] + }; + const isBatch = Array.isArray(event); + if (isBatch) { + console.log("Got an BatchInvoke Request. The payload has %d items to resolve.", event.length); + const field = event[0].field; + switch(field) { + case "relatedPostsMaxBatchSize": + case "relatedPosts": + var results = []; + // the response MUST contain the same number + // of entries as the payload array + for (var i=0; i< event.length; i++) { + console.log("post {}", JSON.stringify(event[i].source)); + results.push(relatedPosts[event[i].source.id]); + } + console.log("results {}", JSON.stringify(results)); + callback(null, results); + break; + default: + callback("Unknown field, unable to resolve" + field, null); + break; + } + } + else { + console.log("Got an Invoke Request."); + switch(event.field) { + case "getPost": + var id = event.arguments.id; + callback(null, posts[id]); + break; + case "allPosts": + var values = []; + for(var d in posts){ + values.push(posts[d]); + } + callback(null, values); + break; + case "addPost": + // return the arguments back + callback(null, event.arguments); + break; + case "addPostErrorWithData": + var id = event.arguments.id; + var result = posts[id]; + // attached additional error information to the post + result.errorMessage = 'Error with the mutation, data has changed'; + result.errorType = 'MUTATION_ERROR'; + callback(null, result); + break; + default: + callback("Unknown field, unable to resolve" + event.field, null); + break; + } + } +}; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/cdk.out b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/integ.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/integ.json new file mode 100644 index 0000000000000..103d6f2827f82 --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "29.0.0", + "testCases": { + "GraphQlApiLambdaAuth/DefaultTest": { + "stacks": [ + "appsync-lambda-auth" + ], + "assertionStack": "GraphQlApiLambdaAuth/DefaultTest/DeployAssert", + "assertionStackName": "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/manifest.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/manifest.json new file mode 100644 index 0000000000000..48c60d6f85566 --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/manifest.json @@ -0,0 +1,171 @@ +{ + "version": "29.0.0", + "artifacts": { + "appsync-lambda-auth.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "appsync-lambda-auth.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "appsync-lambda-auth": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "appsync-lambda-auth.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6318a3460f2277a0215d1d3dec988f54f73d1ebd0221c7a7cc4d2bcb6324b50f.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "appsync-lambda-auth.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "appsync-lambda-auth.assets" + ], + "metadata": { + "/appsync-lambda-auth/func/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "funcServiceRoleA96CCB44" + } + ], + "/appsync-lambda-auth/func/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "funcC3A0C2E2" + } + ], + "/appsync-lambda-auth/func/api1-appsync": [ + { + "type": "aws:cdk:logicalId", + "data": "funcapi1appsync5C5BBFA1" + } + ], + "/appsync-lambda-auth/func/api2-appsync": [ + { + "type": "aws:cdk:logicalId", + "data": "funcapi2appsync0EE83EF2" + } + ], + "/appsync-lambda-auth/api1/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "api1A91238E2" + } + ], + "/appsync-lambda-auth/api1/Schema": [ + { + "type": "aws:cdk:logicalId", + "data": "api1SchemaFFA53DB6" + } + ], + "/appsync-lambda-auth/api2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "api2C4850CEA" + } + ], + "/appsync-lambda-auth/api2/Schema": [ + { + "type": "aws:cdk:logicalId", + "data": "api2SchemaD5C26031" + } + ], + "/appsync-lambda-auth/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/appsync-lambda-auth/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ], + "funcfuncapi1appsync58E50481": [ + { + "type": "aws:cdk:logicalId", + "data": "funcfuncapi1appsync58E50481", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcfuncapi2appsync8B273744": [ + { + "type": "aws:cdk:logicalId", + "data": "funcfuncapi2appsync8B273744", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ] + }, + "displayName": "appsync-lambda-auth" + }, + "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "GraphQlApiLambdaAuthDefaultTestDeployAssert3A9D82EA.assets" + ], + "metadata": { + "/GraphQlApiLambdaAuth/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/GraphQlApiLambdaAuth/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "GraphQlApiLambdaAuth/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/tree.json b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/tree.json new file mode 100644 index 0000000000000..4266a4d1a8c82 --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.js.snapshot/tree.json @@ -0,0 +1,385 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "appsync-lambda-auth": { + "id": "appsync-lambda-auth", + "path": "appsync-lambda-auth", + "children": { + "func": { + "id": "func", + "path": "appsync-lambda-auth/func", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "appsync-lambda-auth/func/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "appsync-lambda-auth/func/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "appsync-lambda-auth/func/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "appsync-lambda-auth/func/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "appsync-lambda-auth/func/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "appsync-lambda-auth/func/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "appsync-lambda-auth/func/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443.zip" + }, + "role": { + "Fn::GetAtt": [ + "funcServiceRoleA96CCB44", + "Arn" + ] + }, + "handler": "lambda-tutorial.handler", + "runtime": "nodejs14.x" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + }, + "api1-appsync": { + "id": "api1-appsync", + "path": "appsync-lambda-auth/func/api1-appsync", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + }, + "principal": "appsync.amazonaws.com" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "version": "0.0.0" + } + }, + "api2-appsync": { + "id": "api2-appsync", + "path": "appsync-lambda-auth/func/api2-appsync", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + }, + "principal": "appsync.amazonaws.com" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + }, + "api1": { + "id": "api1", + "path": "appsync-lambda-auth/api1", + "children": { + "Resource": { + "id": "Resource", + "path": "appsync-lambda-auth/api1/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppSync::GraphQLApi", + "aws:cdk:cloudformation:props": { + "authenticationType": "AWS_LAMBDA", + "name": "api1", + "lambdaAuthorizerConfig": { + "authorizerUri": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + } + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appsync.CfnGraphQLApi", + "version": "0.0.0" + } + }, + "Schema": { + "id": "Schema", + "path": "appsync-lambda-auth/api1/Schema", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppSync::GraphQLSchema", + "aws:cdk:cloudformation:props": { + "apiId": { + "Fn::GetAtt": [ + "api1A91238E2", + "ApiId" + ] + }, + "definition": "type test {\n version: String!\n}\ntype Query {\n getTests: [test]!\n}\ntype Mutation {\n addTest(version: String!): test\n}\n" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appsync.CfnGraphQLSchema", + "version": "0.0.0" + } + }, + "LogGroup": { + "id": "LogGroup", + "path": "appsync-lambda-auth/api1/LogGroup", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appsync.GraphqlApi", + "version": "0.0.0" + } + }, + "api2": { + "id": "api2", + "path": "appsync-lambda-auth/api2", + "children": { + "Resource": { + "id": "Resource", + "path": "appsync-lambda-auth/api2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppSync::GraphQLApi", + "aws:cdk:cloudformation:props": { + "authenticationType": "AWS_LAMBDA", + "name": "api2", + "lambdaAuthorizerConfig": { + "authorizerUri": { + "Fn::GetAtt": [ + "funcC3A0C2E2", + "Arn" + ] + } + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appsync.CfnGraphQLApi", + "version": "0.0.0" + } + }, + "Schema": { + "id": "Schema", + "path": "appsync-lambda-auth/api2/Schema", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AppSync::GraphQLSchema", + "aws:cdk:cloudformation:props": { + "apiId": { + "Fn::GetAtt": [ + "api2C4850CEA", + "ApiId" + ] + }, + "definition": "type test {\n version: String!\n}\ntype Query {\n getTests: [test]!\n}\ntype Mutation {\n addTest(version: String!): test\n}\n" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appsync.CfnGraphQLSchema", + "version": "0.0.0" + } + }, + "LogGroup": { + "id": "LogGroup", + "path": "appsync-lambda-auth/api2/LogGroup", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-appsync.GraphqlApi", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "appsync-lambda-auth/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "appsync-lambda-auth/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "GraphQlApiLambdaAuth": { + "id": "GraphQlApiLambdaAuth", + "path": "GraphQlApiLambdaAuth", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "GraphQlApiLambdaAuth/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "GraphQlApiLambdaAuth/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.216" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "GraphQlApiLambdaAuth/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "GraphQlApiLambdaAuth/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "GraphQlApiLambdaAuth/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.216" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.ts b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.ts new file mode 100644 index 0000000000000..3d23cfc405d2d --- /dev/null +++ b/packages/@aws-cdk/aws-appsync/test/integ.lambda-auth.ts @@ -0,0 +1,58 @@ +import * as path from 'path'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; +import { Construct } from 'constructs'; +import * as appsync from '../lib'; + +class GraphQLApiLambdaAuthStack extends cdk.Stack { + constructor(scope: Construct) { + super(scope, 'appsync-lambda-auth'); + + const func = new lambda.Function(this, 'func', { + code: lambda.Code.fromAsset( + path.join(__dirname, 'verify/lambda-tutorial'), + ), + handler: 'lambda-tutorial.handler', + runtime: lambda.Runtime.NODEJS_14_X, + }); + + new appsync.GraphqlApi(this, 'api1', { + name: 'api1', + schema: appsync.SchemaFile.fromAsset( + path.join(__dirname, 'appsync.test.graphql'), + ), + authorizationConfig: { + defaultAuthorization: { + authorizationType: appsync.AuthorizationType.LAMBDA, + lambdaAuthorizerConfig: { + handler: func, + }, + }, + }, + }); + + new appsync.GraphqlApi(this, 'api2', { + name: 'api2', + schema: appsync.SchemaFile.fromAsset( + path.join(__dirname, 'appsync.test.graphql'), + ), + authorizationConfig: { + defaultAuthorization: { + authorizationType: appsync.AuthorizationType.LAMBDA, + lambdaAuthorizerConfig: { + handler: func, + }, + }, + }, + }); + } +} + +const app = new cdk.App(); +const testCase = new GraphQLApiLambdaAuthStack(app); +new IntegTest(app, 'GraphQlApiLambdaAuth', { + testCases: [testCase], +}); + +app.synth(); diff --git a/packages/@aws-cdk/aws-certificatemanager/README.md b/packages/@aws-cdk/aws-certificatemanager/README.md index cc7f9fb9b9986..54b98fda913b5 100644 --- a/packages/@aws-cdk/aws-certificatemanager/README.md +++ b/packages/@aws-cdk/aws-certificatemanager/README.md @@ -100,15 +100,40 @@ new acm.Certificate(this, 'Certificate', { ## Cross-region Certificates ACM certificates that are used with CloudFront -- or higher-level constructs which rely on CloudFront -- must be in the `us-east-1` region. -The `DnsValidatedCertificate` construct exists to facilitate creating these certificates cross-region. This resource can only be used with -Route53-based DNS validation. +CloudFormation allows you to create a Stack with a CloudFront distribution in any region. In order +to create an ACM certificate in us-east-1 and reference it in a CloudFront distribution is a +different region, it is recommended to perform a multi stack deployment. + +Enable the Stack property `crossRegionReferences` +in order to access the cross stack/region certificate. + +> **This feature is currently experimental** ```ts -declare const myHostedZone: route53.HostedZone; -new acm.DnsValidatedCertificate(this, 'CrossRegionCertificate', { - domainName: 'hello.example.com', - hostedZone: myHostedZone, - region: 'us-east-1', +const stack1 = new Stack(app, 'Stack1', { + env: { + region: 'us-east-1', + }, + crossRegionReferences: true, +}); +const cert = new acm.Certificate(stack1, 'Cert', { + domainName: '*.example.com', + validation: acm.CertificateValidation.fromDns(PublicHostedZone.fromHostedZoneId(stack1, 'Zone', 'ZONE_ID')), +}); + +const stack2 = new Stack(app, 'Stack2', { + env: { + region: 'us-east-2', + }, + crossRegionReferences: true, +}); + +new cloudfront.Distribution(stack2, 'Distribution', { + defaultBehavior: { + origin: new origins.HttpOrigin('example.com'), + }, + domainNames: ['dev.example.com'], + certificate: cert, }); ``` diff --git a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json index 8b818d1b82425..94fb18189e3b7 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json @@ -43,7 +43,7 @@ "jest": "^27.5.1", "lambda-tester": "^3.6.0", "sinon": "^9.2.4", - "nock": "^13.2.9", + "nock": "^13.3.0", "ts-jest": "^27.1.5" } } diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts index 775178379728c..b2d2e0a35e6cd 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts @@ -66,6 +66,7 @@ export interface DnsValidatedCertificateProps extends CertificateProps { * validated using DNS validation against the specified Route 53 hosted zone. * * @resource AWS::CertificateManager::Certificate + * @deprecated use {@link Certificate} instead */ export class DnsValidatedCertificate extends CertificateBase implements ICertificate, cdk.ITaggable { public readonly certificateArn: string; diff --git a/packages/@aws-cdk/aws-certificatemanager/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-certificatemanager/rosetta/default.ts-fixture index 0a11d49d2511f..774bd94dbca22 100644 --- a/packages/@aws-cdk/aws-certificatemanager/rosetta/default.ts-fixture +++ b/packages/@aws-cdk/aws-certificatemanager/rosetta/default.ts-fixture @@ -1,12 +1,15 @@ // Fixture with packages imported, but nothing else -import { Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as acm from '@aws-cdk/aws-certificatemanager'; import * as route53 from '@aws-cdk/aws-route53'; +import { PublicHostedZone } from '@aws-cdk/aws-route53'; +import { StringParameter } from '@aws-cdk/aws-ssm'; +import { Stack, Names } from '@aws-cdk/core'; +import { AwsCustomResource, PhysicalResourceId, AwsCustomResourcePolicy } from '@aws-cdk/custom-resources'; class Fixture extends Stack { constructor(scope: Construct, id: string) { super(scope, id); /// here } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts b/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts index 1f7fa5a64f455..f7c827cddfebd 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts @@ -1,10 +1,11 @@ import { Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import { HostedZone, PublicHostedZone } from '@aws-cdk/aws-route53'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import { App, Stack, Token, Tags, RemovalPolicy, Aws } from '@aws-cdk/core'; import { DnsValidatedCertificate } from '../lib/dns-validated-certificate'; -test('creates CloudFormation Custom Resource', () => { +testDeprecated('creates CloudFormation Custom Resource', () => { const stack = new Stack(); const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { @@ -94,7 +95,7 @@ test('creates CloudFormation Custom Resource', () => { }); }); -test('adds validation error on domain mismatch', () => { +testDeprecated('adds validation error on domain mismatch', () => { const stack = new Stack(); const helloDotComZone = new PublicHostedZone(stack, 'HelloDotCom', { @@ -111,7 +112,7 @@ test('adds validation error on domain mismatch', () => { }).toThrow(/DNS zone hello.com is not authoritative for certificate domain name example.com/); }); -test('does not try to validate unresolved tokens', () => { +testDeprecated('does not try to validate unresolved tokens', () => { const stack = new Stack(); const helloDotComZone = new PublicHostedZone(stack, 'HelloDotCom', { @@ -126,7 +127,7 @@ test('does not try to validate unresolved tokens', () => { Template.fromStack(stack); // does not throw }); -test('test root certificate', () => { +testDeprecated('test root certificate', () => { const stack = new Stack(); const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { @@ -152,7 +153,7 @@ test('test root certificate', () => { }); }); -test('test tags are passed to customresource', () => { +testDeprecated('test tags are passed to customresource', () => { const stack = new Stack(); Tags.of(stack).add('Key1', 'Value1'); @@ -182,7 +183,7 @@ test('test tags are passed to customresource', () => { }); }); -test('works with imported zone', () => { +testDeprecated('works with imported zone', () => { // GIVEN const app = new App(); const stack = new Stack(app, 'Stack', { @@ -213,7 +214,7 @@ test('works with imported zone', () => { }); }); -test('works with imported role', () => { +testDeprecated('works with imported role', () => { // GIVEN const app = new App(); const stack = new Stack(app, 'Stack', { @@ -238,7 +239,7 @@ test('works with imported role', () => { }); -test('throws when domain name is longer than 64 characters', () => { +testDeprecated('throws when domain name is longer than 64 characters', () => { const stack = new Stack(); const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { @@ -252,7 +253,7 @@ test('throws when domain name is longer than 64 characters', () => { }).toThrow(/Domain name must be 64 characters or less/); }), -test('does not throw when domain name is longer than 64 characters with tokens', () => { +testDeprecated('does not throw when domain name is longer than 64 characters with tokens', () => { const stack = new Stack(); const zoneName = 'example.com'; const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { @@ -293,7 +294,7 @@ test('does not throw when domain name is longer than 64 characters with tokens', }); }); -test('test transparency logging settings is passed to the custom resource', () => { +testDeprecated('test transparency logging settings is passed to the custom resource', () => { const stack = new Stack(); const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { @@ -321,7 +322,7 @@ test('test transparency logging settings is passed to the custom resource', () = }); }); -test('can set removal policy', () => { +testDeprecated('can set removal policy', () => { const stack = new Stack(); const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { diff --git a/packages/@aws-cdk/aws-certificatemanager/test/util.test.ts b/packages/@aws-cdk/aws-certificatemanager/test/util.test.ts index 5c1ccf5315499..ce2203f005b41 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/util.test.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/util.test.ts @@ -1,4 +1,5 @@ import { PublicHostedZone } from '@aws-cdk/aws-route53'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import { App, Aws, Stack } from '@aws-cdk/core'; import { Certificate, DnsValidatedCertificate } from '../lib'; import { apexDomain, getCertificateRegion, isDnsValidatedCertificate } from '../lib/util'; @@ -15,7 +16,7 @@ describe('apex domain', () => { }); describe('isDnsValidatedCertificate', () => { - test('new DnsValidatedCertificate is a DnsValidatedCertificate', () => { + testDeprecated('new DnsValidatedCertificate is a DnsValidatedCertificate', () => { const stack = new Stack(); const hostedZone = new PublicHostedZone(stack, 'ExampleDotCom', { @@ -61,7 +62,7 @@ describe('getCertificateRegion', () => { expect(getCertificateRegion(certificate)).toEqual('eu-west-1'); }); - test('from DnsValidatedCertificate region', () => { + testDeprecated('from DnsValidatedCertificate region', () => { // GIVEN const app = new App(); const stack = new Stack(app, 'RegionStack', { env: { region: 'eu-west-1' } }); diff --git a/packages/@aws-cdk/aws-cloudfront/README.md b/packages/@aws-cdk/aws-cloudfront/README.md index ecd6f06448885..95e0acb755f13 100644 --- a/packages/@aws-cdk/aws-cloudfront/README.md +++ b/packages/@aws-cdk/aws-cloudfront/README.md @@ -99,9 +99,9 @@ import * as acm from '@aws-cdk/aws-certificatemanager'; import * as route53 from '@aws-cdk/aws-route53'; declare const hostedZone: route53.HostedZone; -const myCertificate = new acm.DnsValidatedCertificate(this, 'mySiteCert', { +const myCertificate = new acm.Certificate(this, 'mySiteCert', { domainName: 'www.example.com', - hostedZone, + validation: acm.CertificateValidation.fromDns(hostedZone), }); declare const myBucket: s3.Bucket; @@ -574,7 +574,7 @@ just HTTP/3. For all supported HTTP versions, see the `HttpVerson` enum. ```ts // Configure a distribution to use HTTP/2 and HTTP/3 new cloudfront.Distribution(this, 'myDist', { - defaultBehavior: { origin: new origins.HttpOrigin('www.example.com'); }, + defaultBehavior: { origin: new origins.HttpOrigin('www.example.com') }, httpVersion: cloudfront.HttpVersion.HTTP2_AND_3, }); ``` diff --git a/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts b/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts index 8161e56fab336..1838a043429bb 100644 --- a/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts +++ b/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts @@ -235,6 +235,7 @@ export class Trail extends Resource { public readonly logGroup?: logs.ILogGroup; private s3bucket: s3.IBucket; + private managementEvents: ReadWriteType | undefined; private eventSelectors: EventSelector[] = []; private topic: sns.ITopic | undefined; private insightTypeValues: InsightSelector[] | undefined; @@ -289,20 +290,14 @@ export class Trail extends Resource { })); } - if (props.managementEvents) { - let managementEvent; - if (props.managementEvents === ReadWriteType.NONE) { - managementEvent = { - includeManagementEvents: false, - }; - } else { - managementEvent = { - includeManagementEvents: true, - readWriteType: props.managementEvents, - }; - } - this.eventSelectors.push(managementEvent); + this.managementEvents = props.managementEvents; + if (this.managementEvents && this.managementEvents !== ReadWriteType.NONE) { + this.eventSelectors.push({ + includeManagementEvents: true, + readWriteType: props.managementEvents, + }); } + this.node.addValidation({ validate: () => this.validateEventSelectors() }); if (props.kmsKey && props.encryptionKey) { throw new Error('Both kmsKey and encryptionKey must not be specified. Use only encryptionKey'); @@ -373,12 +368,17 @@ export class Trail extends Resource { throw new Error('A maximum of 5 event selectors are supported per trail.'); } + let includeAllManagementEvents; + if (this.managementEvents === ReadWriteType.NONE) { + includeAllManagementEvents = false; + } + this.eventSelectors.push({ dataResources: [{ type: dataResourceType, values: dataResourceValues, }], - includeManagementEvents: options.includeManagementEvents, + includeManagementEvents: options.includeManagementEvents ?? includeAllManagementEvents, excludeManagementEventSources: options.excludeManagementEventSources, readWriteType: options.readWriteType, }); @@ -403,7 +403,7 @@ export class Trail extends Resource { } /** - * Log all Lamda data events for all lambda functions the account. + * Log all Lambda data events for all lambda functions the account. * @see https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html * @default false */ @@ -451,6 +451,15 @@ export class Trail extends Resource { public onCloudTrailEvent(id: string, options: events.OnEventOptions = {}): events.Rule { return Trail.onEvent(this, id, options); } + + private validateEventSelectors(): string[] { + const errors: string[] = []; + // Ensure that there is at least one event selector when management events are set to None + if (this.managementEvents === ReadWriteType.NONE && this.eventSelectors.length === 0) { + errors.push('At least one event selector must be added when management event recording is set to None'); + } + return errors; + } } /** diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts index c041a674621e6..a026f732793ab 100644 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts +++ b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts @@ -625,19 +625,77 @@ describe('cloudtrail', () => { }); }); - test('managementEvents set to None correctly turns off management events', () => { + test('not provided and managementEvents set to None throws missing event selectors error', () => { const stack = getTestStack(); new Trail(stack, 'MyAmazingCloudTrail', { managementEvents: ReadWriteType.NONE, }); + expect(() => { + Template.fromStack(stack); + }).toThrowError(/At least one event selector must be added when management event recording is set to None/); + }); + + test('defaults to not include management events when managementEvents set to None', () => { + const stack = getTestStack(); + + const cloudTrail = new Trail(stack, 'MyAmazingCloudTrail', { + managementEvents: ReadWriteType.NONE, + }); + + const bucket = new s3.Bucket(stack, 'testBucket', { bucketName: 'test-bucket' }); + cloudTrail.addS3EventSelector([{ bucket }]); + Template.fromStack(stack).hasResourceProperties('AWS::CloudTrail::Trail', { - EventSelectors: [ - { - IncludeManagementEvents: false, - }, - ], + EventSelectors: [{ + DataResources: [{ + Type: 'AWS::S3::Object', + Values: [{ + 'Fn::Join': [ + '', + [ + { 'Fn::GetAtt': ['testBucketDF4D7D1A', 'Arn'] }, + '/', + ], + ], + }], + }], + IncludeManagementEvents: false, + }], + }); + }); + + test('includeManagementEvents can be overridden when managementEvents set to None', () => { + const stack = getTestStack(); + + const cloudTrail = new Trail(stack, 'MyAmazingCloudTrail', { + managementEvents: ReadWriteType.NONE, + }); + + const bucket = new s3.Bucket(stack, 'testBucket', { bucketName: 'test-bucket' }); + cloudTrail.addS3EventSelector([{ bucket }], { + includeManagementEvents: true, + readWriteType: ReadWriteType.WRITE_ONLY, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CloudTrail::Trail', { + EventSelectors: [{ + DataResources: [{ + Type: 'AWS::S3::Object', + Values: [{ + 'Fn::Join': [ + '', + [ + { 'Fn::GetAtt': ['testBucketDF4D7D1A', 'Arn'] }, + '/', + ], + ], + }], + }], + IncludeManagementEvents: true, + ReadWriteType: 'WriteOnly', + }], }); }); diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets.json new file mode 100644 index 0000000000000..9534dc22f99f2 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets.json @@ -0,0 +1,19 @@ +{ + "version": "22.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.template.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/cdk.out b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/cdk.out new file mode 100644 index 0000000000000..145739f539580 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ-cloudtrail-data-events.assets.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ-cloudtrail-data-events.assets.json new file mode 100644 index 0000000000000..56a8815860665 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ-cloudtrail-data-events.assets.json @@ -0,0 +1,19 @@ +{ + "version": "22.0.0", + "files": { + "1e43b2272a716f06e79a67fe7810bd64d2c4f198ec606c15bac1ce856e05dbbc": { + "source": { + "path": "integ-cloudtrail-data-events.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1e43b2272a716f06e79a67fe7810bd64d2c4f198ec606c15bac1ce856e05dbbc.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ-cloudtrail-data-events.template.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ-cloudtrail-data-events.template.json new file mode 100644 index 0000000000000..50ddad982e7c2 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ-cloudtrail-data-events.template.json @@ -0,0 +1,245 @@ +{ + "Resources": { + "Bucket83908E77": { + "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaFunctionServiceRoleC555A460": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LambdaFunctionBF21E41F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = {}" + }, + "Role": { + "Fn::GetAtt": [ + "LambdaFunctionServiceRoleC555A460", + "Arn" + ] + }, + "Handler": "hello.handler", + "Runtime": "nodejs18.x" + }, + "DependsOn": [ + "LambdaFunctionServiceRoleC555A460" + ] + }, + "TrailS30071F172": { + "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "TrailS3PolicyE42170FE": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "TrailS30071F172" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": "s3:GetBucketAcl", + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Condition": { + "StringEquals": { + "s3:x-amz-acl": "bucket-owner-full-control" + } + }, + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/AWSLogs/", + { + "Ref": "AWS::AccountId" + }, + "/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + }, + "Trail022F0CF2": { + "Type": "AWS::CloudTrail::Trail", + "Properties": { + "IsLogging": true, + "S3BucketName": { + "Ref": "TrailS30071F172" + }, + "EnableLogFileValidation": true, + "EventSelectors": [ + { + "DataResources": [ + { + "Type": "AWS::Lambda::Function", + "Values": [ + { + "Fn::GetAtt": [ + "LambdaFunctionBF21E41F", + "Arn" + ] + } + ] + } + ], + "IncludeManagementEvents": false + }, + { + "DataResources": [ + { + "Type": "AWS::S3::Object", + "Values": [ + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Bucket83908E77", + "Arn" + ] + }, + "/" + ] + ] + } + ] + } + ], + "IncludeManagementEvents": false + } + ], + "IncludeGlobalServiceEvents": true, + "IsMultiRegionTrail": true + }, + "DependsOn": [ + "TrailS3PolicyE42170FE" + ] + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ.json new file mode 100644 index 0000000000000..f4758e7039103 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "22.0.0", + "testCases": { + "CloudTrailDataEventsOnlyTest/DefaultTest": { + "stacks": [ + "integ-cloudtrail-data-events" + ], + "assertionStack": "CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert", + "assertionStackName": "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/manifest.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/manifest.json new file mode 100644 index 0000000000000..b27cfab19b9e8 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/manifest.json @@ -0,0 +1,141 @@ +{ + "version": "22.0.0", + "artifacts": { + "integ-cloudtrail-data-events.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-cloudtrail-data-events.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-cloudtrail-data-events": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-cloudtrail-data-events.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/1e43b2272a716f06e79a67fe7810bd64d2c4f198ec606c15bac1ce856e05dbbc.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-cloudtrail-data-events.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-cloudtrail-data-events.assets" + ], + "metadata": { + "/integ-cloudtrail-data-events/Bucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Bucket83908E77" + } + ], + "/integ-cloudtrail-data-events/LambdaFunction/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaFunctionServiceRoleC555A460" + } + ], + "/integ-cloudtrail-data-events/LambdaFunction/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaFunctionBF21E41F" + } + ], + "/integ-cloudtrail-data-events/Trail/S3/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TrailS30071F172" + } + ], + "/integ-cloudtrail-data-events/Trail/S3/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TrailS3PolicyE42170FE" + } + ], + "/integ-cloudtrail-data-events/Trail/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Trail022F0CF2" + } + ], + "/integ-cloudtrail-data-events/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-cloudtrail-data-events/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-cloudtrail-data-events" + }, + "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "CloudTrailDataEventsOnlyTestDefaultTestDeployAssertA7E52868.assets" + ], + "metadata": { + "/CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/tree.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/tree.json new file mode 100644 index 0000000000000..99b8d7131da0c --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.js.snapshot/tree.json @@ -0,0 +1,416 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-cloudtrail-data-events": { + "id": "integ-cloudtrail-data-events", + "path": "integ-cloudtrail-data-events", + "children": { + "Bucket": { + "id": "Bucket", + "path": "integ-cloudtrail-data-events/Bucket", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-data-events/Bucket/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucket", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.Bucket", + "version": "0.0.0" + } + }, + "LambdaFunction": { + "id": "LambdaFunction", + "path": "integ-cloudtrail-data-events/LambdaFunction", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-cloudtrail-data-events/LambdaFunction/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-cloudtrail-data-events/LambdaFunction/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-data-events/LambdaFunction/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-data-events/LambdaFunction/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = {}" + }, + "role": { + "Fn::GetAtt": [ + "LambdaFunctionServiceRoleC555A460", + "Arn" + ] + }, + "handler": "hello.handler", + "runtime": "nodejs18.x" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + }, + "Trail": { + "id": "Trail", + "path": "integ-cloudtrail-data-events/Trail", + "children": { + "S3": { + "id": "S3", + "path": "integ-cloudtrail-data-events/Trail/S3", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-data-events/Trail/S3/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucket", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "integ-cloudtrail-data-events/Trail/S3/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-data-events/Trail/S3/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", + "aws:cdk:cloudformation:props": { + "bucket": { + "Ref": "TrailS30071F172" + }, + "policyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": "s3:GetBucketAcl", + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Condition": { + "StringEquals": { + "s3:x-amz-acl": "bucket-owner-full-control" + } + }, + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/AWSLogs/", + { + "Ref": "AWS::AccountId" + }, + "/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.Bucket", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-data-events/Trail/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudTrail::Trail", + "aws:cdk:cloudformation:props": { + "isLogging": true, + "s3BucketName": { + "Ref": "TrailS30071F172" + }, + "enableLogFileValidation": true, + "eventSelectors": [ + { + "dataResources": [ + { + "type": "AWS::Lambda::Function", + "values": [ + { + "Fn::GetAtt": [ + "LambdaFunctionBF21E41F", + "Arn" + ] + } + ] + } + ], + "includeManagementEvents": false + }, + { + "dataResources": [ + { + "type": "AWS::S3::Object", + "values": [ + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Bucket83908E77", + "Arn" + ] + }, + "/" + ] + ] + } + ] + } + ], + "includeManagementEvents": false + } + ], + "includeGlobalServiceEvents": true, + "isMultiRegionTrail": true + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloudtrail.CfnTrail", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloudtrail.Trail", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-cloudtrail-data-events/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-cloudtrail-data-events/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "CloudTrailDataEventsOnlyTest": { + "id": "CloudTrailDataEventsOnlyTest", + "path": "CloudTrailDataEventsOnlyTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "CloudTrailDataEventsOnlyTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "CloudTrailDataEventsOnlyTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "CloudTrailDataEventsOnlyTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.ts b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.ts new file mode 100644 index 0000000000000..585805fd7eef9 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-data-events-only.ts @@ -0,0 +1,27 @@ +import * as lambda from '@aws-cdk/aws-lambda'; +import * as s3 from '@aws-cdk/aws-s3'; +import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import * as cloudtrail from '../lib'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'integ-cloudtrail-data-events'); + +const bucket = new s3.Bucket(stack, 'Bucket', { removalPolicy: cdk.RemovalPolicy.DESTROY }); +const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { + runtime: lambda.Runtime.NODEJS_18_X, + handler: 'hello.handler', + code: lambda.Code.fromInline('exports.handler = {}'), +}); + +const trail = new cloudtrail.Trail(stack, 'Trail', { + managementEvents: cloudtrail.ReadWriteType.NONE, +}); +trail.addLambdaEventSelector([lambdaFunction]); +trail.addS3EventSelector([{ bucket }]); + +new integ.IntegTest(app, 'CloudTrailDataEventsOnlyTest', { + testCases: [stack], +}); + +app.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets.json new file mode 100644 index 0000000000000..084a100d33a77 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets.json @@ -0,0 +1,19 @@ +{ + "version": "22.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.template.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/cdk.out b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/cdk.out new file mode 100644 index 0000000000000..145739f539580 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ-cloudtrail-defaults.assets.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ-cloudtrail-defaults.assets.json new file mode 100644 index 0000000000000..1a7eb49d977f3 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ-cloudtrail-defaults.assets.json @@ -0,0 +1,19 @@ +{ + "version": "22.0.0", + "files": { + "820155cafe83250de59eadcf51df6ea51dbf430ef2ad1d8315b693f5b51137c3": { + "source": { + "path": "integ-cloudtrail-defaults.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "820155cafe83250de59eadcf51df6ea51dbf430ef2ad1d8315b693f5b51137c3.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ-cloudtrail-defaults.template.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ-cloudtrail-defaults.template.json new file mode 100644 index 0000000000000..f3ef1b8ef73bb --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ-cloudtrail-defaults.template.json @@ -0,0 +1,149 @@ +{ + "Resources": { + "TrailS30071F172": { + "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "TrailS3PolicyE42170FE": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "TrailS30071F172" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": "s3:GetBucketAcl", + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Condition": { + "StringEquals": { + "s3:x-amz-acl": "bucket-owner-full-control" + } + }, + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/AWSLogs/", + { + "Ref": "AWS::AccountId" + }, + "/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + }, + "Trail022F0CF2": { + "Type": "AWS::CloudTrail::Trail", + "Properties": { + "IsLogging": true, + "S3BucketName": { + "Ref": "TrailS30071F172" + }, + "EnableLogFileValidation": true, + "EventSelectors": [], + "IncludeGlobalServiceEvents": true, + "IsMultiRegionTrail": true + }, + "DependsOn": [ + "TrailS3PolicyE42170FE" + ] + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ.json new file mode 100644 index 0000000000000..35fc7c9099878 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "22.0.0", + "testCases": { + "CloudTrailDefaultsTest/DefaultTest": { + "stacks": [ + "integ-cloudtrail-defaults" + ], + "assertionStack": "CloudTrailDefaultsTest/DefaultTest/DeployAssert", + "assertionStackName": "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/manifest.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/manifest.json new file mode 100644 index 0000000000000..54bef72ebb403 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/manifest.json @@ -0,0 +1,123 @@ +{ + "version": "22.0.0", + "artifacts": { + "integ-cloudtrail-defaults.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-cloudtrail-defaults.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-cloudtrail-defaults": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-cloudtrail-defaults.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/820155cafe83250de59eadcf51df6ea51dbf430ef2ad1d8315b693f5b51137c3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-cloudtrail-defaults.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-cloudtrail-defaults.assets" + ], + "metadata": { + "/integ-cloudtrail-defaults/Trail/S3/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TrailS30071F172" + } + ], + "/integ-cloudtrail-defaults/Trail/S3/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TrailS3PolicyE42170FE" + } + ], + "/integ-cloudtrail-defaults/Trail/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Trail022F0CF2" + } + ], + "/integ-cloudtrail-defaults/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-cloudtrail-defaults/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-cloudtrail-defaults" + }, + "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "CloudTrailDefaultsTestDefaultTestDeployAssertBD9995EA.assets" + ], + "metadata": { + "/CloudTrailDefaultsTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/CloudTrailDefaultsTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "CloudTrailDefaultsTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/tree.json b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/tree.json new file mode 100644 index 0000000000000..e71632a0ea64d --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.js.snapshot/tree.json @@ -0,0 +1,262 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-cloudtrail-defaults": { + "id": "integ-cloudtrail-defaults", + "path": "integ-cloudtrail-defaults", + "children": { + "Trail": { + "id": "Trail", + "path": "integ-cloudtrail-defaults/Trail", + "children": { + "S3": { + "id": "S3", + "path": "integ-cloudtrail-defaults/Trail/S3", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-defaults/Trail/S3/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucket", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "integ-cloudtrail-defaults/Trail/S3/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-defaults/Trail/S3/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", + "aws:cdk:cloudformation:props": { + "bucket": { + "Ref": "TrailS30071F172" + }, + "policyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": "s3:GetBucketAcl", + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Condition": { + "StringEquals": { + "s3:x-amz-acl": "bucket-owner-full-control" + } + }, + "Effect": "Allow", + "Principal": { + "Service": "cloudtrail.amazonaws.com" + }, + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TrailS30071F172", + "Arn" + ] + }, + "/AWSLogs/", + { + "Ref": "AWS::AccountId" + }, + "/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.Bucket", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-cloudtrail-defaults/Trail/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudTrail::Trail", + "aws:cdk:cloudformation:props": { + "isLogging": true, + "s3BucketName": { + "Ref": "TrailS30071F172" + }, + "enableLogFileValidation": true, + "eventSelectors": [], + "includeGlobalServiceEvents": true, + "isMultiRegionTrail": true + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloudtrail.CfnTrail", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloudtrail.Trail", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-cloudtrail-defaults/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-cloudtrail-defaults/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "CloudTrailDefaultsTest": { + "id": "CloudTrailDefaultsTest", + "path": "CloudTrailDefaultsTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "CloudTrailDefaultsTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "CloudTrailDefaultsTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "CloudTrailDefaultsTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "CloudTrailDefaultsTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "CloudTrailDefaultsTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.ts b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.ts new file mode 100644 index 0000000000000..5691c09704526 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail-defaults.ts @@ -0,0 +1,14 @@ +import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import * as cloudtrail from '../lib'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'integ-cloudtrail-defaults'); + +new cloudtrail.Trail(stack, 'Trail'); + +new integ.IntegTest(app, 'CloudTrailDefaultsTest', { + testCases: [stack], +}); + +app.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts b/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts index 4e4c034563107..6672923e36706 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts @@ -25,12 +25,19 @@ export enum ComputePlatform { export interface IProfilingGroup extends IResource { /** - * A name for the profiling group. + * The name of the profiling group. * * @attribute */ readonly profilingGroupName: string; + /** + * The ARN of the profiling group. + * + * @attribute + */ + readonly profilingGroupArn: string; + /** * Grant access to publish profiling information to the Profiling Group to the given identity. * @@ -158,7 +165,9 @@ export class ProfilingGroup extends ProfilingGroupBase { public readonly profilingGroupArn = profilingGroupArn; } - return new Import(scope, id); + return new Import(scope, id, { + environmentFromArn: profilingGroupArn, + }); } /** diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.assets.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.assets.json index 7a686fcaea9e9..b1010bbf95b7d 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.assets.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "22.0.0", "files": { - "49d6a3151509f39124c2f82b21cf55a8a1364289fce8b6f8b764af6e204c6647": { + "379c030c914943b66d3323572f1c454b9868c7d89ff12a9dbc092112c6580e80": { "source": { "path": "ProfilingGroupTestStack.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "49d6a3151509f39124c2f82b21cf55a8a1364289fce8b6f8b764af6e204c6647.json", + "objectKey": "379c030c914943b66d3323572f1c454b9868c7d89ff12a9dbc092112c6580e80.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.template.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.template.json index 8c7afb0b9f650..2c33824cbc6fa 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.template.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/ProfilingGroupTestStack.template.json @@ -92,6 +92,12 @@ "Value": { "Ref": "ProfilingGroupWithImplicitlySetNameProfilingGroup21CDF1FC" } + }, + "ImportedFromArnProfilingGroupName": { + "Value": "MyAwesomeProfilingGroup" + }, + "ImportedFromArnProfilingGroupArn": { + "Value": "arn:aws:codeguru-profiler:a-region-1:1234567890:profilingGroup/MyAwesomeProfilingGroup" } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/asset.278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.bundle/index.js b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/asset.278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.bundle/index.js new file mode 100644 index 0000000000000..2bf09d6726a42 --- /dev/null +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/asset.278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.bundle/index.js @@ -0,0 +1,1052 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failuresHere = /* @__PURE__ */ new Map(); + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; + return this; + } + get isSuccess() { + return !this._hasFailed; + } + hasFailed() { + return this._hasFailed; + } + get failCount() { + return this._failCount; + } + get failCost() { + return this._cost; + } + compose(id, inner) { + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } + } + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ + matcher: this, + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); + let patternIdx = 0; + let actualIdx = 0; + const matches = new SparseMatrix(); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (matcherName == "absent" || matcherName == "anyValue") { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); + patternIdx++; + } + } + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [a], + message: `Unexpected key ${a}` + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [patternKey], + message: `Missing key '${patternKey}'` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(patternKey, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + if (getType(actual) !== "string") { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: matchResult.renderMismatch() + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/cdk.out b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/cdk.out index 8ecc185e9dbee..145739f539580 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/integ.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/integ.json index 5c8c6510bd130..0e4c9395a0e57 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "22.0.0", "testCases": { "test/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/manifest.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/manifest.json index 02f064057aa9b..a7a4309371fea 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "22.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "ProfilingGroupTestStack.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/49d6a3151509f39124c2f82b21cf55a8a1364289fce8b6f8b764af6e204c6647.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/379c030c914943b66d3323572f1c454b9868c7d89ff12a9dbc092112c6580e80.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -75,6 +69,18 @@ "data": "ImplicitlySetProfilingGroupName" } ], + "/ProfilingGroupTestStack/ImportedFromArnProfilingGroupName": [ + { + "type": "aws:cdk:logicalId", + "data": "ImportedFromArnProfilingGroupName" + } + ], + "/ProfilingGroupTestStack/ImportedFromArnProfilingGroupArn": [ + { + "type": "aws:cdk:logicalId", + "data": "ImportedFromArnProfilingGroupArn" + } + ], "/ProfilingGroupTestStack/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -106,7 +112,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/1b75a24a1fbadc3d6a873d4f5887182847cd2459da973a4e19f416cccdf0b7bf.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2914aef3cda3df4a0f050f14b3a5803d1f46293b7ca9cfc4cf47365d4e2a7614.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -160,6 +166,12 @@ ] }, "displayName": "test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.assets.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.assets.json index 3774d68fead2a..630fcfa1d4236 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.assets.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.assets.json @@ -1,20 +1,20 @@ { - "version": "21.0.0", + "version": "22.0.0", "files": { - "b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b": { + "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4": { "source": { - "path": "asset.b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b.bundle", + "path": "asset.278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b.zip", + "objectKey": "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "1b75a24a1fbadc3d6a873d4f5887182847cd2459da973a4e19f416cccdf0b7bf": { + "2914aef3cda3df4a0f050f14b3a5803d1f46293b7ca9cfc4cf47365d4e2a7614": { "source": { "path": "testDefaultTestDeployAssert4D02624A.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1b75a24a1fbadc3d6a873d4f5887182847cd2459da973a4e19f416cccdf0b7bf.json", + "objectKey": "2914aef3cda3df4a0f050f14b3a5803d1f46293b7ca9cfc4cf47365d4e2a7614.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.template.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.template.json index 7cdb4ee653a71..bdfa32d288ad6 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.template.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/testDefaultTestDeployAssert4D02624A.template.json @@ -11,13 +11,16 @@ }, "service": "CloudFormation", "api": "describeStacks", - "expected": "{\"$StringLike\":\"ProfilingGroupTestStackProfilingGroupWithImplicitlySetName98463923\"}", - "actualPath": "Stacks.0.Outputs.1.OutputValue", + "expected": "{\"$StringLike\":\"arn:aws:codeguru-profiler:a-region-1:1234567890:profilingGroup/MyAwesomeProfilingGroup\"}", + "actualPath": "Stacks.0.Outputs.3.OutputValue", "parameters": { "StackName": "ProfilingGroupTestStack" }, "flattenResponse": "true", - "salt": "1666215338046" + "outputPaths": [ + "Stacks.0.Outputs.3.OutputValue" + ], + "salt": "1674095556814" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -71,7 +74,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b.zip" + "S3Key": "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.zip" }, "Timeout": 120, "Handler": "index.handler", diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/tree.json b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/tree.json index a013f53091526..48be63ef8fcac 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.129" - } - }, "ProfilingGroupTestStack": { "id": "ProfilingGroupTestStack", "path": "ProfilingGroupTestStack", @@ -68,6 +60,14 @@ "id": "PublishAppRole", "path": "ProfilingGroupTestStack/PublishAppRole", "children": { + "ImportPublishAppRole": { + "id": "ImportPublishAppRole", + "path": "ProfilingGroupTestStack/PublishAppRole/ImportPublishAppRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "ProfilingGroupTestStack/PublishAppRole/Resource", @@ -185,6 +185,14 @@ "version": "0.0.0" } }, + "ImportedProfilingGroupFromArn": { + "id": "ImportedProfilingGroupFromArn", + "path": "ProfilingGroupTestStack/ImportedProfilingGroupFromArn", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "ExplicitlySetProfilingGroupName": { "id": "ExplicitlySetProfilingGroupName", "path": "ProfilingGroupTestStack/ExplicitlySetProfilingGroupName", @@ -200,6 +208,38 @@ "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" } + }, + "ImportedFromArnProfilingGroupName": { + "id": "ImportedFromArnProfilingGroupName", + "path": "ProfilingGroupTestStack/ImportedFromArnProfilingGroupName", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "ImportedFromArnProfilingGroupArn": { + "id": "ImportedFromArnProfilingGroupArn", + "path": "ProfilingGroupTestStack/ImportedFromArnProfilingGroupArn", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "ProfilingGroupTestStack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "ProfilingGroupTestStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -220,7 +260,7 @@ "path": "test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.129" + "version": "10.1.189" } }, "DeployAssert": { @@ -240,7 +280,7 @@ "path": "test/DefaultTest/DeployAssert/AwsApiCallCloudFormationdescribeStacks/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.129" + "version": "10.1.189" } } }, @@ -312,7 +352,23 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.129" + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, @@ -332,6 +388,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.ts b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.ts index 913dafd80310f..d68cac5c5dfce 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.ts @@ -30,6 +30,12 @@ const importedGroupWithImplicitlySetName = ProfilingGroup.fromProfilingGroupName profilingGroup2.profilingGroupName, ); +const importedGroupFromArn = ProfilingGroup.fromProfilingGroupArn( + stack, + 'ImportedProfilingGroupFromArn', + 'arn:aws:codeguru-profiler:a-region-1:1234567890:profilingGroup/MyAwesomeProfilingGroup', +); + new CfnOutput(stack, 'ExplicitlySetProfilingGroupName', { value: importedGroupWithExplicitlySetName.profilingGroupName, }); @@ -38,6 +44,14 @@ new CfnOutput(stack, 'ImplicitlySetProfilingGroupName', { value: importedGroupWithImplicitlySetName.profilingGroupName, }); +new CfnOutput(stack, 'ImportedFromArnProfilingGroupName', { + value: importedGroupFromArn.profilingGroupName, +}); + +new CfnOutput(stack, 'ImportedFromArnProfilingGroupArn', { + value: importedGroupFromArn.profilingGroupArn, +}); + const testCase = new IntegTest(app, 'test', { testCases: [stack], }); @@ -52,4 +66,10 @@ describe.assertAtPath('Stacks.0.Outputs.0.OutputValue', ExpectedResult.stringLik describe.assertAtPath('Stacks.0.Outputs.1.OutputKey', ExpectedResult.stringLikeRegexp('ImplicitlySetProfilingGroupName')); describe.assertAtPath('Stacks.0.Outputs.1.OutputValue', ExpectedResult.stringLikeRegexp('ProfilingGroupTestStackProfilingGroupWithImplicitlySetName98463923')); -app.synth(); \ No newline at end of file +describe.assertAtPath('Stacks.0.Outputs.2.OutputKey', ExpectedResult.stringLikeRegexp('ImportedFromArnProfilingGroupName')); +describe.assertAtPath('Stacks.0.Outputs.2.OutputValue', ExpectedResult.stringLikeRegexp('MyAwesomeProfilingGroup')); + +describe.assertAtPath('Stacks.0.Outputs.3.OutputKey', ExpectedResult.stringLikeRegexp('ImportedFromArnProfilingGroupArn')); +describe.assertAtPath('Stacks.0.Outputs.3.OutputValue', ExpectedResult.stringLikeRegexp('arn:aws:codeguru-profiler:a-region-1:1234567890:profilingGroup/MyAwesomeProfilingGroup')); + +app.synth(); diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts index 12686fce4b6de..8b176566436e4 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts @@ -14,6 +14,10 @@ describe('profiling group', () => { }); const profilingGroup = ProfilingGroup.fromProfilingGroupArn(stack, 'MyProfilingGroup', 'arn:aws:codeguru-profiler:us-east-1:1234567890:profilingGroup/MyAwesomeProfilingGroup'); + expect(profilingGroup.profilingGroupName).toBe('MyAwesomeProfilingGroup'); + expect(profilingGroup.profilingGroupArn).toBe('arn:aws:codeguru-profiler:us-east-1:1234567890:profilingGroup/MyAwesomeProfilingGroup'); + expect(profilingGroup.env.region).toBe('us-east-1'); + profilingGroup.grantRead(readAppRole); Template.fromStack(stack).templateMatches({ diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index 8418ca3d6bc90..c54ddddef9383 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -99,7 +99,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "constructs": "^10.0.0", - "punycode": "^2.1.1" + "punycode": "^2.2.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { diff --git a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json index 2ccb1f268c707..0185283cc7e78 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json @@ -39,6 +39,6 @@ "eslint-plugin-standard": "^4.1.0", "jest": "^27.5.1", "lambda-tester": "^3.6.0", - "nock": "^13.2.9" + "nock": "^13.3.0" } } diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/load-balanced-fargate-service.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/load-balanced-fargate-service.test.ts index 57c2fc989e101..5cbb22774d95f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/load-balanced-fargate-service.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/load-balanced-fargate-service.test.ts @@ -1,6 +1,6 @@ import { Match, Template } from '@aws-cdk/assertions'; import { AutoScalingGroup } from '@aws-cdk/aws-autoscaling'; -import { DnsValidatedCertificate } from '@aws-cdk/aws-certificatemanager'; +import { Certificate, CertificateValidation } from '@aws-cdk/aws-certificatemanager'; import * as ec2 from '@aws-cdk/aws-ec2'; import { MachineImage } from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; @@ -1013,9 +1013,9 @@ test('domainName and domainZone not required for HTTPS listener with provided ce const exampleDotComZone = new route53.PublicHostedZone(stack, 'ExampleDotCom', { zoneName: 'example.com', }); - const certificate = new DnsValidatedCertificate(stack, 'Certificate', { + const certificate = new Certificate(stack, 'Certificate', { domainName: 'test.example.com', - hostedZone: exampleDotComZone, + validation: CertificateValidation.fromDns(exampleDotComZone), }); // WHEN diff --git a/packages/@aws-cdk/aws-ecs/README.md b/packages/@aws-cdk/aws-ecs/README.md index afbbd0dec4906..3da06acc88a3f 100644 --- a/packages/@aws-cdk/aws-ecs/README.md +++ b/packages/@aws-cdk/aws-ecs/README.md @@ -95,7 +95,7 @@ const cluster = new ecs.Cluster(this, 'Cluster', { }); ``` -The following code imports an existing cluster using the ARN which can be used to +The following code imports an existing cluster using the ARN which can be used to import an Amazon ECS service either EC2 or Fargate. ```ts @@ -518,8 +518,8 @@ taskDefinition.addContainer('container', { memoryLimitMiB: 1024, systemControls: [ { - namespace: 'net', - value: 'ipv4.tcp_tw_recycle', + namespace: 'net.ipv6.conf.all.default.disable_ipv6', + value: '1', }, ], }); @@ -547,7 +547,7 @@ taskDefinition.addContainer('windowsservercore', { }); ``` -### Using Graviton2 with Fargate +### Using Graviton2 with Fargate AWS Graviton2 supports AWS Fargate. For more details, please see this [blog post](https://aws.amazon.com/blogs/aws/announcing-aws-graviton2-support-for-aws-fargate-get-up-to-40-better-price-performance-for-your-serverless-containers/) @@ -729,7 +729,7 @@ There are two higher-level constructs available which include a load balancer fo `Ec2Service` and `FargateService` provide methods to import existing EC2/Fargate services. The ARN of the existing service has to be specified to import the service. -Since AWS has changed the [ARN format for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids), +Since AWS has changed the [ARN format for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids), feature flag `@aws-cdk/aws-ecs:arnFormatIncludesClusterName` must be enabled to use the new ARN format. The feature flag changes behavior for the entire CDK project. Therefore it is not possible to mix the old and the new format in one CDK project. @@ -1094,11 +1094,25 @@ it in the constructor. Then add the Capacity Provider to the cluster. Finally, you can refer to the Provider by its name in your service's or task's Capacity Provider strategy. -By default, an Auto Scaling Group Capacity Provider will manage the Auto Scaling -Group's size for you. It will also enable managed termination protection, in -order to prevent EC2 Auto Scaling from terminating EC2 instances that have tasks -running on them. If you want to disable this behavior, set both -`enableManagedScaling` to and `enableManagedTerminationProtection` to `false`. +By default, Auto Scaling Group Capacity Providers will manage the scale-in and +scale-out behavior of the auto scaling group based on the load your tasks put on +the cluster, this is called [Managed Scaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html#asg-capacity-providers-managed-scaling). If you'd +rather manage scaling behavior yourself set `enableManagedScaling` to `false`. + +Additionally [Managed Termination Protection](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-auto-scaling.html#managed-termination-protection) is enabled by default to +prevent scale-in behavior from terminating instances that have non-daemon tasks +running on them. This is ideal for tasks that should be ran to completion. If your +tasks are safe to interrupt then this protection can be disabled by setting +`enableManagedTerminationProtection` to `false`. Managed Scaling must be enabled for +Managed Termination Protection to work. + +> Currently there is a known [CloudFormation issue](https://github.com/aws/containers-roadmap/issues/631) +> that prevents CloudFormation from automatically deleting Auto Scaling Groups that +> have Managed Termination Protection enabled. To work around this issue you could set +> `enableManagedTerminationProtection` to `false` on the Auto Scaling Group Capacity +> Provider. If you'd rather not disable Managed Termination Protection, you can [manually +> delete the Auto Scaling Group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html). +> For other workarounds, see [this GitHub issue](https://github.com/aws/aws-cdk/issues/18179). ```ts declare const vpc: ec2.Vpc; @@ -1236,11 +1250,11 @@ const cluster = new ecs.Cluster(this, 'Cluster', { ## Amazon ECS Service Connect -Service Connect is a managed AWS mesh network offering. It simplifies DNS queries and inter-service communication for +Service Connect is a managed AWS mesh network offering. It simplifies DNS queries and inter-service communication for ECS Services by allowing customers to set up simple DNS aliases for their services, which are accessible to all services that have enabled Service Connect. -To enable Service Connect, you must have created a CloudMap namespace. The CDK can infer your cluster's default CloudMap namespace, +To enable Service Connect, you must have created a CloudMap namespace. The CDK can infer your cluster's default CloudMap namespace, or you can specify a custom namespace. You must also have created a named port mapping on at least one container in your Task Definition. ```ts @@ -1274,7 +1288,7 @@ const service = new ecs.FargateService(this, 'Service', { }); ``` -Service Connect-enabled services may now reach this service at `http-api:80`. Traffic to this endpoint will +Service Connect-enabled services may now reach this service at `http-api:80`. Traffic to this endpoint will be routed to the container's port 8080. To opt a service into using service connect without advertising a port, simply call the 'enableServiceConnect' method on an initialized service. diff --git a/packages/@aws-cdk/aws-ecs/lib/cluster.ts b/packages/@aws-cdk/aws-ecs/lib/cluster.ts index d595e788e08bb..59522d0cff7c3 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -259,7 +259,7 @@ export class Cluster extends Resource implements ICluster { } } - private renderExecuteCommandConfiguration() : CfnCluster.ClusterConfigurationProperty { + private renderExecuteCommandConfiguration(): CfnCluster.ClusterConfigurationProperty { return { executeCommandConfiguration: { kmsKeyId: this._executeCommandConfiguration?.kmsKey?.keyArn, @@ -377,7 +377,7 @@ export class Cluster extends Resource implements ICluster { * * @param provider the capacity provider to add to this cluster. */ - public addAsgCapacityProvider(provider: AsgCapacityProvider, options: AddAutoScalingGroupCapacityOptions= {}) { + public addAsgCapacityProvider(provider: AsgCapacityProvider, options: AddAutoScalingGroupCapacityOptions = {}) { // Don't add the same capacity provider more than once. if (this._capacityProviderNames.includes(provider.capacityProviderName)) { return; @@ -1072,14 +1072,25 @@ export interface AsgCapacityProviderProps extends AddAutoScalingGroupCapacityOpt readonly autoScalingGroup: autoscaling.IAutoScalingGroup; /** - * Whether to enable managed scaling + * When enabled the scale-in and scale-out actions of the cluster's Auto Scaling Group will be managed for you. + * This means your cluster will automatically scale instances based on the load your tasks put on the cluster. + * For more information, see [Using Managed Scaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html#asg-capacity-providers-managed-scaling) in the ECS Developer Guide. * * @default true */ readonly enableManagedScaling?: boolean; /** - * Whether to enable managed termination protection + * When enabled the Auto Scaling Group will only terminate EC2 instances that no longer have running non-daemon + * tasks. + * + * Scale-in protection will be automatically enabled on instances. When all non-daemon tasks are + * stopped on an instance, ECS initiates the scale-in process and turns off scale-in protection for the + * instance. The Auto Scaling Group can then terminate the instance. For more information see [Managed termination + * protection](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-auto-scaling.html#managed-termination-protection) + * in the ECS Developer Guide. + * + * Managed scaling must also be enabled. * * @default true */ @@ -1132,7 +1143,7 @@ export class AsgCapacityProvider extends Construct { readonly machineImageType: MachineImageType; /** - * Whether managed termination protection is enabled + * Whether managed termination protection is enabled. */ readonly enableManagedTerminationProtection?: boolean; @@ -1145,19 +1156,18 @@ export class AsgCapacityProvider extends Construct { constructor(scope: Construct, id: string, props: AsgCapacityProviderProps) { super(scope, id); - this.autoScalingGroup = props.autoScalingGroup as autoscaling.AutoScalingGroup; - this.machineImageType = props.machineImageType ?? MachineImageType.AMAZON_LINUX_2; - this.canContainersAccessInstanceRole = props.canContainersAccessInstanceRole; + this.enableManagedTerminationProtection = props.enableManagedTerminationProtection ?? true; - this.enableManagedTerminationProtection = - props.enableManagedTerminationProtection === undefined ? true : props.enableManagedTerminationProtection; - + if (this.enableManagedTerminationProtection && props.enableManagedScaling === false) { + throw new Error('Cannot enable Managed Termination Protection on a Capacity Provider when Managed Scaling is disabled. Either enable Managed Scaling or disable Managed Termination Protection.'); + } if (this.enableManagedTerminationProtection) { this.autoScalingGroup.protectNewInstancesFromScaleIn(); } + if (props.capacityProviderName) { if (!(/^(?!aws|ecs|fargate).+/gm.test(props.capacityProviderName))) { throw new Error(`Invalid Capacity Provider Name: ${props.capacityProviderName}, If a name is specified, it cannot start with aws, ecs, or fargate.`); @@ -1191,7 +1201,7 @@ class MaybeCreateCapacityProviderAssociations implements IAspect { private capacityProviders: string[] private resource?: CfnClusterCapacityProviderAssociations - constructor(scope: Construct, id: string, capacityProviders: string[] ) { + constructor(scope: Construct, id: string, capacityProviders: string[]) { this.scope = scope; this.id = id; this.capacityProviders = capacityProviders; diff --git a/packages/@aws-cdk/aws-ecs/test/cluster.test.ts b/packages/@aws-cdk/aws-ecs/test/cluster.test.ts index 66f8e0b9ec77f..28a92b4653b34 100644 --- a/packages/@aws-cdk/aws-ecs/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/cluster.test.ts @@ -2037,7 +2037,7 @@ describe('cluster', () => { }); - test('can disable managed scaling for ASG capacity provider', () => { + test('can disable Managed Scaling and Managed Termination Protection for ASG capacity provider', () => { // GIVEN const app = new cdk.App(); const stack = new cdk.Stack(app, 'test'); @@ -2052,6 +2052,7 @@ describe('cluster', () => { new ecs.AsgCapacityProvider(stack, 'provider', { autoScalingGroup, enableManagedScaling: false, + enableManagedTerminationProtection: false, }); // THEN @@ -2061,10 +2062,82 @@ describe('cluster', () => { Ref: 'asgASG4D014670', }, ManagedScaling: Match.absent(), - ManagedTerminationProtection: 'ENABLED', + ManagedTerminationProtection: 'DISABLED', + }, + }); + }); + + test('can disable Managed Termination Protection for ASG capacity provider', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'test'); + const vpc = new ec2.Vpc(stack, 'Vpc'); + const autoScalingGroup = new autoscaling.AutoScalingGroup(stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('bogus'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2(), + }); + + // WHEN + new ecs.AsgCapacityProvider(stack, 'provider', { + autoScalingGroup, + enableManagedTerminationProtection: false, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ECS::CapacityProvider', { + AutoScalingGroupProvider: { + AutoScalingGroupArn: { + Ref: 'asgASG4D014670', + }, + ManagedScaling: { + Status: 'ENABLED', + TargetCapacity: 100, + }, + ManagedTerminationProtection: 'DISABLED', }, }); + }); + + test('throws error, when ASG capacity provider has Managed Scaling disabled and Managed Termination Protection is undefined (defaults to true)', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'test'); + const vpc = new ec2.Vpc(stack, 'Vpc'); + const autoScalingGroup = new autoscaling.AutoScalingGroup(stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('bogus'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2(), + }); + // THEN + expect(() => { + new ecs.AsgCapacityProvider(stack, 'provider', { + autoScalingGroup, + enableManagedScaling: false, + }); + }).toThrowError('Cannot enable Managed Termination Protection on a Capacity Provider when Managed Scaling is disabled. Either enable Managed Scaling or disable Managed Termination Protection.'); + }); + + test('throws error, when Managed Scaling is disabled and Managed Termination Protection is enabled.', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'test'); + const vpc = new ec2.Vpc(stack, 'Vpc'); + const autoScalingGroup = new autoscaling.AutoScalingGroup(stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('bogus'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2(), + }); + + // THEN + expect(() => { + new ecs.AsgCapacityProvider(stack, 'provider', { + autoScalingGroup, + enableManagedScaling: false, + enableManagedTerminationProtection: true, + }); + }).toThrowError('Cannot enable Managed Termination Protection on a Capacity Provider when Managed Scaling is disabled. Either enable Managed Scaling or disable Managed Termination Protection.'); }); test('capacity provider enables ASG new instance scale-in protection by default', () => { @@ -2599,4 +2672,3 @@ describe('Accessing container instance role', function () { expect(autoScalingGroup.addUserData).not.toHaveBeenCalledWith('echo ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config'); }); }); - diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index c2060ee3c137d..b1184c3861151 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -93,8 +93,8 @@ "@types/sinon": "^9.0.11", "@types/yaml": "1.9.6", "aws-sdk": "^2.1211.0", - "cdk8s": "^2.6.8", - "cdk8s-plus-24": "2.3.13", + "cdk8s": "^2.6.15", + "cdk8s-plus-24": "2.3.20", "jest": "^27.5.1", "sinon": "^9.2.4" }, diff --git a/packages/@aws-cdk/aws-glue/lib/job.ts b/packages/@aws-cdk/aws-glue/lib/job.ts index 726d397ac90f3..eebb8b1acbdb0 100644 --- a/packages/@aws-cdk/aws-glue/lib/job.ts +++ b/packages/@aws-cdk/aws-glue/lib/job.ts @@ -692,7 +692,7 @@ export class Job extends JobBase { */ private checkNoReservedArgs(defaultArguments?: { [key: string]: string }) { if (defaultArguments) { - const reservedArgs = new Set(['--conf', '--debug', '--mode', '--JOB_NAME']); + const reservedArgs = new Set(['--debug', '--mode', '--JOB_NAME']); Object.keys(defaultArguments).forEach((arg) => { if (reservedArgs.has(arg)) { throw new Error(`The ${arg} argument is reserved by Glue. Don't set it`); diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.assets.json b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.assets.json index 29ae3d1255380..8e739ca15edca 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.assets.json +++ b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "29.0.0", "files": { "432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855": { "source": { @@ -14,7 +14,7 @@ } } }, - "0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4": { + "977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2": { "source": { "path": "aws-glue-job.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json", + "objectKey": "977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.template.json b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.template.json index f7838294de6e4..47f34d95c01f7 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.template.json +++ b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.template.json @@ -173,7 +173,8 @@ ] }, "arg1": "value1", - "arg2": "value2" + "arg2": "value2", + "--conf": "valueConf" }, "ExecutionProperty": { "MaxConcurrentRuns": 2 @@ -527,7 +528,8 @@ ] }, "arg1": "value1", - "arg2": "value2" + "arg2": "value2", + "--conf": "valueConf" }, "ExecutionProperty": { "MaxConcurrentRuns": 2 @@ -881,7 +883,8 @@ ] }, "arg1": "value1", - "arg2": "value2" + "arg2": "value2", + "--conf": "valueConf" }, "ExecutionProperty": { "MaxConcurrentRuns": 2 diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/cdk.out b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/cdk.out index 145739f539580..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"22.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/integ.json b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/integ.json index 28e4fd8c94ff9..fa2e902e93c44 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "29.0.0", "testCases": { "integ.job": { "stacks": [ diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/manifest.json b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/manifest.json index 9384baab89163..9a6172107f0bc 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "29.0.0", "artifacts": { "aws-glue-job.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -224,78 +224,6 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "EtlJobServiceRole837F781B": [ - { - "type": "aws:cdk:logicalId", - "data": "EtlJobServiceRole837F781B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "EtlJobServiceRoleDefaultPolicy8BFE343B": [ - { - "type": "aws:cdk:logicalId", - "data": "EtlJobServiceRoleDefaultPolicy8BFE343B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "EtlJobSparkUIBucketBF23744B": [ - { - "type": "aws:cdk:logicalId", - "data": "EtlJobSparkUIBucketBF23744B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "EtlJob7FC88E45": [ - { - "type": "aws:cdk:logicalId", - "data": "EtlJob7FC88E45", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "EtlJobSuccessMetricRuleA72A3EF6": [ - { - "type": "aws:cdk:logicalId", - "data": "EtlJobSuccessMetricRuleA72A3EF6", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "StreamingJobServiceRole1B4B8BF9": [ - { - "type": "aws:cdk:logicalId", - "data": "StreamingJobServiceRole1B4B8BF9", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "StreamingJobServiceRoleDefaultPolicyA0CC4C68": [ - { - "type": "aws:cdk:logicalId", - "data": "StreamingJobServiceRoleDefaultPolicyA0CC4C68", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "StreamingJob3783CC17": [ - { - "type": "aws:cdk:logicalId", - "data": "StreamingJob3783CC17", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "aws-glue-job" diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/tree.json b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/tree.json index c601e3512008c..712c057e96df5 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/tree.json @@ -203,13 +203,13 @@ "version": "0.0.0" } }, - "Code93a4952ea654434aca8481fb2bc2a836": { - "id": "Code93a4952ea654434aca8481fb2bc2a836", - "path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836", + "Codebeaf1c9f157c9b396ec6972f85317dbc": { + "id": "Codebeaf1c9f157c9b396ec6972f85317dbc", + "path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc", "children": { "Stage": { "id": "Stage", - "path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836/Stage", + "path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc/Stage", "constructInfo": { "fqn": "@aws-cdk/core.AssetStaging", "version": "0.0.0" @@ -217,7 +217,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836/AssetBucket", + "path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc/AssetBucket", "constructInfo": { "fqn": "@aws-cdk/aws-s3.BucketBase", "version": "0.0.0" @@ -275,7 +275,8 @@ ] }, "arg1": "value1", - "arg2": "value2" + "arg2": "value2", + "--conf": "valueConf" }, "executionProperty": { "maxConcurrentRuns": 2 @@ -788,7 +789,8 @@ ] }, "arg1": "value1", - "arg2": "value2" + "arg2": "value2", + "--conf": "valueConf" }, "executionProperty": { "maxConcurrentRuns": 2 @@ -1301,7 +1303,8 @@ ] }, "arg1": "value1", - "arg2": "value2" + "arg2": "value2", + "--conf": "valueConf" }, "executionProperty": { "maxConcurrentRuns": 2 @@ -1974,7 +1977,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.168" + "version": "10.1.209" } } }, diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.ts b/packages/@aws-cdk/aws-glue/test/integ.job.ts index 417ede1793054..791fd734fb0ca 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.ts +++ b/packages/@aws-cdk/aws-glue/test/integ.job.ts @@ -38,8 +38,9 @@ const script = glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world. timeout: cdk.Duration.minutes(5), notifyDelayAfter: cdk.Duration.minutes(1), defaultArguments: { - arg1: 'value1', - arg2: 'value2', + 'arg1': 'value1', + 'arg2': 'value2', + '--conf': 'valueConf', }, sparkUI: { enabled: true, diff --git a/packages/@aws-cdk/aws-glue/test/job.test.ts b/packages/@aws-cdk/aws-glue/test/job.test.ts index d30e5897443dd..f03d41d243494 100644 --- a/packages/@aws-cdk/aws-glue/test/job.test.ts +++ b/packages/@aws-cdk/aws-glue/test/job.test.ts @@ -566,7 +566,7 @@ describe('Job', () => { }); test('with reserved args should throw', () => { - ['--conf', '--debug', '--mode', '--JOB_NAME'].forEach((arg, index) => { + ['--debug', '--mode', '--JOB_NAME'].forEach((arg, index) => { const defaultArguments: {[key: string]: string} = {}; defaultArguments[arg] = 'random value'; diff --git a/packages/@aws-cdk/aws-kendraranking/.eslintrc.js b/packages/@aws-cdk/aws-kendraranking/.eslintrc.js new file mode 100644 index 0000000000000..2658ee8727166 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/.eslintrc.js @@ -0,0 +1,3 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); +baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-kendraranking/.gitignore b/packages/@aws-cdk/aws-kendraranking/.gitignore new file mode 100644 index 0000000000000..62ebc95d75ce6 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/.gitignore @@ -0,0 +1,19 @@ +*.js +*.js.map +*.d.ts +tsconfig.json +node_modules +*.generated.ts +dist +.jsii + +.LAST_BUILD +.nyc_output +coverage +.nycrc +.LAST_PACKAGE +*.snk +nyc.config.js +!.eslintrc.js +!jest.config.js +junit.xml diff --git a/packages/@aws-cdk/aws-kendraranking/.npmignore b/packages/@aws-cdk/aws-kendraranking/.npmignore new file mode 100644 index 0000000000000..f931fede67c44 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/.npmignore @@ -0,0 +1,29 @@ +# Don't include original .ts files when doing `npm pack` +*.ts +!*.d.ts +coverage +.nyc_output +*.tgz + +dist +.LAST_PACKAGE +.LAST_BUILD +!*.js + +# Include .jsii +!.jsii + +*.snk + +*.tsbuildinfo + +tsconfig.json + +.eslintrc.js +jest.config.js + +# exclude cdk artifacts +**/cdk.out +junit.xml +test/ +!*.lit.ts diff --git a/packages/@aws-cdk/aws-kendraranking/LICENSE b/packages/@aws-cdk/aws-kendraranking/LICENSE new file mode 100644 index 0000000000000..9b722c65c5481 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@aws-cdk/aws-kendraranking/NOTICE b/packages/@aws-cdk/aws-kendraranking/NOTICE new file mode 100644 index 0000000000000..a27b7dd317649 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/NOTICE @@ -0,0 +1,2 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/aws-kendraranking/README.md b/packages/@aws-cdk/aws-kendraranking/README.md new file mode 100644 index 0000000000000..5c0c150f6b76d --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/README.md @@ -0,0 +1,39 @@ +# AWS::KendraRanking Construct Library + + +--- + +![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) + +> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use. +> +> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib + +--- + + + +This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. + +```ts nofixture +import * as kendraranking from '@aws-cdk/aws-kendraranking'; +``` + + + +There are no official hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet. Here are some suggestions on how to proceed: + +- Search [Construct Hub for KendraRanking construct libraries](https://constructs.dev/search?q=kendraranking) +- Use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, in the same way you would use [the CloudFormation AWS::KendraRanking resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_KendraRanking.html) directly. + + + + +There are no hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet. +However, you can still use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, and use this service exactly as you would using CloudFormation directly. + +For more information on the resources and properties available for this service, see the [CloudFormation documentation for AWS::KendraRanking](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_KendraRanking.html). + +(Read the [CDK Contributing Guide](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and submit an RFC if you are interested in contributing to this construct library.) + + diff --git a/packages/@aws-cdk/aws-kendraranking/jest.config.js b/packages/@aws-cdk/aws-kendraranking/jest.config.js new file mode 100644 index 0000000000000..3a2fd93a1228a --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/jest.config.js @@ -0,0 +1,2 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/jest.config'); +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-kendraranking/lib/index.ts b/packages/@aws-cdk/aws-kendraranking/lib/index.ts new file mode 100644 index 0000000000000..81d21c1a645b4 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/lib/index.ts @@ -0,0 +1,2 @@ +// AWS::KendraRanking CloudFormation Resources: +export * from './kendraranking.generated'; diff --git a/packages/@aws-cdk/aws-kendraranking/package.json b/packages/@aws-cdk/aws-kendraranking/package.json new file mode 100644 index 0000000000000..5b18729a915bf --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/package.json @@ -0,0 +1,113 @@ +{ + "name": "@aws-cdk/aws-kendraranking", + "version": "0.0.0", + "description": "AWS::KendraRanking Construct Library", + "private": true, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "jsii": { + "outdir": "dist", + "projectReferences": true, + "targets": { + "dotnet": { + "namespace": "Amazon.CDK.AWS.KendraRanking", + "packageId": "Amazon.CDK.AWS.KendraRanking", + "signAssembly": true, + "assemblyOriginatorKeyFile": "../../key.snk", + "iconUrl": "https://github.com/raw/aws/aws-cdk/main/logo/default-256-dark.png" + }, + "java": { + "package": "software.amazon.awscdk.services.kendraranking", + "maven": { + "groupId": "software.amazon.awscdk", + "artifactId": "kendraranking" + } + }, + "python": { + "classifiers": [ + "Framework :: AWS CDK", + "Framework :: AWS CDK :: 2" + ], + "distName": "aws-cdk.aws-kendraranking", + "module": "aws_cdk.aws_kendraranking" + } + }, + "metadata": { + "jsii": { + "rosetta": { + "strict": true + } + } + } + }, + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-cdk.git", + "directory": "packages/@aws-cdk/aws-kendraranking" + }, + "homepage": "https://github.com/aws/aws-cdk", + "scripts": { + "build": "cdk-build", + "watch": "cdk-watch", + "lint": "cdk-lint", + "test": "cdk-test", + "integ": "cdk-integ", + "pkglint": "pkglint -f", + "package": "cdk-package", + "awslint": "cdk-awslint", + "cfn2ts": "cfn2ts", + "build+test": "yarn build && yarn test", + "build+test+package": "yarn build+test && yarn package", + "compat": "cdk-compat", + "gen": "cfn2ts", + "rosetta:extract": "yarn --silent jsii-rosetta extract", + "build+extract": "yarn build && yarn rosetta:extract", + "build+test+extract": "yarn build+test && yarn rosetta:extract" + }, + "cdk-build": { + "cloudformation": "AWS::KendraRanking", + "jest": true, + "env": { + "AWSLINT_BASE_CONSTRUCT": "true" + } + }, + "keywords": [ + "aws", + "cdk", + "constructs", + "AWS::KendraRanking", + "aws-kendraranking" + ], + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@aws-cdk/assertions": "0.0.0", + "@aws-cdk/cdk-build-tools": "0.0.0", + "@aws-cdk/cfn2ts": "0.0.0", + "@aws-cdk/pkglint": "0.0.0", + "@types/jest": "^27.5.2" + }, + "dependencies": { + "@aws-cdk/core": "0.0.0", + "constructs": "^10.0.0" + }, + "peerDependencies": { + "@aws-cdk/core": "0.0.0", + "constructs": "^10.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "stability": "experimental", + "maturity": "cfn-only", + "awscdkio": { + "announce": false + }, + "publishConfig": { + "tag": "latest" + } +} diff --git a/packages/@aws-cdk/aws-kendraranking/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-kendraranking/rosetta/default.ts-fixture new file mode 100644 index 0000000000000..e208762bca03c --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/rosetta/default.ts-fixture @@ -0,0 +1,8 @@ +import { Construct } from 'constructs'; +import { Stack } from '@aws-cdk/core'; + +class MyStack extends Stack { + constructor(scope: Construct, id: string) { + /// here + } +} diff --git a/packages/@aws-cdk/aws-kendraranking/test/kendraranking.test.ts b/packages/@aws-cdk/aws-kendraranking/test/kendraranking.test.ts new file mode 100644 index 0000000000000..465c7bdea0693 --- /dev/null +++ b/packages/@aws-cdk/aws-kendraranking/test/kendraranking.test.ts @@ -0,0 +1,6 @@ +import '@aws-cdk/assertions'; +import {} from '../lib'; + +test('No tests are specified for this package', () => { + expect(true).toBe(true); +}); diff --git a/packages/@aws-cdk/aws-kms/lib/key-lookup.ts b/packages/@aws-cdk/aws-kms/lib/key-lookup.ts index 260e28e96e4c7..0ac02b2185d49 100644 --- a/packages/@aws-cdk/aws-kms/lib/key-lookup.ts +++ b/packages/@aws-cdk/aws-kms/lib/key-lookup.ts @@ -4,6 +4,8 @@ export interface KeyLookupOptions { /** * The alias name of the Key + * + * Must be in the format `alias/`. */ readonly aliasName: string; } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/README.md b/packages/@aws-cdk/aws-lambda-event-sources/README.md index b7b820ada6984..ab8c4804cd6b7 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/README.md +++ b/packages/@aws-cdk/aws-lambda-event-sources/README.md @@ -57,6 +57,7 @@ behavior: duration. The default value is 20 seconds. * __batchSize__: Determines how many records are buffered before invoking your lambda function. * __maxBatchingWindow__: The maximum amount of time to gather records before invoking the lambda. This increases the likelihood of a full batch at the cost of delayed processing. +* __maxConcurrency__: The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke. * __enabled__: If the SQS event source mapping should be enabled. The default is true. ```ts diff --git a/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts b/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts index 105a7faf66766..bd81806d67d9b 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts @@ -46,6 +46,17 @@ export interface SqsEventSourceProps { * @default - None */ readonly filters?: Array<{[key: string]: any}>; + + /** + * The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke. + * + * @see https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency + * + * Valid Range: Minimum value of 2. Maximum value of 1000. + * + * @default - No specific limit. + */ + readonly maxConcurrency?: number; } /** @@ -77,6 +88,7 @@ export class SqsEventSource implements lambda.IEventSource { const eventSourceMapping = target.addEventSourceMapping(`SqsEventSource:${Names.nodeUniqueId(this.queue.node)}`, { batchSize: this.props.batchSize, maxBatchingWindow: this.props.maxBatchingWindow, + maxConcurrency: this.props.maxConcurrency, reportBatchItemFailures: this.props.reportBatchItemFailures, enabled: this.props.enabled, eventSourceArn: this.queue.queueArn, diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/integ.json new file mode 100644 index 0000000000000..51f69a4d99e20 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/integ.json @@ -0,0 +1,14 @@ +{ + "version": "29.0.0", + "testCases": { + "integ.sqs-max-concurrency": { + "stacks": [ + "sqs-event-source-max-concurrency" + ], + "diffAssets": false, + "stackUpdateWorkflow": true + } + }, + "synthContext": {}, + "enableLookups": false +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/manifest.json new file mode 100644 index 0000000000000..b0e693a0e76cd --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/manifest.json @@ -0,0 +1,88 @@ +{ + "version": "29.0.0", + "artifacts": { + "sqs-event-source-max-concurrency.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqs-event-source-max-concurrency.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqs-event-source-max-concurrency": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqs-event-source-max-concurrency.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/22b851e42ed8369bcaa049b397df6ff215217b6578ec72217a555682af809f17.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqs-event-source-max-concurrency.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "sqs-event-source-max-concurrency.assets" + ], + "metadata": { + "/sqs-event-source-max-concurrency/F/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FServiceRole3AC82EE1" + } + ], + "/sqs-event-source-max-concurrency/F/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FServiceRoleDefaultPolicy17A19BFA" + } + ], + "/sqs-event-source-max-concurrency/F/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FC4345940" + } + ], + "/sqs-event-source-max-concurrency/F/SqsEventSource:sqseventsourcemaxconcurrencyQ1268C091/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FSqsEventSourcesqseventsourcemaxconcurrencyQ1268C091130BF341" + } + ], + "/sqs-event-source-max-concurrency/Q/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Q63C6E3AB" + } + ], + "/sqs-event-source-max-concurrency/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqs-event-source-max-concurrency/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqs-event-source-max-concurrency" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/sqs-event-source-max-concurrency.assets.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/sqs-event-source-max-concurrency.assets.json new file mode 100644 index 0000000000000..62f7ea7b4236e --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/sqs-event-source-max-concurrency.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "22b851e42ed8369bcaa049b397df6ff215217b6578ec72217a555682af809f17": { + "source": { + "path": "sqs-event-source-max-concurrency.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "22b851e42ed8369bcaa049b397df6ff215217b6578ec72217a555682af809f17.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/sqs-event-source-max-concurrency.template.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/sqs-event-source-max-concurrency.template.json new file mode 100644 index 0000000000000..8f16c40e463b7 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/sqs-event-source-max-concurrency.template.json @@ -0,0 +1,144 @@ +{ + "Resources": { + "FServiceRole3AC82EE1": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "FServiceRoleDefaultPolicy17A19BFA": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:ChangeMessageVisibility", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Q63C6E3AB", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FServiceRoleDefaultPolicy17A19BFA", + "Roles": [ + { + "Ref": "FServiceRole3AC82EE1" + } + ] + } + }, + "FC4345940": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async function handler(event) {\n console.log('event:', JSON.stringify(event, undefined, 2));\n return { event };\n}" + }, + "Role": { + "Fn::GetAtt": [ + "FServiceRole3AC82EE1", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs14.x" + }, + "DependsOn": [ + "FServiceRoleDefaultPolicy17A19BFA", + "FServiceRole3AC82EE1" + ] + }, + "FSqsEventSourcesqseventsourcemaxconcurrencyQ1268C091130BF341": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "FunctionName": { + "Ref": "FC4345940" + }, + "BatchSize": 5, + "EventSourceArn": { + "Fn::GetAtt": [ + "Q63C6E3AB", + "Arn" + ] + }, + "ScalingConfig": { + "MaximumConcurrency": 5 + } + } + }, + "Q63C6E3AB": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/tree.json new file mode 100644 index 0000000000000..10ccd815e2643 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.js.snapshot/tree.json @@ -0,0 +1,246 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqs-event-source-max-concurrency": { + "id": "sqs-event-source-max-concurrency", + "path": "sqs-event-source-max-concurrency", + "children": { + "F": { + "id": "F", + "path": "sqs-event-source-max-concurrency/F", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqs-event-source-max-concurrency/F/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqs-event-source-max-concurrency/F/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqs-event-source-max-concurrency/F/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqs-event-source-max-concurrency/F/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqs-event-source-max-concurrency/F/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:ChangeMessageVisibility", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Q63C6E3AB", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "FServiceRoleDefaultPolicy17A19BFA", + "roles": [ + { + "Ref": "FServiceRole3AC82EE1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqs-event-source-max-concurrency/F/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async function handler(event) {\n console.log('event:', JSON.stringify(event, undefined, 2));\n return { event };\n}" + }, + "role": { + "Fn::GetAtt": [ + "FServiceRole3AC82EE1", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs14.x" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + }, + "SqsEventSource:sqseventsourcemaxconcurrencyQ1268C091": { + "id": "SqsEventSource:sqseventsourcemaxconcurrencyQ1268C091", + "path": "sqs-event-source-max-concurrency/F/SqsEventSource:sqseventsourcemaxconcurrencyQ1268C091", + "children": { + "Resource": { + "id": "Resource", + "path": "sqs-event-source-max-concurrency/F/SqsEventSource:sqseventsourcemaxconcurrencyQ1268C091/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::EventSourceMapping", + "aws:cdk:cloudformation:props": { + "functionName": { + "Ref": "FC4345940" + }, + "batchSize": 5, + "eventSourceArn": { + "Fn::GetAtt": [ + "Q63C6E3AB", + "Arn" + ] + }, + "scalingConfig": { + "maximumConcurrency": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnEventSourceMapping", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.EventSourceMapping", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + }, + "Q": { + "id": "Q", + "path": "sqs-event-source-max-concurrency/Q", + "children": { + "Resource": { + "id": "Resource", + "path": "sqs-event-source-max-concurrency/Q/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqs-event-source-max-concurrency/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqs-event-source-max-concurrency/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.209" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.ts new file mode 100644 index 0000000000000..2c7704cefbb1c --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs-max-concurrency.ts @@ -0,0 +1,28 @@ +import * as sqs from '@aws-cdk/aws-sqs'; +import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; +import { SqsEventSource } from '../lib'; +import { TestFunction } from './test-function'; + +class SqsEventSourceTest extends cdk.Stack { + constructor(scope: cdk.App, id: string) { + super(scope, id); + + const fn = new TestFunction(this, 'F'); + const queue = new sqs.Queue(this, 'Q'); + + fn.addEventSource(new SqsEventSource(queue, { + batchSize: 5, + maxConcurrency: 5, + })); + } +} + +const app = new cdk.App(); +const stack = new SqsEventSourceTest(app, 'sqs-event-source-max-concurrency'); + +new IntegTest(app, 'sqs-max-concurrency-integ-test', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/sqs.test.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/sqs.test.ts index 24d9dd307e14a..0d22b9db4a12a 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/sqs.test.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/sqs.test.ts @@ -423,4 +423,46 @@ describe('SQSEventSource', () => { }, }); }); + + test('fails if maxConcurrency < 2', () => { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const q = new sqs.Queue(stack, 'Q'); + + // WHEN/THEN + expect(() => fn.addEventSource(new sources.SqsEventSource(q, { + maxConcurrency: 1, + }))).toThrow(/maxConcurrency must be between 2 and 1000 concurrent instances/); + }); + + test('adding maxConcurrency of 5', () => { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const q = new sqs.Queue(stack, 'Q'); + + // WHEN + fn.addEventSource(new sources.SqsEventSource(q, { + maxConcurrency: 5, + })); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::EventSourceMapping', { + ScalingConfig: { MaximumConcurrency: 5 }, + }); + + }); + + test('fails if maxConcurrency > 1001', () => { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const q = new sqs.Queue(stack, 'Q'); + + // WHEN/THEN + expect(() => fn.addEventSource(new sources.SqsEventSource(q, { + maxConcurrency: 1, + }))).toThrow(/maxConcurrency must be between 2 and 1000 concurrent instances/); + }); }); diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts index fd0c17a3be465..4c4d17d9a6dda 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts @@ -410,5 +410,5 @@ function isSdkV2Runtime(runtime: Runtime): boolean { Runtime.NODEJS_14_X, Runtime.NODEJS_16_X, ]; - return sdkV2RuntimeList.includes(runtime); + return sdkV2RuntimeList.some((r) => {return r.family === runtime.family && r.name === runtime.name;}); } diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 411abd350151e..1a111c7e4e155 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -81,7 +81,7 @@ "@aws-cdk/triggers": "0.0.0", "@types/jest": "^27.5.2", "delay": "5.0.0", - "esbuild": "^0.16.13" + "esbuild": "^0.16.16" }, "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts index 9679530a01189..e5248724a0aaa 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts @@ -1,7 +1,7 @@ import * as child_process from 'child_process'; import * as os from 'os'; import * as path from 'path'; -import { Architecture, Code, Runtime } from '@aws-cdk/aws-lambda'; +import { Architecture, Code, Runtime, RuntimeFamily } from '@aws-cdk/aws-lambda'; import { AssetHashType, DockerImage } from '@aws-cdk/core'; import { version as delayVersion } from 'delay/package.json'; import { Bundling } from '../lib/bundling'; @@ -329,6 +329,30 @@ test('esbuild bundling source map inline', () => { }); }); +test('esbuild bundling is correctly done with custom runtime matching predefined runtime', () => { + Bundling.bundle({ + entry, + projectRoot, + depsLockFilePath, + runtime: new Runtime('nodejs14.x', RuntimeFamily.NODEJS, { supportsInlineCode: true }), + architecture: Architecture.X86_64, + sourceMapMode: SourceMapMode.INLINE, + }); + + expect(Code.fromAsset).toHaveBeenCalledWith(path.dirname(depsLockFilePath), { + assetHashType: AssetHashType.OUTPUT, + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + [ + 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node14 --platform=node --outfile="/asset-output/index.js"', + '--sourcemap=inline --external:aws-sdk', + ].join(' '), + ], + }), + }); +}); + test('esbuild bundling source map enabled when only source map mode exists', () => { Bundling.bundle({ entry, diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/deactivated-integ-tests/dependencies-pnpm.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/deactivated-integ-tests/dependencies-pnpm.ts new file mode 100644 index 0000000000000..1101d02d8eaec --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/deactivated-integ-tests/dependencies-pnpm.ts @@ -0,0 +1,36 @@ +/*import * as path from 'path'; +import { Runtime } from '@aws-cdk/aws-lambda'; +import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import * as triggers from '@aws-cdk/triggers'; +import * as lambda from '../lib'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'TestStack'); + +const handler = new lambda.NodejsFunction(stack, 'Function', { + entry: path.join(__dirname, 'integ-handlers/pnpm/dependencies-pnpm.ts'), + runtime: Runtime.NODEJS_18_X, + bundling: { + minify: true, + // Will be installed, not bundled + // (axios is a package with sub-dependencies, + // will be used to ensure pnpm bundling works as expected) + nodeModules: ['axios'], + forceDockerBundling: true, + }, + depsLockFilePath: path.join(__dirname, 'integ-handlers/pnpm/pnpm-lock.yaml'), +}); + +new triggers.Trigger(stack, 'Trigger', { + handler, +}); + +new integ.IntegTest(app, 'PnpmTest', { + testCases: [stack], + stackUpdateWorkflow: false, // this will tell the runner to not check in assets. +}); + +app.synth(); +*/ diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.assets.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.assets.json index f2f1759f8e85a..b13993c57f6cc 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.assets.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.assets.json @@ -1,7 +1,20 @@ { - "version": "22.0.0", + "version": "29.0.0", "files": { - "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28": { + "source": { + "path": "asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2bd77eb3d8c517d922b9b5e7829e28b113dacc2d80176588fcc5608794a14ffb": { "source": { "path": "PnpmTestDefaultTestDeployAssert397EDF83.template.json", "packaging": "file" @@ -9,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "objectKey": "2bd77eb3d8c517d922b9b5e7829e28b113dacc2d80176588fcc5608794a14ffb.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.template.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.template.json index ad9d0fb73d1dd..eeebac5f452ed 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.template.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/PnpmTestDefaultTestDeployAssert397EDF83.template.json @@ -1,4 +1,146 @@ { + "Resources": { + "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"StatusCode\":200,\"ExecutedVersion\":\"$LATEST\",\"Payload\":\"null\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "TestStack:ExportsOutputRefFunction76856677C48862D5" + } + }, + "flattenResponse": "false", + "salt": "1674225978419" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8InvokeA3F6E40A": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "TestStack:ExportsOutputRefFunction76856677C48862D5" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "TestStack:ExportsOutputRefFunction76856677C48862D5" + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Runtime": "nodejs14.x", + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.zip" + }, + "Timeout": 120, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + } + }, + "Outputs": { + "AssertionResultsLambdaInvoke55933c6da447c7ea94ebd3a50e8557a8": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", + "assertion" + ] + } + } + }, "Parameters": { "BootstrapVersion": { "Type": "AWS::SSM::Parameter::Value", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.assets.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.assets.json index 9088ca807157d..739b715f36431 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.assets.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.assets.json @@ -1,33 +1,20 @@ { - "version": "22.0.0", + "version": "29.0.0", "files": { - "1241e2f1a4b20354671916c8ba1e7fac9b355073ebb58c883e17ce7a631ee117": { + "b90974d5f9d943ad75f529ba0b8529aa1c43cbe4d63d4e0f89894d5fdcab56f9": { "source": { - "path": "asset.1241e2f1a4b20354671916c8ba1e7fac9b355073ebb58c883e17ce7a631ee117", + "path": "asset.b90974d5f9d943ad75f529ba0b8529aa1c43cbe4d63d4e0f89894d5fdcab56f9", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1241e2f1a4b20354671916c8ba1e7fac9b355073ebb58c883e17ce7a631ee117.zip", + "objectKey": "b90974d5f9d943ad75f529ba0b8529aa1c43cbe4d63d4e0f89894d5fdcab56f9.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "6107d66f2de5a27f48e6ffe49f091aaaad580052be56a84d02d66042308fb6fb": { - "source": { - "path": "asset.6107d66f2de5a27f48e6ffe49f091aaaad580052be56a84d02d66042308fb6fb", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6107d66f2de5a27f48e6ffe49f091aaaad580052be56a84d02d66042308fb6fb.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "eb34f45420edfc9a07d2cfbae0119e07531aadd679163c0ab5ef9976a31042cc": { + "b6922a50679c4b55d94ce943a6cc9a0e1d67006def01191f71eb7e05bfe18327": { "source": { "path": "TestStack.template.json", "packaging": "file" @@ -35,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "eb34f45420edfc9a07d2cfbae0119e07531aadd679163c0ab5ef9976a31042cc.json", + "objectKey": "b6922a50679c4b55d94ce943a6cc9a0e1d67006def01191f71eb7e05bfe18327.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.template.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.template.json index 9d5b091578e87..89525fd32aa2b 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.template.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/TestStack.template.json @@ -38,7 +38,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "1241e2f1a4b20354671916c8ba1e7fac9b355073ebb58c883e17ce7a631ee117.zip" + "S3Key": "b90974d5f9d943ad75f529ba0b8529aa1c43cbe4d63d4e0f89894d5fdcab56f9.zip" }, "Role": { "Fn::GetAtt": [ @@ -57,110 +57,16 @@ "DependsOn": [ "FunctionServiceRole675BB04A" ] - }, - "FunctionCurrentVersion4E2B22618dd26ccb3af7b577163fa65856572807": { - "Type": "AWS::Lambda::Version", - "Properties": { - "FunctionName": { - "Ref": "Function76856677" - } - } - }, - "Trigger": { - "Type": "Custom::Trigger", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWSCDKTriggerCustomResourceProviderCustomResourceProviderHandler97BECD91", - "Arn" - ] - }, - "HandlerArn": { - "Ref": "FunctionCurrentVersion4E2B22618dd26ccb3af7b577163fa65856572807" - }, - "InvocationType": "RequestResponse", - "Timeout": 120000 + } + }, + "Outputs": { + "ExportsOutputRefFunction76856677C48862D5": { + "Value": { + "Ref": "Function76856677" }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AWSCDKTriggerCustomResourceProviderCustomResourceProviderRoleE18FAF0A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ] - }, - "ManagedPolicyArns": [ - { - "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - } - ], - "Policies": [ - { - "PolicyName": "Inline", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": [ - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "Function76856677", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ] - } - } - ] + "Export": { + "Name": "TestStack:ExportsOutputRefFunction76856677C48862D5" } - }, - "AWSCDKTriggerCustomResourceProviderCustomResourceProviderHandler97BECD91": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "6107d66f2de5a27f48e6ffe49f091aaaad580052be56a84d02d66042308fb6fb.zip" - }, - "Timeout": 900, - "MemorySize": 128, - "Handler": "__entrypoint__.handler", - "Role": { - "Fn::GetAtt": [ - "AWSCDKTriggerCustomResourceProviderCustomResourceProviderRoleE18FAF0A", - "Arn" - ] - }, - "Runtime": "nodejs14.x" - }, - "DependsOn": [ - "AWSCDKTriggerCustomResourceProviderCustomResourceProviderRoleE18FAF0A" - ] } }, "Parameters": { @@ -197,4 +103,4 @@ ] } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js new file mode 100644 index 0000000000000..4264087b9aab2 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle/index.js @@ -0,0 +1,1204 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + /** + * Check whether the provided object is a subtype of the `IMatcher`. + */ + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failuresHere = /* @__PURE__ */ new Map(); + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; + this.target = target; + } + /** + * DEPRECATED + * @deprecated use recordFailure() + */ + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + /** + * Record a new failure into this result at a specific path. + */ + recordFailure(failure) { + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; + return this; + } + /** Whether the match is a success */ + get isSuccess() { + return !this._hasFailed; + } + /** Does the result contain any failures. If not, the result is a success */ + hasFailed() { + return this._hasFailed; + } + /** The number of failures */ + get failCount() { + return this._failCount; + } + /** The cost of the failures so far */ + get failCost() { + return this._cost; + } + /** + * Compose the results of a previous match as a subtree. + * @param id the id of the parent tree. + */ + compose(id, inner) { + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + /** + * Prepare the result to be analyzed. + * This API *must* be called prior to analyzing these results. + */ + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + /** + * Render the failed match in a presentable way + * + * Prefer using `renderMismatch` over this method. It is left for backwards + * compatibility for test suites that expect it, but `renderMismatch()` will + * produce better output. + */ + toHumanStrings() { + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } + } + /** + * Do a deep render of the match result, showing the structure mismatches in context + */ + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + /** + * Record a capture against in this match result. + */ + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + /** + * Use this matcher in the place of a field's value, if the field must not be present. + */ + static absent() { + return new AbsentMatch("absent"); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must be in the same order as would be found. + * @param pattern the pattern to match + */ + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must match exactly and in order. + * @param pattern the pattern to match + */ + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + /** + * Deep exact matching of the specified pattern to the target. + * @param pattern the pattern to match + */ + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must be present in the target but the target can be a superset. + * @param pattern the pattern to match + */ + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must match exactly with the target. + * @param pattern the pattern to match + */ + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + /** + * Matches any target which does NOT follow the specified pattern. + * @param pattern the pattern to NOT match + */ + static not(pattern) { + return new NotMatch("not", pattern); + } + /** + * Matches any string-encoded JSON and applies the specified pattern after parsing it. + * @param pattern the pattern to match after parsing the encoded JSON. + */ + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + /** + * Matches any non-null value at the target. + */ + static anyValue() { + return new AnyMatch("anyValue"); + } + /** + * Matches targets according to a regular expression + */ + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ + matcher: this, + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); + let patternIdx = 0; + let actualIdx = 0; + const matches = new SparseMatrix(); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (matcherName == "absent" || matcherName == "anyValue") { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); + patternIdx++; + } + } + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + // This is an informational message so it would be unfair to assign it cost + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + // Informational message + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [a], + message: `Unexpected key ${a}` + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [patternKey], + message: `Missing key '${patternKey}'` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(patternKey, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + if (getType(actual) !== "string") { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + /** + * Handles executing the custom resource event. If `stateMachineArn` is present + * in the props then trigger the waiter statemachine + */ + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Handle async requests from the waiter state machine + */ + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Start a step function state machine which will wait for the request + * to be successful. + */ + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: matchResult.renderMismatch() + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + /** + * Return a Matcher that can be tested against the actual results. + * This will convert the encoded matchers into their corresponding + * assertions matcher. + * + * For example: + * + * ExpectedResult.objectLike({ + * Messages: [{ + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * }], + * }); + * + * Will be encoded as: + * { + * $ObjectLike: { + * Messages: [{ + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * }], + * }, + * } + * + * Which can then be parsed by this function. For each key (recursively) + * the parser will check if the value has one of the encoded matchers as a key + * and if so, it will set the value as the Matcher. So, + * + * { + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * } + * + * Will be converted to + * { + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * } + */ + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + // return both the result of the API call _and_ the assertion results + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/00/9530fc7b936783b8c08f83efc065b4b49b6eba10ec493a5725527d98b889a19ef0e98ae732d3812967d9bd31b3d1f062577b260945d9363c34c5c0ffa4a61d b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/00/9530fc7b936783b8c08f83efc065b4b49b6eba10ec493a5725527d98b889a19ef0e98ae732d3812967d9bd31b3d1f062577b260945d9363c34c5c0ffa4a61d deleted file mode 100644 index 7f1288a4ce9ae..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/00/9530fc7b936783b8c08f83efc065b4b49b6eba10ec493a5725527d98b889a19ef0e98ae732d3812967d9bd31b3d1f062577b260945d9363c34c5c0ffa4a61d +++ /dev/null @@ -1,34 +0,0 @@ -var defer = require('./defer.js'); - -// API -module.exports = async; - -/** - * Runs provided callback asynchronously - * even if callback itself is not - * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback - */ -function async(callback) -{ - var isAsync = false; - - // check if async happened - defer(function() { isAsync = true; }); - - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/00/c497bf0e46ba69f12b50bb5d7cfa98e64a5d3d0a559919f5ecdc0d4fb1060e75e9bd469f9c2ec29d9c479d9764af82ff04a779baa849feb75a0fb2b6cd81ea b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/00/c497bf0e46ba69f12b50bb5d7cfa98e64a5d3d0a559919f5ecdc0d4fb1060e75e9bd469f9c2ec29d9c479d9764af82ff04a779baa849feb75a0fb2b6cd81ea deleted file mode 100644 index 9e367b5bc5b59..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/00/c497bf0e46ba69f12b50bb5d7cfa98e64a5d3d0a559919f5ecdc0d4fb1060e75e9bd469f9c2ec29d9c479d9764af82ff04a779baa849feb75a0fb2b6cd81ea +++ /dev/null @@ -1,138 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`. - -- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. - -- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = `true` - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = `2 * 1024 * 1024` - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = `0` - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/03/de3103f16015a0384fe5f38ae72fccbc2e5569b1dab4929c1730b220ba423cc3288cbcfbc2d5883b74b757eef67861f90cb64e27a91a2bf650fa72c42b70ef b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/03/de3103f16015a0384fe5f38ae72fccbc2e5569b1dab4929c1730b220ba423cc3288cbcfbc2d5883b74b757eef67861f90cb64e27a91a2bf650fa72c42b70ef deleted file mode 100644 index 3de89c47291b4..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/03/de3103f16015a0384fe5f38ae72fccbc2e5569b1dab4929c1730b220ba423cc3288cbcfbc2d5883b74b757eef67861f90cb64e27a91a2bf650fa72c42b70ef +++ /dev/null @@ -1,29 +0,0 @@ -var serialOrdered = require('../serialOrdered.js'); - -// API -module.exports = ReadableSerialOrdered; -// expose sort helpers -module.exports.ascending = serialOrdered.ascending; -module.exports.descending = serialOrdered.descending; - -/** - * Streaming wrapper to `asynckit.serialOrdered` - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {stream.Readable#} - */ -function ReadableSerialOrdered(list, iterator, sortMethod, callback) -{ - if (!(this instanceof ReadableSerialOrdered)) - { - return new ReadableSerialOrdered(list, iterator, sortMethod, callback); - } - - // turn on object mode - ReadableSerialOrdered.super_.call(this, {objectMode: true}); - - this._start(serialOrdered, list, iterator, sortMethod, callback); -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/06/e01e517407d506ed158806079549def19e1cbcf265b4f59797a021ce3be1e84ef647a9a3bda2745149b06d135a704ff3642158953ad207b33ec869601e6df4 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/06/e01e517407d506ed158806079549def19e1cbcf265b4f59797a021ce3be1e84ef647a9a3bda2745149b06d135a704ff3642158953ad207b33ec869601e6df4 deleted file mode 100644 index 62f7a0e89652b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/06/e01e517407d506ed158806079549def19e1cbcf265b4f59797a021ce3be1e84ef647a9a3bda2745149b06d135a704ff3642158953ad207b33ec869601e6df4 +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - "version": "0.27.2" -}; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/07/714ae0c97294ab228f081b55df029f661f7eb1de143cf01cb23c62aa4b39d1b7feeef328ac9450bde02a707e6e4310a78e59aadfcfc112564285c5c29e46f4 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/07/714ae0c97294ab228f081b55df029f661f7eb1de143cf01cb23c62aa4b39d1b7feeef328ac9450bde02a707e6e4310a78e59aadfcfc112564285c5c29e46f4 deleted file mode 100644 index 3e199c14a8e61..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/07/714ae0c97294ab228f081b55df029f661f7eb1de143cf01cb23c62aa4b39d1b7feeef328ac9450bde02a707e6e4310a78e59aadfcfc112564285c5c29e46f4 +++ /dev/null @@ -1,621 +0,0 @@ -var url = require("url"); -var URL = url.URL; -var http = require("http"); -var https = require("https"); -var Writable = require("stream").Writable; -var assert = require("assert"); -var debug = require("./debug"); - -// Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; -var eventHandlers = Object.create(null); -events.forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); - -var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError -); -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); - -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } - - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; - - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); - -RedirectableRequest.prototype.abort = function () { - abortRequest(this._currentRequest); - this.emit("abort"); -}; - -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } - - // Validate input and shift parameters if necessary - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; - -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (isFunction(data)) { - callback = data; - data = encoding = null; - } - else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; - -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; - -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; - -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; - - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); - } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; - } - - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } - } - - // Attach callback if passed - if (callback) { - this.on("timeout", callback); - } - - // Start the timer if or when the socket is opened - if (this.socket) { - startTimer(this.socket); - } - else { - this._currentRequest.once("socket", startTimer); - } - - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - - return this; -}; - -// Proxy all other public ClientRequest methods -[ - "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); - -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); - -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } - - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } -}; - - -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - - // Create the native request and set up its event handlers - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - - // RFC7230Β§5.3.1: When making a request directly to an origin server, […] - // a client MUST send only the absolute path […] as the request-target. - this._currentUrl = /^\//.test(this._options.path) ? - url.format(this._options) : - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._options.path; - - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); - } -}; - -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } - - // RFC7231Β§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. - - // If the response is not a redirect; return it as-is - var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - - // Clean up - this._requestBodyBuffers = []; - return; - } - - // The response is a redirect, so abort the current request - abortRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); - - // RFC7231Β§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); - } - - // RFC7231Β§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231Β§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231Β§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); - - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - return; - } - - // Create the redirected request - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } - - // Evaluate the beforeRedirect callback - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } - catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - } -}; - -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; - - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (isString(input)) { - var parsed; - try { - parsed = urlToOptions(new URL(input)); - } - catch (err) { - /* istanbul ignore next */ - parsed = url.parse(input); - } - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - input = parsed; - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } - - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } - - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} - -/* istanbul ignore next */ -function noop() { /* empty */ } - -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; -} - -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); -} - -function createErrorType(code, message, baseClass) { - // Create constructor - function CustomError(properties) { - Error.captureStackTrace(this, this.constructor); - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - - // Attach constructor and set default properties - CustomError.prototype = new (baseClass || Error)(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - return CustomError; -} - -function abortRequest(request) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.abort(); -} - -function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} - -function isString(value) { - return typeof value === "string" || value instanceof String; -} - -function isFunction(value) { - return typeof value === "function"; -} - -function isBuffer(value) { - return typeof value === "object" && ("length" in value); -} - -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/07/874fe4f480997452565478a243494911ce13c43f77dc3416d8aa672f9251b217da797a81e1d9f352b84b10964c5fdebbb078d9fa3f80c5444b39b6fd0841b8 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/07/874fe4f480997452565478a243494911ce13c43f77dc3416d8aa672f9251b217da797a81e1d9f352b84b10964c5fdebbb078d9fa3f80c5444b39b6fd0841b8 deleted file mode 100644 index 859baceb50c42..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/07/874fe4f480997452565478a243494911ce13c43f77dc3416d8aa672f9251b217da797a81e1d9f352b84b10964c5fdebbb078d9fa3f80c5444b39b6fd0841b8 +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line strict -module.exports = null; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/0e/3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/0e/3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123 deleted file mode 100644 index 9daeafb9864cf..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/0e/3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123 +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/10/d223011ec6ab8226a4dfa5f1a3a4c14c2740368d5453605333a23fdf52a9fa55163a29379c937f568212725b11dfa006488d7df4cc4d25ba47b60d6b511a83 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/10/d223011ec6ab8226a4dfa5f1a3a4c14c2740368d5453605333a23fdf52a9fa55163a29379c937f568212725b11dfa006488d7df4cc4d25ba47b60d6b511a83 deleted file mode 100644 index b67110c7ad6e5..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/10/d223011ec6ab8226a4dfa5f1a3a4c14c2740368d5453605333a23fdf52a9fa55163a29379c937f568212725b11dfa006488d7df4cc4d25ba47b60d6b511a83 +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = defer; - -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/11/31249521a2e6dd10319ba25e803f43abdc9f170b40fe6f76e812a6e0328ba4951a2d9c94f3e9fb180486e31a1c2fb31a09f7d4a776df95b7e5fec7ca491ac3-index.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/11/31249521a2e6dd10319ba25e803f43abdc9f170b40fe6f76e812a6e0328ba4951a2d9c94f3e9fb180486e31a1c2fb31a09f7d4a776df95b7e5fec7ca491ac3-index.json deleted file mode 100644 index f8ab54110b25f..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/11/31249521a2e6dd10319ba25e803f43abdc9f170b40fe6f76e812a6e0328ba4951a2d9c94f3e9fb180486e31a1c2fb31a09f7d4a776df95b7e5fec7ca491ac3-index.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"form-data","version":"4.0.0","files":{"License":{"checkedAt":1673270429349,"integrity":"sha512-ZwZnQAboeW6eFxNLi/xa0UoNS0hFYPA1H9UUK+nr8Tgc3zi0XfaWnQRhi8+4axH6BzVJbmv0iLC4G+jhEaYlJQ==","mode":420,"size":1118},"README.md.bak":{"checkedAt":1673270429490,"integrity":"sha512-O03xYM9N5MYijGxXuw137PHRmDZJJ8VfbWSDZfkiyWM2BBwcxnP7BylmcJKkOGNBe33ZKhaBCHrKbU9FZzlNuw==","mode":420,"size":12070},"lib/browser.js":{"checkedAt":1673270429447,"integrity":"sha512-h/D+sKL+scebV+4EUlcwkiWy3KBk0JfJ8rbpCkNGvWJib6PMM+U3A2ZBNIzIGb1e05lB3LwG3DkPo4lGqrP1tw==","mode":420,"size":101},"Readme.md":{"checkedAt":1673270429490,"integrity":"sha512-O03xYM9N5MYijGxXuw137PHRmDZJJ8VfbWSDZfkiyWM2BBwcxnP7BylmcJKkOGNBe33ZKhaBCHrKbU9FZzlNuw==","mode":420,"size":12070},"lib/form_data.js":{"checkedAt":1673270429583,"integrity":"sha512-+Jnmobc5nVMMnHpxW5gmKdEe0rfCnE1gElZURvUnZaDqa6A70ChGrF2GmkyOr9eM7DKQZ82Lvmfo6cN23cZTIw==","mode":420,"size":13715},"lib/populate.js":{"checkedAt":1673270429587,"integrity":"sha512-hlIi85bUYOk4q+lcSisgvOZtwY1WnAV0JW0pAj4iaIcgy6BVEMe8/TR3Tcluxtanszg6Apt5TguF8h/ddlkiWw==","mode":420,"size":177},"package.json":{"checkedAt":1673270429615,"integrity":"sha512-F5mZ3/JfDntUKtpLDNC2ILJWqrjLavloUZRxMQF53BbvZq80C+U7HURuXMG0GUqXj9JyhRe3hPZO+75JrTdWRA==","mode":420,"size":2305},"index.d.ts":{"checkedAt":1673270429621,"integrity":"sha512-XzXlSLMANQmmyqtmj8OvHbvzt7Wn+wrZZdvSelPZJSIiQQsQP8NcGhBJx4/z4ixwDay45wGqbKv0LdqqC1OcGA==","mode":420,"size":1825}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/13/f9117d2af0c059f324f483cc6ab6b4e51c28dee28703b83bfc3fac7c1077cc90ee7cb222b6e2164eb3191a430002b24cfee07bfd91a2a51604250cfc4d4a4a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/13/f9117d2af0c059f324f483cc6ab6b4e51c28dee28703b83bfc3fac7c1077cc90ee7cb222b6e2164eb3191a430002b24cfee07bfd91a2a51604250cfc4d4a4a deleted file mode 100644 index aca36f9f0bc96..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/13/f9117d2af0c059f324f483cc6ab6b4e51c28dee28703b83bfc3fac7c1077cc90ee7cb222b6e2164eb3191a430002b24cfee07bfd91a2a51604250cfc4d4a4a +++ /dev/null @@ -1,141 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/15/03783117ee25e1dfedc05b04c2455e12920eafb690002b06599106f72f144e410751d9297b5214048385d973f73398c3187c943767be630e7bffb971da0476-index.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/15/03783117ee25e1dfedc05b04c2455e12920eafb690002b06599106f72f144e410751d9297b5214048385d973f73398c3187c943767be630e7bffb971da0476-index.json deleted file mode 100644 index 11a8b6ada4db4..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/15/03783117ee25e1dfedc05b04c2455e12920eafb690002b06599106f72f144e410751d9297b5214048385d973f73398c3187c943767be630e7bffb971da0476-index.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"combined-stream","version":"1.0.8","files":{"Readme.md":{"checkedAt":1673270429539,"integrity":"sha512-AMSXvw5GumnxK1C7XXz6mOZKXT0KVZkZ9ezcDU+xBg516b1Gn5wuwp2cR52XZK+C/wSnebqoSf63Wg+yts2B6g==","mode":388,"size":4551},"package.json":{"checkedAt":1673270429561,"integrity":"sha512-t7prZfhD550sZMBl2cm8/foTtZJhBIzqcvrri6fH5pnvPD5TrnMC+mvMoZ1+B3dCg6JIkUnv8qmfFJhohTWSGg==","mode":388,"size":640},"yarn.lock":{"checkedAt":1673270429571,"integrity":"sha512-wos/5bMpanOEY86KR8YcIyfL+DaYC1h6Hrf5urk4G4qmSpBhJ9B0a+iJdaKU4rE2bpxuvSm+s1M8JqNMCDbsYw==","mode":388,"size":551},"License":{"checkedAt":1673270429571,"integrity":"sha512-QC/HN+kDgNYpC7i33wfvn5wKaEz8H4mMLjVuA6w03m1OlQFq5w7L4MbJZrWZaWlso2u4xIS7xZDZT6574cQ1Og==","mode":388,"size":1085},"lib/combined_stream.js":{"checkedAt":1673270429583,"integrity":"sha512-NLJJG4D921foMMCtUqm22p78dWVUkLEXof2LtGSVnVSsJYXd1nJpdftgpAF9M69Q+ETEMR8VcMCcQTVZtKBpmg==","mode":420,"size":4687}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/066da212f8df88127a67abf0d1c83da12c44297cb818aef5bf54b0dbe2ed1713212531b6682af9b4a6ff07991781c4a421740db71732e24406be317d13a7b4 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/066da212f8df88127a67abf0d1c83da12c44297cb818aef5bf54b0dbe2ed1713212531b6682af9b4a6ff07991781c4a421740db71732e24406be317d13a7b4 deleted file mode 100644 index fdcff1a6b80cc..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/066da212f8df88127a67abf0d1c83da12c44297cb818aef5bf54b0dbe2ed1713212531b6682af9b4a6ff07991781c4a421740db71732e24406be317d13a7b4 +++ /dev/null @@ -1,168 +0,0 @@ -# Upgrade Guide - -### 0.18.x -> 0.19.0 - -#### HTTPS Proxies - -Routing through an https proxy now requires setting the `protocol` attribute of the proxy configuration to `https` - -### 0.15.x -> 0.16.0 - -#### `Promise` Type Declarations - -The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. - -### 0.13.x -> 0.14.0 - -#### TypeScript Definitions - -The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. - -Please use the following `import` statement to import axios in TypeScript: - -```typescript -import axios from 'axios'; - -axios.get('/foo') - .then(response => console.log(response)) - .catch(error => console.log(error)); -``` - -#### `agent` Config Option - -The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. - -```js -{ - // Define a custom agent for HTTP - httpAgent: new http.Agent({ keepAlive: true }), - // Define a custom agent for HTTPS - httpsAgent: new https.Agent({ keepAlive: true }) -} -``` - -#### `progress` Config Option - -The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. - -```js -{ - // Define a handler for upload progress events - onUploadProgress: function (progressEvent) { - // ... - }, - - // Define a handler for download progress events - onDownloadProgress: function (progressEvent) { - // ... - } -} -``` - -### 0.12.x -> 0.13.0 - -The `0.13.0` release contains several changes to custom adapters and error handling. - -#### Error Handling - -Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. - -```js -axios.get('/user/12345') - .catch((error) => { - console.log(error.message); - console.log(error.code); // Not always specified - console.log(error.config); // The config that was used to make the request - console.log(error.response); // Only available if response was received from the server - }); -``` - -#### Request Adapters - -This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. - -1. Response transformer is now called outside of adapter. -2. Request adapter returns a `Promise`. - -This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. - -Previous code: - -```js -function myAdapter(resolve, reject, config) { - var response = { - data: transformData( - responseData, - responseHeaders, - config.transformResponse - ), - status: request.status, - statusText: request.statusText, - headers: responseHeaders - }; - settle(resolve, reject, response); -} -``` - -New code: - -```js -function myAdapter(config) { - return new Promise(function (resolve, reject) { - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders - }; - settle(resolve, reject, response); - }); -} -``` - -See the related commits for more details: -- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) -- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) - -### 0.5.x -> 0.6.0 - -The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. - -#### ES6 Promise Polyfill - -Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. - -```js -require('es6-promise').polyfill(); -var axios = require('axios'); -``` - -This will polyfill the global environment, and only needs to be done once. - -#### `axios.success`/`axios.error` - -The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. - -```js -axios.get('some/url') - .then(function (res) { - /* ... */ - }) - .catch(function (err) { - /* ... */ - }); -``` - -#### UMD - -Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. - -```js -// AMD -require(['bower_components/axios/dist/axios'], function (axios) { - /* ... */ -}); - -// CommonJS -var axios = require('axios/dist/axios'); -``` diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/5817f7bc0b2eb28e2d8924b6d34ad1ec27f93d4caf73a40c108c68cd912df7aac8f40932c9e2e6f08824ada29a2ccbeae7dfada16a32c7e6215bc062333bf9 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/5817f7bc0b2eb28e2d8924b6d34ad1ec27f93d4caf73a40c108c68cd912df7aac8f40932c9e2e6f08824ada29a2ccbeae7dfada16a32c7e6215bc062333bf9 deleted file mode 100644 index 79dfd09dd5711..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/5817f7bc0b2eb28e2d8924b6d34ad1ec27f93d4caf73a40c108c68cd912df7aac8f40932c9e2e6f08824ada29a2ccbeae7dfada16a32c7e6215bc062333bf9 +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/9999dff25f0e7b542ada4b0cd0b620b256aab8cb6af968519471310179dc16ef66af340be53b1d446e5cc1b4194a978fd2728517b784f64efbbe49ad375644 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/9999dff25f0e7b542ada4b0cd0b620b256aab8cb6af968519471310179dc16ef66af340be53b1d446e5cc1b4194a978fd2728517b784f64efbbe49ad375644 deleted file mode 100644 index 0f20240bfba81..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/17/9999dff25f0e7b542ada4b0cd0b620b256aab8cb6af968519471310179dc16ef66af340be53b1d446e5cc1b4194a978fd2728517b784f64efbbe49ad375644 +++ /dev/null @@ -1,68 +0,0 @@ -{ - "author": "Felix GeisendΓΆrfer (http://debuggable.com/)", - "name": "form-data", - "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "4.0.0", - "repository": { - "type": "git", - "url": "git://github.com/form-data/form-data.git" - }, - "main": "./lib/form_data", - "browser": "./lib/browser", - "typings": "./index.d.ts", - "scripts": { - "pretest": "rimraf coverage test/tmp", - "test": "istanbul cover test/run.js", - "posttest": "istanbul report lcov text", - "lint": "eslint lib/*.js test/*.js test/integration/*.js", - "report": "istanbul report lcov text", - "ci-lint": "is-node-modern 8 && npm run lint || is-node-not-modern 8", - "ci-test": "npm run test && npm run browser && npm run report", - "predebug": "rimraf coverage test/tmp", - "debug": "verbose=1 ./test/run.js", - "browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage", - "check": "istanbul check-coverage coverage/coverage*.json", - "files": "pkgfiles --sort=name", - "get-version": "node -e \"console.log(require('./package.json').version)\"", - "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md", - "restore-readme": "mv README.md.bak README.md", - "prepublish": "in-publish && npm run update-readme || not-in-publish", - "postpublish": "npm run restore-readme" - }, - "pre-commit": [ - "lint", - "ci-test", - "check" - ], - "engines": { - "node": ">= 6" - }, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "devDependencies": { - "@types/node": "^12.0.10", - "browserify": "^13.1.1", - "browserify-istanbul": "^2.0.0", - "coveralls": "^3.0.4", - "cross-spawn": "^6.0.5", - "eslint": "^6.0.1", - "fake": "^0.2.2", - "far": "^0.0.7", - "formidable": "^1.0.17", - "in-publish": "^2.0.0", - "is-node-modern": "^1.0.0", - "istanbul": "^0.4.5", - "obake": "^0.1.2", - "puppeteer": "^1.19.0", - "pkgfiles": "^2.3.0", - "pre-commit": "^1.1.3", - "request": "^2.88.0", - "rimraf": "^2.7.1", - "tape": "^4.6.2", - "typescript": "^3.5.2" - }, - "license": "MIT" -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/45c0dac594e4321854d53a43e4f63480449f4f6e69a9bc99ceb8be942227a1e9d4e438ed004bcbf88023a57c76b6514004585439d790edfa4a1bf5f08d2f63 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/45c0dac594e4321854d53a43e4f63480449f4f6e69a9bc99ceb8be942227a1e9d4e438ed004bcbf88023a57c76b6514004585439d790edfa4a1bf5f08d2f63 deleted file mode 100644 index eb7aa390b6686..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/45c0dac594e4321854d53a43e4f63480449f4f6e69a9bc99ceb8be942227a1e9d4e438ed004bcbf88023a57c76b6514004585439d790edfa4a1bf5f08d2f63 +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - // eslint-disable-next-line consistent-return - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - return getMergedValue(undefined, config1[prop]); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(undefined, config2[prop]); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - return getMergedValue(undefined, config1[prop]); - } - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(prop) { - if (prop in config2) { - return getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - return getMergedValue(undefined, config1[prop]); - } - } - - var mergeMap = { - 'url': valueFromConfig2, - 'method': valueFromConfig2, - 'data': valueFromConfig2, - 'baseURL': defaultToConfig2, - 'transformRequest': defaultToConfig2, - 'transformResponse': defaultToConfig2, - 'paramsSerializer': defaultToConfig2, - 'timeout': defaultToConfig2, - 'timeoutMessage': defaultToConfig2, - 'withCredentials': defaultToConfig2, - 'adapter': defaultToConfig2, - 'responseType': defaultToConfig2, - 'xsrfCookieName': defaultToConfig2, - 'xsrfHeaderName': defaultToConfig2, - 'onUploadProgress': defaultToConfig2, - 'onDownloadProgress': defaultToConfig2, - 'decompress': defaultToConfig2, - 'maxContentLength': defaultToConfig2, - 'maxBodyLength': defaultToConfig2, - 'beforeRedirect': defaultToConfig2, - 'transport': defaultToConfig2, - 'httpAgent': defaultToConfig2, - 'httpsAgent': defaultToConfig2, - 'cancelToken': defaultToConfig2, - 'socketPath': defaultToConfig2, - 'responseEncoding': defaultToConfig2, - 'validateStatus': mergeDirectKeys - }; - - utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { - var merge = mergeMap[prop] || mergeDeepProperties; - var configValue = merge(prop); - (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); - - return config; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/486cc441d4748bc04aac3d5681842805d57d1a7382e9b250bea7b93091d9ec6584d98e392398b2d5784344859fa36b939124064ed172e2ba84398a2f305045 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/486cc441d4748bc04aac3d5681842805d57d1a7382e9b250bea7b93091d9ec6584d98e392398b2d5784344859fa36b939124064ed172e2ba84398a2f305045 deleted file mode 100644 index 43fea788a8291..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/486cc441d4748bc04aac3d5681842805d57d1a7382e9b250bea7b93091d9ec6584d98e392398b2d5784344859fa36b939124064ed172e2ba84398a2f305045 +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/f7ea15e4d492bf65cb28d5cf3cf991f80d0a00a82d53afdf089d45c6e3ab9064ff9a12e124c8b0202fb640a200b72b62166c675d6e1557fc4a8db5c1a70be7 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/f7ea15e4d492bf65cb28d5cf3cf991f80d0a00a82d53afdf089d45c6e3ab9064ff9a12e124c8b0202fb640a200b72b62166c675d6e1557fc4a8db5c1a70be7 deleted file mode 100644 index c612f1a55fda0..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/18/f7ea15e4d492bf65cb28d5cf3cf991f80d0a00a82d53afdf089d45c6e3ab9064ff9a12e124c8b0202fb640a200b72b62166c675d6e1557fc4a8db5c1a70be7 +++ /dev/null @@ -1,76 +0,0 @@ -/* eslint no-console: "off" */ - -var asynckit = require('./') - , async = require('async') - , assert = require('assert') - , expected = 0 - ; - -var Benchmark = require('benchmark'); -var suite = new Benchmark.Suite; - -var source = []; -for (var z = 1; z < 100; z++) -{ - source.push(z); - expected += z; -} - -suite -// add tests - -.add('async.map', function(deferred) -{ - var total = 0; - - async.map(source, - function(i, cb) - { - setImmediate(function() - { - total += i; - cb(null, total); - }); - }, - function(err, result) - { - assert.ifError(err); - assert.equal(result[result.length - 1], expected); - deferred.resolve(); - }); -}, {'defer': true}) - - -.add('asynckit.parallel', function(deferred) -{ - var total = 0; - - asynckit.parallel(source, - function(i, cb) - { - setImmediate(function() - { - total += i; - cb(null, total); - }); - }, - function(err, result) - { - assert.ifError(err); - assert.equal(result[result.length - 1], expected); - deferred.resolve(); - }); -}, {'defer': true}) - - -// add listeners -.on('cycle', function(ev) -{ - console.log(String(ev.target)); -}) -.on('complete', function() -{ - console.log('Fastest is ' + this.filter('fastest').map('name')); -}) -// run async -.run({ 'async': true }); diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/19/b556bb76c0e515f2968c0c92d13c2238d455da908fe7b893e5936227aef24d8d8a9db04c94261ffeefd3a8dbe7f644677c3439c60d5e1e524699522184a8af b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/19/b556bb76c0e515f2968c0c92d13c2238d455da908fe7b893e5936227aef24d8d8a9db04c94261ffeefd3a8dbe7f644677c3439c60d5e1e524699522184a8af deleted file mode 100644 index eea3291c54b47..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/19/b556bb76c0e515f2968c0c92d13c2238d455da908fe7b893e5936227aef24d8d8a9db04c94261ffeefd3a8dbe7f644677c3439c60d5e1e524699522184a8af +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": "Felix GeisendΓΆrfer (http://debuggable.com/)", - "contributors": [ - "Mike Atkins " - ], - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "license": "MIT", - "version": "1.0.0", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "scripts": { - "test": "make test" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/1b/1aaee5b768cb949869f4c76707eb6331acef0086ce1b8a618fb26a4cf2e5e39aa0ed5e02bc3d631b80bd251b9103fc4f219bf0a0a4bf19d30459e48b041d65 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/1b/1aaee5b768cb949869f4c76707eb6331acef0086ce1b8a618fb26a4cf2e5e39aa0ed5e02bc3d631b80bd251b9103fc4f219bf0a0a4bf19d30459e48b041d65 deleted file mode 100644 index 5d2839a590b2b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/1b/1aaee5b768cb949869f4c76707eb6331acef0086ce1b8a618fb26a4cf2e5e39aa0ed5e02bc3d631b80bd251b9103fc4f219bf0a0a4bf19d30459e48b041d65 +++ /dev/null @@ -1,75 +0,0 @@ -var async = require('./async.js') - , abort = require('./abort.js') - ; - -// API -module.exports = iterate; - -/** - * Iterates over each job object - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed - */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; - - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } - - // return salvaged results - callback(error, state.results); - }); -} - -/** - * Runs iterator over provided job element - * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else - */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } - - return aborter; -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2a/7818be7415747d4432389dcbd24372084b3606e8b1b955f371affdf1a5fbe030adcfed962cc37a78764fef00b63e1dbe48a2173c356ad8dbfa4e951f6c5e3c b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2a/7818be7415747d4432389dcbd24372084b3606e8b1b955f371affdf1a5fbe030adcfed962cc37a78764fef00b63e1dbe48a2173c356ad8dbfa4e951f6c5e3c deleted file mode 100644 index ee7989f918659..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2a/7818be7415747d4432389dcbd24372084b3606e8b1b955f371affdf1a5fbe030adcfed962cc37a78764fef00b63e1dbe48a2173c356ad8dbfa4e951f6c5e3c +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -var CanceledError = require('./CanceledError'); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - - // eslint-disable-next-line func-names - this.promise.then(function(cancel) { - if (!token._listeners) return; - - var i; - var l = token._listeners.length; - - for (i = 0; i < l; i++) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - - // eslint-disable-next-line func-names - this.promise.then = function(onfulfilled) { - var _resolve; - // eslint-disable-next-line func-names - var promise = new Promise(function(resolve) { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - - return promise; - }; - - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new CanceledError(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `CanceledError` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; - -/** - * Subscribe to the cancel signal - */ - -CancelToken.prototype.subscribe = function subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } -}; - -/** - * Unsubscribe from the cancel signal - */ - -CancelToken.prototype.unsubscribe = function unsubscribe(listener) { - if (!this._listeners) { - return; - } - var index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2a/923fbecf49405963f39248e245c56082bc8d83f690f16f0829b857b170eab7a9b3cff5ace86af7041dbe6c8b95053690fb0fafa344321c27adffff78721b4a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2a/923fbecf49405963f39248e245c56082bc8d83f690f16f0829b857b170eab7a9b3cff5ace86af7041dbe6c8b95053690fb0fafa344321c27adffff78721b4a deleted file mode 100644 index ffd98e6f8f27d..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2a/923fbecf49405963f39248e245c56082bc8d83f690f16f0829b857b170eab7a9b3cff5ace86af7041dbe6c8b95053690fb0fafa344321c27adffff78721b4a +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "axios", - "version": "0.27.2", - "description": "Promise based HTTP client for the browser and node.js", - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "test": "grunt test && dtslint", - "start": "node ./sandbox/server.js", - "preversion": "grunt version && npm test", - "build": "NODE_ENV=production grunt build", - "examples": "node ./examples/server.js", - "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", - "fix": "eslint --fix lib/**/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/axios/axios.git" - }, - "keywords": [ - "xhr", - "http", - "ajax", - "promise", - "node" - ], - "author": "Matt Zabriskie", - "license": "MIT", - "bugs": { - "url": "https://github.com/axios/axios/issues" - }, - "homepage": "https://axios-http.com", - "devDependencies": { - "abortcontroller-polyfill": "^1.7.3", - "coveralls": "^3.1.1", - "dtslint": "^4.2.1", - "es6-promise": "^4.2.8", - "formidable": "^2.0.1", - "grunt": "^1.4.1", - "grunt-banner": "^0.6.0", - "grunt-cli": "^1.4.3", - "grunt-contrib-clean": "^2.0.0", - "grunt-contrib-watch": "^1.1.0", - "grunt-eslint": "^24.0.0", - "grunt-karma": "^4.0.2", - "grunt-mocha-test": "^0.13.3", - "grunt-webpack": "^5.0.0", - "istanbul-instrumenter-loader": "^3.0.1", - "jasmine-core": "^2.4.1", - "karma": "^6.3.17", - "karma-chrome-launcher": "^3.1.1", - "karma-firefox-launcher": "^2.1.2", - "karma-jasmine": "^1.1.1", - "karma-jasmine-ajax": "^0.1.13", - "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^4.3.6", - "karma-sinon": "^1.0.5", - "karma-sourcemap-loader": "^0.3.8", - "karma-webpack": "^4.0.2", - "load-grunt-tasks": "^5.1.0", - "minimist": "^1.2.6", - "mocha": "^8.2.1", - "sinon": "^4.5.0", - "terser-webpack-plugin": "^4.2.3", - "typescript": "^4.6.3", - "url-search-params": "^0.10.0", - "webpack": "^4.44.2", - "webpack-dev-server": "^3.11.0" - }, - "browser": { - "./lib/adapters/http.js": "./lib/adapters/xhr.js", - "./lib/defaults/env/FormData.js": "./lib/helpers/null.js" - }, - "jsdelivr": "dist/axios.min.js", - "unpkg": "dist/axios.min.js", - "typings": "./index.d.ts", - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - }, - "bundlesize": [ - { - "path": "./dist/axios.min.js", - "threshold": "5kB" - } - ] -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2b/cd66a0585c36af775e44e2b3c3e86cc8d540b997e9111b0a393c94e9636b024cd8e2e2939ee7757c9b27320561490b1f891d57bf25953f4ba34ad998cee103-exec b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2b/cd66a0585c36af775e44e2b3c3e86cc8d540b997e9111b0a393c94e9636b024cd8e2e2939ee7757c9b27320561490b1f891d57bf25953f4ba34ad998cee103-exec deleted file mode 100755 index 66906d85a3de3..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2b/cd66a0585c36af775e44e2b3c3e86cc8d540b997e9111b0a393c94e9636b024cd8e2e2939ee7757c9b27320561490b1f891d57bf25953f4ba34ad998cee103-exec +++ /dev/null @@ -1,991 +0,0 @@ -# axios - -[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) -[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) -![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) -[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) -[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) -[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) -[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) -[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) -[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) -[![Known Vulnerabilities](https://snyk.io/test/npm/axios/badge.svg)](https://snyk.io/test/npm/axios) - -Promise based HTTP client for the browser and node.js - -> New axios docs website: [click here](https://axios-http.com/) - -## Table of Contents - - - [Features](#features) - - [Browser Support](#browser-support) - - [Installing](#installing) - - [Example](#example) - - [Axios API](#axios-api) - - [Request method aliases](#request-method-aliases) - - [Concurrency πŸ‘Ž](#concurrency-deprecated) - - [Creating an instance](#creating-an-instance) - - [Instance methods](#instance-methods) - - [Request Config](#request-config) - - [Response Schema](#response-schema) - - [Config Defaults](#config-defaults) - - [Global axios defaults](#global-axios-defaults) - - [Custom instance defaults](#custom-instance-defaults) - - [Config order of precedence](#config-order-of-precedence) - - [Interceptors](#interceptors) - - [Multiple Interceptors](#multiple-interceptors) - - [Handling Errors](#handling-errors) - - [Cancellation](#cancellation) - - [AbortController](#abortcontroller) - - [CancelToken πŸ‘Ž](#canceltoken-deprecated) - - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) - - [Browser](#browser) - - [Node.js](#nodejs) - - [Query string](#query-string) - - [Form data](#form-data) - - [Automatic serialization](#-automatic-serialization) - - [Manual FormData passing](#manual-formdata-passing) - - [Semver](#semver) - - [Promises](#promises) - - [TypeScript](#typescript) - - [Resources](#resources) - - [Credits](#credits) - - [License](#license) - -## Features - -- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser -- Make [http](http://nodejs.org/api/http.html) requests from node.js -- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API -- Intercept request and response -- Transform request and response data -- Cancel requests -- Automatic transforms for JSON data -- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) - -## Browser Support - -![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ---- | --- | --- | --- | --- | --- | -Latest βœ” | Latest βœ” | Latest βœ” | Latest βœ” | Latest βœ” | 11 βœ” | - -[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) - -## Installing - -Using npm: - -```bash -$ npm install axios -``` - -Using bower: - -```bash -$ bower install axios -``` - -Using yarn: - -```bash -$ yarn add axios -``` - -Using jsDelivr CDN: - -```html - -``` - -Using unpkg CDN: - -```html - -``` - -## Example - -### note: CommonJS usage -In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: - -```js -const axios = require('axios').default; - -// axios. will now provide autocomplete and parameter typings -``` - -Performing a `GET` request - -```js -const axios = require('axios').default; - -// Make a request for a user with a given ID -axios.get('/user?ID=12345') - .then(function (response) { - // handle success - console.log(response); - }) - .catch(function (error) { - // handle error - console.log(error); - }) - .then(function () { - // always executed - }); - -// Optionally the request above could also be done as -axios.get('/user', { - params: { - ID: 12345 - } - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }) - .then(function () { - // always executed - }); - -// Want to use async/await? Add the `async` keyword to your outer function/method. -async function getUser() { - try { - const response = await axios.get('/user?ID=12345'); - console.log(response); - } catch (error) { - console.error(error); - } -} -``` - -> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet -> Explorer and older browsers, so use with caution. - -Performing a `POST` request - -```js -axios.post('/user', { - firstName: 'Fred', - lastName: 'Flintstone' - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }); -``` - -Performing multiple concurrent requests - -```js -function getUserAccount() { - return axios.get('/user/12345'); -} - -function getUserPermissions() { - return axios.get('/user/12345/permissions'); -} - -Promise.all([getUserAccount(), getUserPermissions()]) - .then(function (results) { - const acct = results[0]; - const perm = results[1]; - }); -``` - -## axios API - -Requests can be made by passing the relevant config to `axios`. - -##### axios(config) - -```js -// Send a POST request -axios({ - method: 'post', - url: '/user/12345', - data: { - firstName: 'Fred', - lastName: 'Flintstone' - } -}); -``` - -```js -// GET request for remote image in node.js -axios({ - method: 'get', - url: 'http://bit.ly/2mTM3nY', - responseType: 'stream' -}) - .then(function (response) { - response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) - }); -``` - -##### axios(url[, config]) - -```js -// Send a GET request (default method) -axios('/user/12345'); -``` - -### Request method aliases - -For convenience, aliases have been provided for all common request methods. - -##### axios.request(config) -##### axios.get(url[, config]) -##### axios.delete(url[, config]) -##### axios.head(url[, config]) -##### axios.options(url[, config]) -##### axios.post(url[, data[, config]]) -##### axios.put(url[, data[, config]]) -##### axios.patch(url[, data[, config]]) - -###### NOTE -When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. - -### Concurrency (Deprecated) -Please use `Promise.all` to replace the below functions. - -Helper functions for dealing with concurrent requests. - -axios.all(iterable) -axios.spread(callback) - -### Creating an instance - -You can create a new instance of axios with a custom config. - -##### axios.create([config]) - -```js -const instance = axios.create({ - baseURL: 'https://some-domain.com/api/', - timeout: 1000, - headers: {'X-Custom-Header': 'foobar'} -}); -``` - -### Instance methods - -The available instance methods are listed below. The specified config will be merged with the instance config. - -##### axios#request(config) -##### axios#get(url[, config]) -##### axios#delete(url[, config]) -##### axios#head(url[, config]) -##### axios#options(url[, config]) -##### axios#post(url[, data[, config]]) -##### axios#put(url[, data[, config]]) -##### axios#patch(url[, data[, config]]) -##### axios#getUri([config]) - -## Request Config - -These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. - -```js -{ - // `url` is the server URL that will be used for the request - url: '/user', - - // `method` is the request method to be used when making the request - method: 'get', // default - - // `baseURL` will be prepended to `url` unless `url` is absolute. - // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs - // to methods of that instance. - baseURL: 'https://some-domain.com/api/', - - // `transformRequest` allows changes to the request data before it is sent to the server - // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' - // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, - // FormData or Stream - // You may modify the headers object. - transformRequest: [function (data, headers) { - // Do whatever you want to transform the data - - return data; - }], - - // `transformResponse` allows changes to the response data to be made before - // it is passed to then/catch - transformResponse: [function (data) { - // Do whatever you want to transform the data - - return data; - }], - - // `headers` are custom headers to be sent - headers: {'X-Requested-With': 'XMLHttpRequest'}, - - // `params` are the URL parameters to be sent with the request - // Must be a plain object or a URLSearchParams object - params: { - ID: 12345 - }, - - // `paramsSerializer` is an optional function in charge of serializing `params` - // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) - paramsSerializer: function (params) { - return Qs.stringify(params, {arrayFormat: 'brackets'}) - }, - - // `data` is the data to be sent as the request body - // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' - // When no `transformRequest` is set, must be of one of the following types: - // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams - // - Browser only: FormData, File, Blob - // - Node only: Stream, Buffer - data: { - firstName: 'Fred' - }, - - // syntax alternative to send data into the body - // method post - // only the value is sent, not the key - data: 'Country=Brasil&City=Belo Horizonte', - - // `timeout` specifies the number of milliseconds before the request times out. - // If the request takes longer than `timeout`, the request will be aborted. - timeout: 1000, // default is `0` (no timeout) - - // `withCredentials` indicates whether or not cross-site Access-Control requests - // should be made using credentials - withCredentials: false, // default - - // `adapter` allows custom handling of requests which makes testing easier. - // Return a promise and supply a valid response (see lib/adapters/README.md). - adapter: function (config) { - /* ... */ - }, - - // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. - // This will set an `Authorization` header, overwriting any existing - // `Authorization` custom headers you have set using `headers`. - // Please note that only HTTP Basic auth is configurable through this parameter. - // For Bearer tokens and such, use `Authorization` custom headers instead. - auth: { - username: 'janedoe', - password: 's00pers3cret' - }, - - // `responseType` indicates the type of data that the server will respond with - // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' - // browser only: 'blob' - responseType: 'json', // default - - // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) - // Note: Ignored for `responseType` of 'stream' or client-side requests - responseEncoding: 'utf8', // default - - // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token - xsrfCookieName: 'XSRF-TOKEN', // default - - // `xsrfHeaderName` is the name of the http header that carries the xsrf token value - xsrfHeaderName: 'X-XSRF-TOKEN', // default - - // `onUploadProgress` allows handling of progress events for uploads - // browser only - onUploadProgress: function (progressEvent) { - // Do whatever you want with the native progress event - }, - - // `onDownloadProgress` allows handling of progress events for downloads - // browser only - onDownloadProgress: function (progressEvent) { - // Do whatever you want with the native progress event - }, - - // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js - maxContentLength: 2000, - - // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed - maxBodyLength: 2000, - - // `validateStatus` defines whether to resolve or reject the promise for a given - // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` - // or `undefined`), the promise will be resolved; otherwise, the promise will be - // rejected. - validateStatus: function (status) { - return status >= 200 && status < 300; // default - }, - - // `maxRedirects` defines the maximum number of redirects to follow in node.js. - // If set to 0, no redirects will be followed. - maxRedirects: 21, // default - - // `beforeRedirect` defines a function that will be called before redirect. - // Use this to adjust the request options upon redirecting, - // to inspect the latest response headers, - // or to cancel the request by throwing an error - // If maxRedirects is set to 0, `beforeRedirect` is not used. - beforeRedirect: (options, { headers }) => { - if (options.hostname === "example.com") { - options.auth = "user:password"; - } - }; - - // `socketPath` defines a UNIX Socket to be used in node.js. - // e.g. '/var/run/docker.sock' to send requests to the docker daemon. - // Only either `socketPath` or `proxy` can be specified. - // If both are specified, `socketPath` is used. - socketPath: null, // default - - // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http - // and https requests, respectively, in node.js. This allows options to be added like - // `keepAlive` that are not enabled by default. - httpAgent: new http.Agent({ keepAlive: true }), - httpsAgent: new https.Agent({ keepAlive: true }), - - // `proxy` defines the hostname, port, and protocol of the proxy server. - // You can also define your proxy using the conventional `http_proxy` and - // `https_proxy` environment variables. If you are using environment variables - // for your proxy configuration, you can also define a `no_proxy` environment - // variable as a comma-separated list of domains that should not be proxied. - // Use `false` to disable proxies, ignoring environment variables. - // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and - // supplies credentials. - // This will set an `Proxy-Authorization` header, overwriting any existing - // `Proxy-Authorization` custom headers you have set using `headers`. - // If the proxy server uses HTTPS, then you must set the protocol to `https`. - proxy: { - protocol: 'https', - host: '127.0.0.1', - port: 9000, - auth: { - username: 'mikeymike', - password: 'rapunz3l' - } - }, - - // `cancelToken` specifies a cancel token that can be used to cancel the request - // (see Cancellation section below for details) - cancelToken: new CancelToken(function (cancel) { - }), - - // an alternative way to cancel Axios requests using AbortController - signal: new AbortController().signal, - - // `decompress` indicates whether or not the response body should be decompressed - // automatically. If set to `true` will also remove the 'content-encoding' header - // from the responses objects of all decompressed responses - // - Node only (XHR cannot turn off decompression) - decompress: true // default - - // `insecureHTTPParser` boolean. - // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers. - // This may allow interoperability with non-conformant HTTP implementations. - // Using the insecure parser should be avoided. - // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback - // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none - insecureHTTPParser: undefined // default - - // transitional options for backward compatibility that may be removed in the newer versions - transitional: { - // silent JSON parsing mode - // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) - // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') - silentJSONParsing: true, // default value for the current Axios version - - // try to parse the response string as JSON even if `responseType` is not 'json' - forcedJSONParsing: true, - - // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts - clarifyTimeoutError: false, - }, - - env: { - // The FormData class to be used to automatically serialize the payload into a FormData object - FormData: window?.FormData || global?.FormData - } -} -``` - -## Response Schema - -The response for a request contains the following information. - -```js -{ - // `data` is the response that was provided by the server - data: {}, - - // `status` is the HTTP status code from the server response - status: 200, - - // `statusText` is the HTTP status message from the server response - statusText: 'OK', - - // `headers` the HTTP headers that the server responded with - // All header names are lower cased and can be accessed using the bracket notation. - // Example: `response.headers['content-type']` - headers: {}, - - // `config` is the config that was provided to `axios` for the request - config: {}, - - // `request` is the request that generated this response - // It is the last ClientRequest instance in node.js (in redirects) - // and an XMLHttpRequest instance in the browser - request: {} -} -``` - -When using `then`, you will receive the response as follows: - -```js -axios.get('/user/12345') - .then(function (response) { - console.log(response.data); - console.log(response.status); - console.log(response.statusText); - console.log(response.headers); - console.log(response.config); - }); -``` - -When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. - -## Config Defaults - -You can specify config defaults that will be applied to every request. - -### Global axios defaults - -```js -axios.defaults.baseURL = 'https://api.example.com'; - -// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. -// See below for an example using Custom instance defaults instead. -axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; - -axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; -``` - -### Custom instance defaults - -```js -// Set config defaults when creating the instance -const instance = axios.create({ - baseURL: 'https://api.example.com' -}); - -// Alter defaults after instance has been created -instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; -``` - -### Config order of precedence - -Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. - -```js -// Create an instance using the config defaults provided by the library -// At this point the timeout config value is `0` as is the default for the library -const instance = axios.create(); - -// Override timeout default for the library -// Now all requests using this instance will wait 2.5 seconds before timing out -instance.defaults.timeout = 2500; - -// Override timeout for this request as it's known to take a long time -instance.get('/longRequest', { - timeout: 5000 -}); -``` - -## Interceptors - -You can intercept requests or responses before they are handled by `then` or `catch`. - -```js -// Add a request interceptor -axios.interceptors.request.use(function (config) { - // Do something before request is sent - return config; - }, function (error) { - // Do something with request error - return Promise.reject(error); - }); - -// Add a response interceptor -axios.interceptors.response.use(function (response) { - // Any status code that lie within the range of 2xx cause this function to trigger - // Do something with response data - return response; - }, function (error) { - // Any status codes that falls outside the range of 2xx cause this function to trigger - // Do something with response error - return Promise.reject(error); - }); -``` - -If you need to remove an interceptor later you can. - -```js -const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); -axios.interceptors.request.eject(myInterceptor); -``` - -You can add interceptors to a custom instance of axios. - -```js -const instance = axios.create(); -instance.interceptors.request.use(function () {/*...*/}); -``` - -When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay -in the execution of your axios request when the main thread is blocked (a promise is created under the hood for -the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag -to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. - -```js -axios.interceptors.request.use(function (config) { - config.headers.test = 'I am only a header!'; - return config; -}, null, { synchronous: true }); -``` - -If you want to execute a particular interceptor based on a runtime check, -you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return -of `runWhen` is `false`. The function will be called with the config -object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an -asynchronous request interceptor that only needs to run at certain times. - -```js -function onGetCall(config) { - return config.method === 'get'; -} -axios.interceptors.request.use(function (config) { - config.headers.test = 'special get headers'; - return config; -}, null, { runWhen: onGetCall }); -``` - -### Multiple Interceptors - -Given you add multiple response interceptors -and when the response was fulfilled -- then each interceptor is executed -- then they are executed in the order they were added -- then only the last interceptor's result is returned -- then every interceptor receives the result of it's predecessor -- and when the fulfillment-interceptor throws - - then the following fulfillment-interceptor is not called - - then the following rejection-interceptor is called - - once caught, another following fulfill-interceptor is called again (just like in a promise chain). - -Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code. - -## Handling Errors - -```js -axios.get('/user/12345') - .catch(function (error) { - if (error.response) { - // The request was made and the server responded with a status code - // that falls out of the range of 2xx - console.log(error.response.data); - console.log(error.response.status); - console.log(error.response.headers); - } else if (error.request) { - // The request was made but no response was received - // `error.request` is an instance of XMLHttpRequest in the browser and an instance of - // http.ClientRequest in node.js - console.log(error.request); - } else { - // Something happened in setting up the request that triggered an Error - console.log('Error', error.message); - } - console.log(error.config); - }); -``` - -Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. - -```js -axios.get('/user/12345', { - validateStatus: function (status) { - return status < 500; // Resolve only if the status code is less than 500 - } -}) -``` - -Using `toJSON` you get an object with more information about the HTTP error. - -```js -axios.get('/user/12345') - .catch(function (error) { - console.log(error.toJSON()); - }); -``` - -## Cancellation - -### AbortController - -Starting from `v0.22.0` Axios supports AbortController to cancel requests in fetch API way: - -```js -const controller = new AbortController(); - -axios.get('/foo/bar', { - signal: controller.signal -}).then(function(response) { - //... -}); -// cancel the request -controller.abort() -``` - -### CancelToken `πŸ‘Ždeprecated` - -You can also cancel a request using a *CancelToken*. - -> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). - -> This API is deprecated since v0.22.0 and shouldn't be used in new projects - -You can create a cancel token using the `CancelToken.source` factory as shown below: - -```js -const CancelToken = axios.CancelToken; -const source = CancelToken.source(); - -axios.get('/user/12345', { - cancelToken: source.token -}).catch(function (thrown) { - if (axios.isCancel(thrown)) { - console.log('Request canceled', thrown.message); - } else { - // handle error - } -}); - -axios.post('/user/12345', { - name: 'new name' -}, { - cancelToken: source.token -}) - -// cancel the request (the message parameter is optional) -source.cancel('Operation canceled by the user.'); -``` - -You can also create a cancel token by passing an executor function to the `CancelToken` constructor: - -```js -const CancelToken = axios.CancelToken; -let cancel; - -axios.get('/user/12345', { - cancelToken: new CancelToken(function executor(c) { - // An executor function receives a cancel function as a parameter - cancel = c; - }) -}); - -// cancel the request -cancel(); -``` - -> Note: you can cancel several requests with the same cancel token/abort controller. -> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. - -> During the transition period, you can use both cancellation APIs, even for the same request: - -## Using application/x-www-form-urlencoded format - -By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. - -### Browser - -In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: - -```js -const params = new URLSearchParams(); -params.append('param1', 'value1'); -params.append('param2', 'value2'); -axios.post('/foo', params); -``` - -> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). - -Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: - -```js -const qs = require('qs'); -axios.post('/foo', qs.stringify({ 'bar': 123 })); -``` - -Or in another way (ES6), - -```js -import qs from 'qs'; -const data = { 'bar': 123 }; -const options = { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - data: qs.stringify(data), - url, -}; -axios(options); -``` - -### Node.js - -#### Query string - -In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: - -```js -const querystring = require('querystring'); -axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); -``` - -or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: - -```js -const url = require('url'); -const params = new url.URLSearchParams({ foo: 'bar' }); -axios.post('http://something.com/', params.toString()); -``` - -You can also use the [`qs`](https://github.com/ljharb/qs) library. - -> NOTE: -> The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case. - -#### Form data - -##### πŸ†• Automatic serialization - -Starting from `v0.27.0`, Axios supports automatic object serialization to a FormData object if the request `Content-Type` -header is set to `multipart/form-data`. - -The following request will submit the data in a FormData format (Browser & Node.js): - -```js -import axios from 'axios'; - -axios.post('https://httpbin.org/post', {x: 1}, { - headers: { - 'Content-Type': 'multipart/form-data' - } -}).then(({data})=> console.log(data)); -``` - -In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default. - -You can overload the FormData class by setting the `env.FormData` config variable, -but you probably won't need it in most cases: - -```js -const axios= require('axios'); -var FormData = require('form-data'); - -axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, { - headers: { - 'Content-Type': 'multipart/form-data' - } -}).then(({data})=> console.log(data)); -``` - -Axios FormData serializer supports some special endings to perform the following operations: - -- `{}` - serialize the value with JSON.stringify -- `[]` - unwrap the array like object as separate fields with the same key - -```js -const axios= require('axios'); - -axios.post('https://httpbin.org/post', { - 'myObj{}': {x: 1, s: "foo"}, - 'files[]': document.querySelector('#fileInput').files -}, { - headers: { - 'Content-Type': 'multipart/form-data' - } -}).then(({data})=> console.log(data)); -``` - -Axios supports the following shortcut methods: `postForm`, `putForm`, `patchForm` -which are just the corresponding http methods with a header preset: `Content-Type`: `multipart/form-data`. - -FileList object can be passed directly: - -```js -await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files) -``` - -All files will be sent with the same field names: `files[]`; - -##### Manual FormData passing - -In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: - -```js -const FormData = require('form-data'); - -const form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); - -axios.post('https://example.com', form) -``` - -## Semver - -Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. - -## Promises - -axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). -If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). - -## TypeScript - -axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. - -```typescript -let user: User = null; -try { - const { data } = await axios.get('/user?ID=12345'); - user = data.userDetails; -} catch (error) { - if (axios.isAxiosError(error)) { - handleAxiosError(error); - } else { - handleUnexpectedError(error); - } -} -``` - -## Online one-click setup - -You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) - - -## Resources - -* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) -* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) -* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) -* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) -* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) - -## Credits - -axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS. - -## License - -[MIT](LICENSE) diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2d/15de2635e7ce9cab7fa0bf1ce4bd04c4f38c96a1345d7ca2267990b9c8f6db49c5bd69b554b217fb9eaafc938a9ab8f1f7f1b3e75f2c8609da4b8b8ffb5d1a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2d/15de2635e7ce9cab7fa0bf1ce4bd04c4f38c96a1345d7ca2267990b9c8f6db49c5bd69b554b217fb9eaafc938a9ab8f1f7f1b3e75f2c8609da4b8b8ffb5d1a deleted file mode 100644 index 5e3cc0f631c9d..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2d/15de2635e7ce9cab7fa0bf1ce4bd04c4f38c96a1345d7ca2267990b9c8f6db49c5bd69b554b217fb9eaafc938a9ab8f1f7f1b3e75f2c8609da4b8b8ffb5d1a +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -/** - * Convert a data object to FormData - * @param {Object} obj - * @param {?Object} [formData] - * @returns {Object} - **/ - -function toFormData(obj, formData) { - // eslint-disable-next-line no-param-reassign - formData = formData || new FormData(); - - var stack = []; - - function convertValue(value) { - if (value === null) return ''; - - if (utils.isDate(value)) { - return value.toISOString(); - } - - if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { - return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); - } - - return value; - } - - function build(data, parentKey) { - if (utils.isPlainObject(data) || utils.isArray(data)) { - if (stack.indexOf(data) !== -1) { - throw Error('Circular reference detected in ' + parentKey); - } - - stack.push(data); - - utils.forEach(data, function each(value, key) { - if (utils.isUndefined(value)) return; - var fullKey = parentKey ? parentKey + '.' + key : key; - var arr; - - if (value && !parentKey && typeof value === 'object') { - if (utils.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); - } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) { - // eslint-disable-next-line func-names - arr.forEach(function(el) { - !utils.isUndefined(el) && formData.append(fullKey, convertValue(el)); - }); - return; - } - } - - build(value, fullKey); - }); - - stack.pop(); - } else { - formData.append(parentKey, convertValue(data)); - } - } - - build(obj); - - return formData; -} - -module.exports = toFormData; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2f/222c8630272cd36f1c1ae4de49c5005b27334c016c9ffef65c5289dbdc528443147e96e7bf63a30b09a8a2346370345c308a0d94dcd872b493ea8031f13df0 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2f/222c8630272cd36f1c1ae4de49c5005b27334c016c9ffef65c5289dbdc528443147e96e7bf63a30b09a8a2346370345c308a0d94dcd872b493ea8031f13df0 deleted file mode 100644 index 353df9a2fdb0f..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2f/222c8630272cd36f1c1ae4de49c5005b27334c016c9ffef65c5289dbdc528443147e96e7bf63a30b09a8a2346370345c308a0d94dcd872b493ea8031f13df0 +++ /dev/null @@ -1,5 +0,0 @@ -# Security Policy - -## Reporting a Vulnerability - -Please report security issues to jasonsaayman@gmail.com diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2f/b2e2b5548da581101eef16ebb201e0d03d54d28b0ceec2bd0f46b3b4a776358af6068323da64c348a4c553dca31cddb5bb4f45db6fd173e54aa5d71088bb61 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2f/b2e2b5548da581101eef16ebb201e0d03d54d28b0ceec2bd0f46b3b4a776358af6068323da64c348a4c553dca31cddb5bb4f45db6fd173e54aa5d71088bb61 deleted file mode 100644 index 114367e5fbf14..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/2f/b2e2b5548da581101eef16ebb201e0d03d54d28b0ceec2bd0f46b3b4a776358af6068323da64c348a4c553dca31cddb5bb4f45db6fd173e54aa5d71088bb61 +++ /dev/null @@ -1,29 +0,0 @@ -// API -module.exports = abort; - -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - - // reset leftover jobs - state.jobs = {}; -} - -/** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort - */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/32/f5bb5248a641236e320d9109b9e29fd97116c63f45cf46447558b6f30c3ac82080f50aabb40d2782c71ec915c24b43c477ab79daf4d753d8e9e0ee57a20f9c b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/32/f5bb5248a641236e320d9109b9e29fd97116c63f45cf46447558b6f30c3ac82080f50aabb40d2782c71ec915c24b43c477ab79daf4d753d8e9e0ee57a20f9c deleted file mode 100644 index 6665188255a73..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/32/f5bb5248a641236e320d9109b9e29fd97116c63f45cf46447558b6f30c3ac82080f50aabb40d2782c71ec915c24b43c477ab79daf4d753d8e9e0ee57a20f9c +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "module": "es2015", - "lib": ["dom", "es2015"], - "types": [], - "moduleResolution": "node", - "strict": true, - "noEmit": true, - "baseUrl": ".", - "paths": { - "axios": ["."] - } - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/33/4c331549d37b8f29d193b89109dc236865ef5ef4c37b2b0f200e5829a1c921e98875c9caac8857e1e64b9e6393b8f26d7774e321461eda9751d45085950898 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/33/4c331549d37b8f29d193b89109dc236865ef5ef4c37b2b0f200e5829a1c921e98875c9caac8857e1e64b9e6393b8f26d7774e321461eda9751d45085950898 deleted file mode 100644 index d6eb99219f3d9..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/33/4c331549d37b8f29d193b89109dc236865ef5ef4c37b2b0f200e5829a1c921e98875c9caac8857e1e64b9e6393b8f26d7774e321461eda9751d45085950898 +++ /dev/null @@ -1,29 +0,0 @@ -var abort = require('./abort.js') - , async = require('./async.js') - ; - -// API -module.exports = terminator; - -/** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination - */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - - // fast forward iteration index - this.index = this.size; - - // abort jobs - abort(this); - - // send back results we have so far - async(callback)(null, this.results); -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/34/b2491b80fddb57e830c0ad52a9b6da9efc75655490b117a1fd8bb464959d54ac2585ddd6726975fb60a4017d33af50f844c4311f1570c09c413559b4a0699a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/34/b2491b80fddb57e830c0ad52a9b6da9efc75655490b117a1fd8bb464959d54ac2585ddd6726975fb60a4017d33af50f844c4311f1570c09c413559b4a0699a deleted file mode 100644 index 125f097f35818..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/34/b2491b80fddb57e830c0ad52a9b6da9efc75655490b117a1fd8bb464959d54ac2585ddd6726975fb60a4017d33af50f844c4311f1570c09c413559b4a0699a +++ /dev/null @@ -1,208 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } - - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; - -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/35/1dec3644f5ed880983e8cf75c58f5b33693f0aa25da83228de3252dc0abc290c4e99fe06365695a807133638dfeb7295a4047cdafdb7d076daffced9801e35 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/35/1dec3644f5ed880983e8cf75c58f5b33693f0aa25da83228de3252dc0abc290c4e99fe06365695a807133638dfeb7295a4047cdafdb7d076daffced9801e35 deleted file mode 100644 index 3a79171099e87..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/35/1dec3644f5ed880983e8cf75c58f5b33693f0aa25da83228de3252dc0abc290c4e99fe06365695a807133638dfeb7295a4047cdafdb7d076daffced9801e35 +++ /dev/null @@ -1,160 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var buildURL = require('../helpers/buildURL'); -var InterceptorManager = require('./InterceptorManager'); -var dispatchRequest = require('./dispatchRequest'); -var mergeConfig = require('./mergeConfig'); -var buildFullPath = require('./buildFullPath'); -var validator = require('../helpers/validator'); - -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - var transitional = config.transitional; - - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); - } - - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - var promise; - - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; - - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); - - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; - } - - - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; - } - } - - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } - - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); - } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - var fullPath = buildFullPath(config.baseURL, config.url); - return buildURL(fullPath, config.params, config.paramsSerializer); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - headers: isForm ? { - 'Content-Type': 'multipart/form-data' - } : {}, - url: url, - data: data - })); - }; - } - - Axios.prototype[method] = generateHTTPMethod(); - - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); -}); - -module.exports = Axios; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/39/e8bd387e2d461d18a94dc6c615fbf5d33f9b0560bdb64969235a464f9bb21923d12e5c7c772061a92b7818eb1f06ad5ca6f3f88a087582f1aca8a6d8c8d6d1-index.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/39/e8bd387e2d461d18a94dc6c615fbf5d33f9b0560bdb64969235a464f9bb21923d12e5c7c772061a92b7818eb1f06ad5ca6f3f88a087582f1aca8a6d8c8d6d1-index.json deleted file mode 100644 index 2ef176e871030..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/39/e8bd387e2d461d18a94dc6c615fbf5d33f9b0560bdb64969235a464f9bb21923d12e5c7c772061a92b7818eb1f06ad5ca6f3f88a087582f1aca8a6d8c8d6d1-index.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"asynckit","version":"0.4.0","files":{"package.json":{"checkedAt":1673270429349,"integrity":"sha512-+/8AAxzcNQnb40Ym7dhsqGlwXikVyyrKvnqSwp4iJO/u6wXqghEUR5GV3bN1dXHBt8QBT4OYyN1vS/g3fNX+7A==","mode":420,"size":1611},"README.md":{"checkedAt":1673270429403,"integrity":"sha512-diV6T6LqULPPcjObWgHC/48Hp0T3RqxTh0xaFNPJc3P+1PCxKSVQuzcsZk2bsRKmU6quJkocYSYpUhE+hfO5Ng==","mode":420,"size":7640},"LICENSE":{"checkedAt":1673270429413,"integrity":"sha512-xQKriQ7786As4H5sWg57xfbR/kwHpoU+ptzaHupXNOTGz1o7Af8JM5OOwPkEZo/2zu9sMPBqAoKC177Q/16A/Q==","mode":420,"size":1078},"bench.js":{"checkedAt":1673270429413,"integrity":"sha512-GPfqFeTUkr9lyyjVzzz5kfgNCgCoLVOv3widRcbjq5Bk/5oS4STIsCAvtkCiALcrYhZsZ11uFVf8So21wacL5w==","mode":420,"size":1256},"index.js":{"checkedAt":1673270429448,"integrity":"sha512-QclIaT/3H+7uzDH7+0shAjGp2pFFQYk9z3ZSKjAaOranEJOT4Pe9uRaq6Be1c//VIdTzL0TBZkJ823E5Vltemg==","mode":420,"size":156},"serial.js":{"checkedAt":1673270429450,"integrity":"sha512-q7ZXgsUGYAzKuON3Ox2dS3i1xDkOX3x9hLj2h6lVSRqG2QlOVsskMTmqTK55IKja1rZETSbXyOfR1wPQBbr4gQ==","mode":420,"size":501},"parallel.js":{"checkedAt":1673270429489,"integrity":"sha512-fXJBw/VfXOfcDPmAJ5sdjnLSUGOom2QOH0zGPbkh3AQmfTNgKsmxyLlnk8o/XycX53SZ+pwFz8S1QxOxW0jwig==","mode":420,"size":1017},"lib/defer.js":{"checkedAt":1673270429490,"integrity":"sha512-ENIjAR7Gq4ImpN+l8aOkwUwnQDaNVFNgUzOiP99SqfpVFjopN5yTf1aCEnJbEd+gBkiNffTMTSW6R7YNa1Eagw==","mode":420,"size":441},"lib/abort.js":{"checkedAt":1673270429490,"integrity":"sha512-L7LitVSNpYEQHu8W67IB4NA9VNKLDO7CvQ9Gs7SndjWK9gaDI9pkw0ikxVPcoxzdtbtPRdtv0XPlSqXXEIi7YQ==","mode":420,"size":497},"serialOrdered.js":{"checkedAt":1673270429490,"integrity":"sha512-YxTAdSP5NqH3hgF6afSDNbs5L7ao2K1mJ9khW/OfuwmzPsQff4pTVUhqYrfIyRksUB0WWPZ4nCkVEk18MsUlaA==","mode":420,"size":1751},"stream.js":{"checkedAt":1673270429491,"integrity":"sha512-3ZKs7IbNRXMblLLBnDnmYIJxkyVcolXfdz6NgT8npffgla5farWJN4RCQ4oxZPo+yTBr5Jab8pmSvqGcb6W+mQ==","mode":420,"size":703},"lib/iterate.js":{"checkedAt":1673270429491,"integrity":"sha512-Gxqu5bdoy5SYafTHZwfrYzGs7wCGzhuKYY+yakzy5eOaoO1eArw9YxuAvSUbkQP8TyGb8KCkvxnTBFnkiwQdZQ==","mode":420,"size":1794},"lib/readable_asynckit.js":{"checkedAt":1673270429494,"integrity":"sha512-8R8Im1BPvZjd+xFSJE6LWkQln0cIuts0Bsn3K9MwpPRBIzji0c+9xIIo7zFoCx1zBq5+N8pR3F8HxdIajWQu6g==","mode":420,"size":1611},"lib/async.js":{"checkedAt":1673270429495,"integrity":"sha512-AJUw/HuTZ4O4wI+D78BltLSbbroQ7Ek6VyVSfZi4iaGe8OmK5zLTgSln2b0xs9HwYld7JglF2TY8NMXA/6SmHQ==","mode":420,"size":599},"lib/readable_serial.js":{"checkedAt":1673270429496,"integrity":"sha512-T6x5coG5A9AKEG0Csc+Ua1JwydVXwIo/FAKoRrkHawPvzbd4yG+XLcbqqaq1B41C8Q5v/8hSmDFYqSi1PIY5Vw==","mode":420,"size":655},"lib/streamify.js":{"checkedAt":1673270429528,"integrity":"sha512-+3Om8GvMEE3qVjx/K4poeSi2glTpvtrWGnJq8sewhY/osOdN3OqVqK1930L3daCbcnHVrBqRr79kvs8EwmNcBw==","mode":420,"size":2964},"lib/readable_serial_ordered.js":{"checkedAt":1673270429551,"integrity":"sha512-A94xA/FgFaA4T+XziucvzLwuVWmx2rSSnBcwsiC6QjzDKIy8+8LViDt0t1fu9nhh+Qy2TiepGiv2UPpyxCtw7w==","mode":420,"size":941},"lib/readable_parallel.js":{"checkedAt":1673270429558,"integrity":"sha512-qCBy/1PlbA8kEtcFXOUZN61oToxerKYbQJjIBO+v/MqF+leJGmY2fwf/U3w55Jxq0Bvf/FOWO7XOF+FNXVsmkQ==","mode":420,"size":673},"lib/terminator.js":{"checkedAt":1673270429559,"integrity":"sha512-M0wzFUnTe48p0ZO4kQncI2hl7170w3srDyAOWCmhySHpiHXJyqyIV+HmS55jk7jybXd04yFGHtqXUdRQhZUImA==","mode":420,"size":533},"lib/state.js":{"checkedAt":1673270429558,"integrity":"sha512-1O08duvQNzsPiffPI027hH0oLdEsdGuS4lLFQavcPTNJ4RraR4Uko79PryYk0LOoG9+Lbw2utaGz8mDFhEpS7g==","mode":420,"size":941}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3b/4df160cf4de4c6228c6c57bb0d77ecf1d198364927c55f6d648365f922c96336041c1cc673fb0729667092a43863417b7dd92a1681087aca6d4f4567394dbb b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3b/4df160cf4de4c6228c6c57bb0d77ecf1d198364927c55f6d648365f922c96336041c1cc673fb0729667092a43863417b7dd92a1681087aca6d4f4567394dbb deleted file mode 100644 index 298a1a24050b0..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3b/4df160cf4de4c6228c6c57bb0d77ecf1d198364927c55f6d648365f922c96336041c1cc673fb0729667092a43863417b7dd92a1681087aca6d4f4567394dbb +++ /dev/null @@ -1,358 +0,0 @@ -# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) - -A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. - -The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. - -[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface - -[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data) -[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data) -[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data) - -[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.0.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) -[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) - -## Install - -``` -npm install --save form-data -``` - -## Usage - -In this example we are constructing a form with 3 fields that contain a string, -a buffer and a file stream. - -``` javascript -var FormData = require('form-data'); -var fs = require('fs'); - -var form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); -``` - -Also you can use http-response stream: - -``` javascript -var FormData = require('form-data'); -var http = require('http'); - -var form = new FormData(); - -http.request('http://nodejs.org/images/logo.png', function(response) { - form.append('my_field', 'my value'); - form.append('my_buffer', new Buffer(10)); - form.append('my_logo', response); -}); -``` - -Or @mikeal's [request](https://github.com/request/request) stream: - -``` javascript -var FormData = require('form-data'); -var request = require('request'); - -var form = new FormData(); - -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_logo', request('http://nodejs.org/images/logo.png')); -``` - -In order to submit this form to a web application, call ```submit(url, [callback])``` method: - -``` javascript -form.submit('http://example.org/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); -}); - -``` - -For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. - -### Custom options - -You can provide custom options, such as `maxDataSize`: - -``` javascript -var FormData = require('form-data'); - -var form = new FormData({ maxDataSize: 20971520 }); -form.append('my_field', 'my value'); -form.append('my_buffer', /* something big */); -``` - -List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15) - -### Alternative submission methods - -You can use node's http client interface: - -``` javascript -var http = require('http'); - -var request = http.request({ - method: 'post', - host: 'example.org', - path: '/upload', - headers: form.getHeaders() -}); - -form.pipe(request); - -request.on('response', function(res) { - console.log(res.statusCode); -}); -``` - -Or if you would prefer the `'Content-Length'` header to be set for you: - -``` javascript -form.submit('example.org/upload', function(err, res) { - console.log(res.statusCode); -}); -``` - -To use custom headers and pre-known length in parts: - -``` javascript -var CRLF = '\r\n'; -var form = new FormData(); - -var options = { - header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, - knownLength: 1 -}; - -form.append('my_buffer', buffer, options); - -form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); -}); -``` - -Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: - -``` javascript -someModule.stream(function(err, stdout, stderr) { - if (err) throw err; - - var form = new FormData(); - - form.append('file', stdout, { - filename: 'unicycle.jpg', // ... or: - filepath: 'photos/toys/unicycle.jpg', - contentType: 'image/jpeg', - knownLength: 19806 - }); - - form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); - }); -}); -``` - -The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory). - -For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: - -``` javascript -form.submit({ - host: 'example.com', - path: '/probably.php?extra=params', - auth: 'username:password' -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: - -``` javascript -form.submit({ - host: 'example.com', - path: '/surelynot.php', - headers: {'x-test-header': 'test-header-value'} -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -### Methods - -- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-). -- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-) -- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary) -- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary) -- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer) -- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync) -- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-) -- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength) -- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-) -- [_String_ toString()](https://github.com/form-data/form-data#string-tostring) - -#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] ) -Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user. -```javascript -var form = new FormData(); -form.append( 'my_string', 'my value' ); -form.append( 'my_integer', 1 ); -form.append( 'my_boolean', true ); -form.append( 'my_buffer', new Buffer(10) ); -form.append( 'my_array_as_json', JSON.stringify( ['bird','cute'] ) ) -``` - -You may provide a string for options, or an object. -```javascript -// Set filename by providing a string for options -form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' ); - -// provide an object. -form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806} ); -``` - -#### _Headers_ getHeaders( [**Headers** _userHeaders_] ) -This method adds the correct `content-type` header to the provided array of `userHeaders`. - -#### _String_ getBoundary() -Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers -for example: -```javascript ---------------------------515890814546601021194782 -``` - -#### _Void_ setBoundary(String _boundary_) -Set the boundary string, overriding the default behavior described above. - -_Note: The boundary must be unique and may not appear in the data._ - -#### _Buffer_ getBuffer() -Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data. -```javascript -var form = new FormData(); -form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) ); -form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') ); - -axios.post( 'https://example.com/path/to/api', - form.getBuffer(), - form.getHeaders() - ) -``` -**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error. - -#### _Integer_ getLengthSync() -Same as `getLength` but synchronous. - -_Note: getLengthSync __doesn't__ calculate streams length._ - -#### _Integer_ getLength( **function** _callback_ ) -Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated -```javascript -this.getLength(function(err, length) { - if (err) { - this._error(err); - return; - } - - // add content length - request.setHeader('Content-Length', length); - - ... -}.bind(this)); -``` - -#### _Boolean_ hasKnownLength() -Checks if the length of added values is known. - -#### _Request_ submit( _params_, **function** _callback_ ) -Submit the form to a web application. -```javascript -var form = new FormData(); -form.append( 'my_string', 'Hello World' ); - -form.submit( 'http://example.com/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); -} ); -``` - -#### _String_ toString() -Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead. - -### Integration with other libraries - -#### Request - -Form submission using [request](https://github.com/request/request): - -```javascript -var formData = { - my_field: 'my_value', - my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), -}; - -request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) { - if (err) { - return console.error('upload failed:', err); - } - console.log('Upload successful! Server responded with:', body); -}); -``` - -For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). - -#### node-fetch - -You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): - -```javascript -var form = new FormData(); - -form.append('a', 1); - -fetch('http://example.com', { method: 'POST', body: form }) - .then(function(res) { - return res.json(); - }).then(function(json) { - console.log(json); - }); -``` - -#### axios - -In Node.js you can post a file using [axios](https://github.com/axios/axios): -```javascript -const form = new FormData(); -const stream = fs.createReadStream(PATH_TO_FILE); - -form.append('image', stream); - -// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders` -const formHeaders = form.getHeaders(); - -axios.post('http://example.com', form, { - headers: { - ...formHeaders, - }, -}) -.then(response => response) -.catch(error => error) -``` - -## Notes - -- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. -- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```). -- ```submit``` will not add `content-length` if form length is unknown or not calculable. -- Starting version `2.x` FormData has dropped support for `node@0.10.x`. -- Starting version `3.x` FormData has dropped support for `node@4.x`. - -## License - -Form-Data is released under the [MIT](License) license. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3c/8274f57e22eb58f658f0302713ebd1bf516d880a258faeb1309a9551a5867afb86016fb30a4bb2b50b6b6ec5e8d32c87ea4c36b33e16f8d0a428337e0947d0 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3c/8274f57e22eb58f658f0302713ebd1bf516d880a258faeb1309a9551a5867afb86016fb30a4bb2b50b6b6ec5e8d32c87ea4c36b33e16f8d0a428337e0947d0 deleted file mode 100644 index 68f1118959527..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3c/8274f57e22eb58f658f0302713ebd1bf516d880a258faeb1309a9551a5867afb86016fb30a4bb2b50b6b6ec5e8d32c87ea4c36b33e16f8d0a428337e0947d0 +++ /dev/null @@ -1,37 +0,0 @@ -# axios // adapters - -The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. - -## Example - -```js -var settle = require('./../core/settle'); - -module.exports = function myAdapter(config) { - // At this point: - // - config has been merged with defaults - // - request transformers have already run - // - request interceptors have already run - - // Make the request using config provided - // Upon response settle the Promise - - return new Promise(function(resolve, reject) { - - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // From here: - // - response transformers will run - // - response interceptors will run - }); -} -``` diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3d/c680b23c1ff593e5944fbf149f4a7579f1d3bb449cfd25d12fa8428e53cdadd5670508dd7a9c9204dd86736ebaebf73d10da39e6110d6f83dde2f9c4f6ebc8 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3d/c680b23c1ff593e5944fbf149f4a7579f1d3bb449cfd25d12fa8428e53cdadd5670508dd7a9c9204dd86736ebaebf73d10da39e6110d6f83dde2f9c4f6ebc8 deleted file mode 100644 index bbb9afa8cb709..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/3d/c680b23c1ff593e5944fbf149f4a7579f1d3bb449cfd25d12fa8428e53cdadd5670508dd7a9c9204dd86736ebaebf73d10da39e6110d6f83dde2f9c4f6ebc8 +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var AxiosError = require('./AxiosError'); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError( - 'Request failed with status code ' + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/40/2fc737e90380d6290bb8b7df07ef9f9c0a684cfc1f898c2e356e03ac34de6d4e95016ae70ecbe0c6c966b59969696ca36bb8c484bbc590d94fae7be1c4353a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/40/2fc737e90380d6290bb8b7df07ef9f9c0a684cfc1f898c2e356e03ac34de6d4e95016ae70ecbe0c6c966b59969696ca36bb8c484bbc590d94fae7be1c4353a deleted file mode 100644 index 4804b7ab411f5..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/40/2fc737e90380d6290bb8b7df07ef9f9c0a684cfc1f898c2e356e03ac34de6d4e95016ae70ecbe0c6c966b59969696ca36bb8c484bbc590d94fae7be1c4353a +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/41/aac98b0de04af17c382a0d673633d8330dfe834918b826ec9c10d60f8030c6eb721e84040295561ef62ac53e42cb6962c27e4229d2ea7e573a852c44004d2a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/41/aac98b0de04af17c382a0d673633d8330dfe834918b826ec9c10d60f8030c6eb721e84040295561ef62ac53e42cb6962c27e4229d2ea7e573a852c44004d2a deleted file mode 100644 index 52c806a817056..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/41/aac98b0de04af17c382a0d673633d8330dfe834918b826ec9c10d60f8030c6eb721e84040295561ef62ac53e42cb6962c27e4229d2ea7e573a852c44004d2a +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -function AxiosError(message, code, config, request, response) { - Error.call(this); - this.message = message; - this.name = 'AxiosError'; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - response && (this.response = response); -} - -utils.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code, - status: this.response && this.response.status ? this.response.status : null - }; - } -}); - -var prototype = AxiosError.prototype; -var descriptors = {}; - -[ - 'ERR_BAD_OPTION_VALUE', - 'ERR_BAD_OPTION', - 'ECONNABORTED', - 'ETIMEDOUT', - 'ERR_NETWORK', - 'ERR_FR_TOO_MANY_REDIRECTS', - 'ERR_DEPRECATED', - 'ERR_BAD_RESPONSE', - 'ERR_BAD_REQUEST', - 'ERR_CANCELED' -// eslint-disable-next-line func-names -].forEach(function(code) { - descriptors[code] = {value: code}; -}); - -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(prototype, 'isAxiosError', {value: true}); - -// eslint-disable-next-line func-names -AxiosError.from = function(error, code, config, request, response, customProps) { - var axiosError = Object.create(prototype); - - utils.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }); - - AxiosError.call(axiosError, error.message, code, config, request, response); - - axiosError.name = error.name; - - customProps && Object.assign(axiosError, customProps); - - return axiosError; -}; - -module.exports = AxiosError; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/41/c948693ff71feeeecc31fbfb4b210231a9da914541893dcf76522a301a3ab6a7109393e0f7bdb916aae817b573ffd521d4f32f44c166427cdb7139565b5e9a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/41/c948693ff71feeeecc31fbfb4b210231a9da914541893dcf76522a301a3ab6a7109393e0f7bdb916aae817b573ffd521d4f32f44c166427cdb7139565b5e9a deleted file mode 100644 index 455f9454ee648..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/41/c948693ff71feeeecc31fbfb4b210231a9da914541893dcf76522a301a3ab6a7109393e0f7bdb916aae817b573ffd521d4f32f44c166427cdb7139565b5e9a +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = -{ - parallel : require('./parallel.js'), - serial : require('./serial.js'), - serialOrdered : require('./serialOrdered.js') -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/45/8ad48844e1663fdf256baa642bb8619ea3ce963ba943d874ce3d181c0effdcd2a7901becf29749aa12f1a867fab4e826bd3e24c41ec93108713ef81e687a0d b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/45/8ad48844e1663fdf256baa642bb8619ea3ce963ba943d874ce3d181c0effdcd2a7901becf29749aa12f1a867fab4e826bd3e24c41ec93108713ef81e687a0d deleted file mode 100644 index 10f3f0297d230..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/45/8ad48844e1663fdf256baa642bb8619ea3ce963ba943d874ce3d181c0effdcd2a7901becf29749aa12f1a867fab4e826bd3e24c41ec93108713ef81e687a0d +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function parseProtocol(url) { - var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); - return match && match[1] || ''; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/4c/629a1a452331a5568cb1be6aa00eed31ae88ea8f4751c553a225dd4b3a0c32eff30ab6dbda44012fafb0946e25ad11a91e6971424771d26920b26844093ade b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/4c/629a1a452331a5568cb1be6aa00eed31ae88ea8f4751c553a225dd4b3a0c32eff30ab6dbda44012fafb0946e25ad11a91e6971424771d26920b26844093ade deleted file mode 100644 index eb9c42c457a3b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/4c/629a1a452331a5568cb1be6aa00eed31ae88ea8f4751c553a225dd4b3a0c32eff30ab6dbda44012fafb0946e25ad11a91e6971424771d26920b26844093ade +++ /dev/null @@ -1,8519 +0,0 @@ -{ - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/3gpp-ims+xml": { - "source": "iana", - "compressible": true - }, - "application/3gpphal+json": { - "source": "iana", - "compressible": true - }, - "application/3gpphalforms+json": { - "source": "iana", - "compressible": true - }, - "application/a2l": { - "source": "iana" - }, - "application/ace+cbor": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/activity+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamcontrol+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamparams+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": ["ez"] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": ["aw"] - }, - "application/at+jwt": { - "source": "iana" - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atom"] - }, - "application/atomcat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomcat"] - }, - "application/atomdeleted+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomdeleted"] - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomsvc"] - }, - "application/atsc-dwd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dwd"] - }, - "application/atsc-dynamic-event-message": { - "source": "iana" - }, - "application/atsc-held+xml": { - "source": "iana", - "compressible": true, - "extensions": ["held"] - }, - "application/atsc-rdt+json": { - "source": "iana", - "compressible": true - }, - "application/atsc-rsat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsat"] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana", - "compressible": true - }, - "application/bacnet-xdd+zip": { - "source": "iana", - "compressible": false - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/beep+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xcs"] - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/captive+json": { - "source": "iana", - "compressible": true - }, - "application/cbor": { - "source": "iana" - }, - "application/cbor-seq": { - "source": "iana" - }, - "application/cccex": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana", - "compressible": true - }, - "application/ccxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ccxml"] - }, - "application/cdfx+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdfx"] - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": ["cdmia"] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": ["cdmic"] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": ["cdmid"] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": ["cdmio"] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": ["cdmiq"] - }, - "application/cdni": { - "source": "iana" - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana", - "compressible": true - }, - "application/cellml+xml": { - "source": "iana", - "compressible": true - }, - "application/cfw": { - "source": "iana" - }, - "application/city+json": { - "source": "iana", - "compressible": true - }, - "application/clr": { - "source": "iana" - }, - "application/clue+xml": { - "source": "iana", - "compressible": true - }, - "application/clue_info+xml": { - "source": "iana", - "compressible": true - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana", - "compressible": true - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/coap-payload": { - "source": "iana" - }, - "application/commonground": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/cose": { - "source": "iana" - }, - "application/cose-key": { - "source": "iana" - }, - "application/cose-key-set": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cpl"] - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana", - "compressible": true - }, - "application/cstadata+xml": { - "source": "iana", - "compressible": true - }, - "application/csvm+json": { - "source": "iana", - "compressible": true - }, - "application/cu-seeme": { - "source": "apache", - "extensions": ["cu"] - }, - "application/cwt": { - "source": "iana" - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpd"] - }, - "application/dash-patch+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpp"] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "compressible": true, - "extensions": ["davmount"] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana", - "compressible": true - }, - "application/dicom": { - "source": "iana" - }, - "application/dicom+json": { - "source": "iana", - "compressible": true - }, - "application/dicom+xml": { - "source": "iana", - "compressible": true - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/dns+json": { - "source": "iana", - "compressible": true - }, - "application/dns-message": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dbk"] - }, - "application/dots+cbor": { - "source": "iana" - }, - "application/dskpp+xml": { - "source": "iana", - "compressible": true - }, - "application/dssc+der": { - "source": "iana", - "extensions": ["dssc"] - }, - "application/dssc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdssc"] - }, - "application/dvcs": { - "source": "iana" - }, - "application/ecmascript": { - "source": "iana", - "compressible": true, - "extensions": ["es","ecma"] - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/efi": { - "source": "iana" - }, - "application/elm+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/elm+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.cap+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/emergencycalldata.comment+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.control+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.deviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.ecall.msd": { - "source": "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.serviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.subscriberinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.veds+xml": { - "source": "iana", - "compressible": true - }, - "application/emma+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emma"] - }, - "application/emotionml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emotionml"] - }, - "application/encaprtp": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana", - "compressible": true - }, - "application/epub+zip": { - "source": "iana", - "compressible": false, - "extensions": ["epub"] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": ["exi"] - }, - "application/expect-ct-report+json": { - "source": "iana", - "compressible": true - }, - "application/express": { - "source": "iana", - "extensions": ["exp"] - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fdt"] - }, - "application/fhir+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fhir+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fido.trusted-apps+json": { - "compressible": true - }, - "application/fits": { - "source": "iana" - }, - "application/flexfec": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": ["pfr"] - }, - "application/font-woff": { - "source": "iana", - "compressible": false - }, - "application/framework-attributes+xml": { - "source": "iana", - "compressible": true - }, - "application/geo+json": { - "source": "iana", - "compressible": true, - "extensions": ["geojson"] - }, - "application/geo+json-seq": { - "source": "iana" - }, - "application/geopackage+sqlite3": { - "source": "iana" - }, - "application/geoxacml+xml": { - "source": "iana", - "compressible": true - }, - "application/gltf-buffer": { - "source": "iana" - }, - "application/gml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["gml"] - }, - "application/gpx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["gpx"] - }, - "application/gxf": { - "source": "apache", - "extensions": ["gxf"] - }, - "application/gzip": { - "source": "iana", - "compressible": false, - "extensions": ["gz"] - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana", - "compressible": true - }, - "application/hjson": { - "extensions": ["hjson"] - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": ["stk"] - }, - "application/ibe-key-request+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pkg-reply+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ink","inkml"] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": ["ipfix"] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana", - "compressible": true, - "extensions": ["its"] - }, - "application/java-archive": { - "source": "apache", - "compressible": false, - "extensions": ["jar","war","ear"] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": ["ser"] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": ["class"] - }, - "application/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js","mjs"] - }, - "application/jf2feed+json": { - "source": "iana", - "compressible": true - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/jscalendar+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["json","map"] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": ["json5"] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": ["jsonml"] - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana", - "compressible": true - }, - "application/kpml-response+xml": { - "source": "iana", - "compressible": true - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": ["jsonld"] - }, - "application/lgr+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lgr"] - }, - "application/link-format": { - "source": "iana" - }, - "application/load-control+xml": { - "source": "iana", - "compressible": true - }, - "application/lost+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lostxml"] - }, - "application/lostsync+xml": { - "source": "iana", - "compressible": true - }, - "application/lpf+zip": { - "source": "iana", - "compressible": false - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": ["hqx"] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": ["cpt"] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mads"] - }, - "application/manifest+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["webmanifest"] - }, - "application/marc": { - "source": "iana", - "extensions": ["mrc"] - }, - "application/marcxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mrcx"] - }, - "application/mathematica": { - "source": "iana", - "extensions": ["ma","nb","mb"] - }, - "application/mathml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mathml"] - }, - "application/mathml-content+xml": { - "source": "iana", - "compressible": true - }, - "application/mathml-presentation+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-deregister+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-envelope+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-protection-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-reception-report+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-schedule+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-user-service-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbox": { - "source": "iana", - "extensions": ["mbox"] - }, - "application/media-policy-dataset+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpf"] - }, - "application/media_control+xml": { - "source": "iana", - "compressible": true - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mscml"] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "compressible": true, - "extensions": ["metalink"] - }, - "application/metalink4+xml": { - "source": "iana", - "compressible": true, - "extensions": ["meta4"] - }, - "application/mets+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mets"] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mipc": { - "source": "iana" - }, - "application/missing-blocks+cbor-seq": { - "source": "iana" - }, - "application/mmt-aei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["maei"] - }, - "application/mmt-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musd"] - }, - "application/mods+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mods"] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": ["m21","mp21"] - }, - "application/mp4": { - "source": "iana", - "extensions": ["mp4s","m4p"] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana", - "compressible": true - }, - "application/mrb-publish+xml": { - "source": "iana", - "compressible": true - }, - "application/msc-ivr+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msc-mixer+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": ["doc","dot"] - }, - "application/mud+json": { - "source": "iana", - "compressible": true - }, - "application/multipart-core": { - "source": "iana" - }, - "application/mxf": { - "source": "iana", - "extensions": ["mxf"] - }, - "application/n-quads": { - "source": "iana", - "extensions": ["nq"] - }, - "application/n-triples": { - "source": "iana", - "extensions": ["nt"] - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-groupinfo": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana", - "compressible": true - }, - "application/node": { - "source": "iana", - "extensions": ["cjs"] - }, - "application/nss": { - "source": "iana" - }, - "application/oauth-authz-req+jwt": { - "source": "iana" - }, - "application/oblivious-dns-message": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": false, - "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] - }, - "application/oda": { - "source": "iana", - "extensions": ["oda"] - }, - "application/odm+xml": { - "source": "iana", - "compressible": true - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["opf"] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogx"] - }, - "application/omdoc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["omdoc"] - }, - "application/onenote": { - "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg"] - }, - "application/opc-nodeset+xml": { - "source": "iana", - "compressible": true - }, - "application/oscore": { - "source": "iana" - }, - "application/oxps": { - "source": "iana", - "extensions": ["oxps"] - }, - "application/p21": { - "source": "iana" - }, - "application/p21+zip": { - "source": "iana", - "compressible": false - }, - "application/p2p-overlay+xml": { - "source": "iana", - "compressible": true, - "extensions": ["relo"] - }, - "application/parityfec": { - "source": "iana" - }, - "application/passport": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xer"] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": ["pdf"] - }, - "application/pdx": { - "source": "iana" - }, - "application/pem-certificate-chain": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": ["pgp"] - }, - "application/pgp-keys": { - "source": "iana", - "extensions": ["asc"] - }, - "application/pgp-signature": { - "source": "iana", - "extensions": ["asc","sig"] - }, - "application/pics-rules": { - "source": "apache", - "extensions": ["prf"] - }, - "application/pidf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pidf-diff+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pkcs10": { - "source": "iana", - "extensions": ["p10"] - }, - "application/pkcs12": { - "source": "iana" - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": ["p7m","p7c"] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": ["p7s"] - }, - "application/pkcs8": { - "source": "iana", - "extensions": ["p8"] - }, - "application/pkcs8-encrypted": { - "source": "iana" - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": ["ac"] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": ["cer"] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": ["crl"] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": ["pkipath"] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": ["pki"] - }, - "application/pls+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pls"] - }, - "application/poc-settings+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": ["ai","eps","ps"] - }, - "application/ppsp-tracker+json": { - "source": "iana", - "compressible": true - }, - "application/problem+json": { - "source": "iana", - "compressible": true - }, - "application/problem+xml": { - "source": "iana", - "compressible": true - }, - "application/provenance+xml": { - "source": "iana", - "compressible": true, - "extensions": ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": ["cww"] - }, - "application/prs.cyn": { - "source": "iana", - "charset": "7-BIT" - }, - "application/prs.hpub+zip": { - "source": "iana", - "compressible": false - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana", - "compressible": true - }, - "application/pskc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pskcxml"] - }, - "application/pvd+json": { - "source": "iana", - "compressible": true - }, - "application/qsig": { - "source": "iana" - }, - "application/raml+yaml": { - "compressible": true, - "extensions": ["raml"] - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rdf","owl"] - }, - "application/reginfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rif"] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": ["rnc"] - }, - "application/remote-printing": { - "source": "iana" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resource-lists+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rl"] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rld"] - }, - "application/rfc+xml": { - "source": "iana", - "compressible": true - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana", - "compressible": true - }, - "application/rls-services+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rs"] - }, - "application/route-apd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rapd"] - }, - "application/route-s-tsid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sls"] - }, - "application/route-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rusd"] - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": ["gbr"] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": ["mft"] - }, - "application/rpki-publication": { - "source": "iana" - }, - "application/rpki-roa": { - "source": "iana", - "extensions": ["roa"] - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rsd"] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rss"] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana", - "compressible": true - }, - "application/samlmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/sarif+json": { - "source": "iana", - "compressible": true - }, - "application/sarif-external-properties+json": { - "source": "iana", - "compressible": true - }, - "application/sbe": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sbml"] - }, - "application/scaip+xml": { - "source": "iana", - "compressible": true - }, - "application/scim+json": { - "source": "iana", - "compressible": true - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": ["scq"] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": ["scs"] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": ["spq"] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": ["spp"] - }, - "application/sdp": { - "source": "iana", - "extensions": ["sdp"] - }, - "application/secevent+jwt": { - "source": "iana" - }, - "application/senml+cbor": { - "source": "iana" - }, - "application/senml+json": { - "source": "iana", - "compressible": true - }, - "application/senml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["senmlx"] - }, - "application/senml-etch+cbor": { - "source": "iana" - }, - "application/senml-etch+json": { - "source": "iana", - "compressible": true - }, - "application/senml-exi": { - "source": "iana" - }, - "application/sensml+cbor": { - "source": "iana" - }, - "application/sensml+json": { - "source": "iana", - "compressible": true - }, - "application/sensml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sensmlx"] - }, - "application/sensml-exi": { - "source": "iana" - }, - "application/sep+xml": { - "source": "iana", - "compressible": true - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": ["setpay"] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": ["setreg"] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["shf"] - }, - "application/sieve": { - "source": "iana", - "extensions": ["siv","sieve"] - }, - "application/simple-filter+xml": { - "source": "iana", - "compressible": true - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/sipc": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "iana" - }, - "application/smil+xml": { - "source": "iana", - "compressible": true, - "extensions": ["smi","smil"] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": ["rq"] - }, - "application/sparql-results+xml": { - "source": "iana", - "compressible": true, - "extensions": ["srx"] - }, - "application/spdx+json": { - "source": "iana", - "compressible": true - }, - "application/spirits-event+xml": { - "source": "iana", - "compressible": true - }, - "application/sql": { - "source": "iana" - }, - "application/srgs": { - "source": "iana", - "extensions": ["gram"] - }, - "application/srgs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["grxml"] - }, - "application/sru+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sru"] - }, - "application/ssdl+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ssdl"] - }, - "application/ssml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ssml"] - }, - "application/stix+json": { - "source": "iana", - "compressible": true - }, - "application/swid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["swidtag"] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/taxii+json": { - "source": "iana", - "compressible": true - }, - "application/td+json": { - "source": "iana", - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tei","teicorpus"] - }, - "application/tetra_isi": { - "source": "iana" - }, - "application/thraud+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tfi"] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": ["tsd"] - }, - "application/tlsrpt+gzip": { - "source": "iana" - }, - "application/tlsrpt+json": { - "source": "iana", - "compressible": true - }, - "application/tnauthlist": { - "source": "iana" - }, - "application/token-introspection+jwt": { - "source": "iana" - }, - "application/toml": { - "compressible": true, - "extensions": ["toml"] - }, - "application/trickle-ice-sdpfrag": { - "source": "iana" - }, - "application/trig": { - "source": "iana", - "extensions": ["trig"] - }, - "application/ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ttml"] - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/tzif": { - "source": "iana" - }, - "application/tzif-leap": { - "source": "iana" - }, - "application/ubjson": { - "compressible": false, - "extensions": ["ubj"] - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/urc-ressheet+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsheet"] - }, - "application/urc-targetdesc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["td"] - }, - "application/urc-uisocketdesc+xml": { - "source": "iana", - "compressible": true - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana", - "compressible": true - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - "source": "iana", - "compressible": true, - "extensions": ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-v2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.5gnas": { - "source": "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gmop+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gtpc": { - "source": "iana" - }, - "application/vnd.3gpp.interworking-data": { - "source": "iana" - }, - "application/vnd.3gpp.lpp": { - "source": "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-payload": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-signalling": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mid-call+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ngap": { - "source": "iana" - }, - "application/vnd.3gpp.pfcp": { - "source": "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - "source": "iana" - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp.sms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ussd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - "source": "iana" - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": ["aso"] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": ["imp"] - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": ["acu"] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": ["atc","acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "compressible": false, - "extensions": ["air"] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": ["fcdt"] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": ["fxp","fxpl"] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdp"] - }, - "application/vnd.adobe.xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - "source": "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - "source": "iana" - }, - "application/vnd.afpc.foca-charset": { - "source": "iana" - }, - "application/vnd.afpc.foca-codedfont": { - "source": "iana" - }, - "application/vnd.afpc.foca-codepage": { - "source": "iana" - }, - "application/vnd.afpc.modca": { - "source": "iana" - }, - "application/vnd.afpc.modca-cmtable": { - "source": "iana" - }, - "application/vnd.afpc.modca-formdef": { - "source": "iana" - }, - "application/vnd.afpc.modca-mediummap": { - "source": "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - "source": "iana" - }, - "application/vnd.afpc.modca-overlay": { - "source": "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - "source": "iana" - }, - "application/vnd.age": { - "source": "iana", - "extensions": ["age"] - }, - "application/vnd.ah-barcode": { - "source": "iana" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": ["azs"] - }, - "application/vnd.amadeus+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - "source": "iana" - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": ["acc"] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.android.ota": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": ["apk"] - }, - "application/vnd.anki": { - "source": "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": ["fti"] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": ["atx"] - }, - "application/vnd.apache.arrow.file": { - "source": "iana" - }, - "application/vnd.apache.arrow.stream": { - "source": "iana" - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.aplextor.warrp+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apothekende.reservation+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpkg"] - }, - "application/vnd.apple.keynote": { - "source": "iana", - "extensions": ["key"] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": ["m3u8"] - }, - "application/vnd.apple.numbers": { - "source": "iana", - "extensions": ["numbers"] - }, - "application/vnd.apple.pages": { - "source": "iana", - "extensions": ["pages"] - }, - "application/vnd.apple.pkpass": { - "compressible": false, - "extensions": ["pkpass"] - }, - "application/vnd.arastra.swi": { - "source": "iana" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": ["swi"] - }, - "application/vnd.artisan+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": ["iota"] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": ["aep"] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avalon+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.avistar+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - "source": "iana" - }, - "application/vnd.banana-accounting": { - "source": "iana" - }, - "application/vnd.bbf.usp.error": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bint.med-content": { - "source": "iana" - }, - "application/vnd.biopax.rdf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.blink-idb-value-wrapper": { - "source": "iana" - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": ["bmi"] - }, - "application/vnd.bpf": { - "source": "iana" - }, - "application/vnd.bpf3": { - "source": "iana" - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": ["rep"] - }, - "application/vnd.byu.uapi+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.capasystems-pg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdxml"] - }, - "application/vnd.chess-pgn": { - "source": "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": ["mmd"] - }, - "application/vnd.ciedi": { - "source": "iana" - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana", - "compressible": true, - "extensions": ["csl"] - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": ["cla"] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": ["rp9"] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": ["c4g","c4d","c4f","c4p","c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": ["c11amz"] - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.comicbook+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.comicbook-rar": { - "source": "iana" - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": ["csp"] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": ["cmc"] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": ["clkp"] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.crypto-shade-file": { - "source": "iana" - }, - "application/vnd.cryptomator.encrypted": { - "source": "iana" - }, - "application/vnd.cryptomator.vault": { - "source": "iana" - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": ["pml"] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": ["ppd"] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": ["car"] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.cyclonedx+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cyclonedx+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.d3m-dataset": { - "source": "iana" - }, - "application/vnd.d3m-problem": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": ["dart"] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": ["rdz"] - }, - "application/vnd.datapackage+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dataresource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dbf": { - "source": "iana", - "extensions": ["dbf"] - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": ["uvf","uvvf","uvd","uvvd"] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uvt","uvvt"] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": ["uvx","uvvx"] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": ["uvz","uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": ["fe_launch"] - }, - "application/vnd.desmume.movie": { - "source": "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dna": { - "source": "iana", - "extensions": ["dna"] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": ["dpg"] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": ["dfac"] - }, - "application/vnd.drive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": ["kpxx"] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": ["svc"] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": ["geo"] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecip.rlp": { - "source": "iana" - }, - "application/vnd.eclipse.ditto+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": ["mag"] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.efi.img": { - "source": "iana" - }, - "application/vnd.efi.iso": { - "source": "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": ["nml"] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": ["esf"] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": ["msf"] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": ["qam"] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": ["slt"] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.espass-espass+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "compressible": true, - "extensions": ["es3","et3"] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.cug+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.sci+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eu.kasparian.car+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.evolv.ecig.profile": { - "source": "iana" - }, - "application/vnd.evolv.ecig.settings": { - "source": "iana" - }, - "application/vnd.evolv.ecig.theme": { - "source": "iana" - }, - "application/vnd.exstream-empower+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.exstream-package": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": ["ez2"] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": ["ez3"] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "iana", - "extensions": ["fdf"] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": ["mseed"] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": ["seed","dataless"] - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.ficlab.flb+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.filmit.zfc": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": ["gph"] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": ["fm","frame","maker","book"] - }, - "application/vnd.frogans.fnc": { - "source": "iana", - "extensions": ["fnc"] - }, - "application/vnd.frogans.ltf": { - "source": "iana", - "extensions": ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.futoin+cbor": { - "source": "iana" - }, - "application/vnd.futoin+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": ["txd"] - }, - "application/vnd.gentics.grd+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geo+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": ["ggb"] - }, - "application/vnd.geogebra.slides": { - "source": "iana" - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": ["ggt"] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": ["gex","gre"] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": ["gxt"] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": ["g2w"] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": ["g3w"] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": ["gmx"] - }, - "application/vnd.google-apps.document": { - "compressible": false, - "extensions": ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - "compressible": false, - "extensions": ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - "compressible": false, - "extensions": ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["kml"] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": ["gqf","gqs"] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": ["gac"] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": ["ghf"] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": ["gim"] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": ["grv"] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": ["gtm"] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": ["tpl"] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": ["vcg"] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "compressible": true, - "extensions": ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zmm"] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": ["hbci"] - }, - "application/vnd.hc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.hdt": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": ["les"] - }, - "application/vnd.hl7cda+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.hl7v2+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": ["hpgl"] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": ["hpid"] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": ["hps"] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": ["jlt"] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": ["pcl"] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": ["pclxl"] - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana", - "extensions": ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyper-item+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyperdrive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "iana" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": ["mpy"] - }, - "application/vnd.ibm.modcap": { - "source": "iana", - "extensions": ["afp","listafp","list3820"] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": ["irm"] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": ["sc"] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": ["icc","icm"] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.imagemeter.image+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": ["ivp"] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.informix-visionary": { - "source": "iana" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": ["igm"] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": ["xpw","xpx"] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": ["i2g"] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": ["qbo"] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["irp"] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": ["xpr"] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.jam": { - "source": "iana", - "extensions": ["jam"] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": ["rms"] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": ["jisp"] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": ["ktz","ktr"] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": ["karbon"] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": ["chrt"] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": ["kfo"] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": ["flw"] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": ["kon"] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": ["kpr","kpt"] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": ["ksp"] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": ["kwd","kwt"] - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": ["htke"] - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": ["kia"] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": ["kne","knp"] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": ["skp","skd","skt","skm"] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": ["sse"] - }, - "application/vnd.las": { - "source": "iana" - }, - "application/vnd.las.las+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.las.las+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lasxml"] - }, - "application/vnd.laszip": { - "source": "iana" - }, - "application/vnd.leap+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.liberty-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.loom": { - "source": "iana" - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": ["123"] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": ["apr"] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": ["pre"] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": ["nsf"] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": ["org"] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": ["scm"] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": ["lwp"] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - "source": "iana", - "extensions": ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxar.archive.3tz+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": ["mcd"] - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": ["mwf"] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": ["mfm"] - }, - "application/vnd.micro+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": ["flo"] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - "source": "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - "source": "iana" - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": ["daf"] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": ["dis"] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": ["mbk"] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": ["mqy"] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": ["msl"] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": ["plc"] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": ["txf"] - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": ["mpn"] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xul"] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": ["cil"] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": ["xltm"] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": ["eot"] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": ["chm"] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": ["ims"] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": ["thmx"] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-outlook": { - "compressible": false, - "extensions": ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": ["cat"] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": ["ppt","pps","pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-printschematicket+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": ["mpp","mpt"] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-windows.devicepairing": { - "source": "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": ["dotm"] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": ["wps","wks","wcm","wdb"] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": ["xps"] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": ["mseq"] - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": ["mus"] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": ["msty"] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nearst.inv+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nebumind.line": { - "source": "iana" - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": ["nlu"] - }, - "application/vnd.nimn": { - "source": "iana" - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": ["ntf","nitf"] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": ["nnd"] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": ["nns"] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": ["nnw"] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "iana", - "extensions": ["n-gage"] - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": ["rpss"] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": ["edm"] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": ["edx"] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": ["ext"] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - "source": "iana", - "extensions": ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": ["oth"] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.ocf+cbor": { - "source": "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": ["xo"] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+cbor": { - "source": "iana" - }, - "application/vnd.oma.lwm2m+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+tlv": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.omads-email+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-file+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-folder+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.onepager": { - "source": "iana" - }, - "application/vnd.onepagertamp": { - "source": "iana" - }, - "application/vnd.onepagertamx": { - "source": "iana" - }, - "application/vnd.onepagertat": { - "source": "iana" - }, - "application/vnd.onepagertatp": { - "source": "iana" - }, - "application/vnd.onepagertatx": { - "source": "iana" - }, - "application/vnd.openblox.game+xml": { - "source": "iana", - "compressible": true, - "extensions": ["obgx"] - }, - "application/vnd.openblox.game-binary": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osm"] - }, - "application/vnd.opentimestamps.ots": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "iana", - "extensions": ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "iana", - "extensions": ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "iana", - "extensions": ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": ["mgp"] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": ["dp"] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oxli.countgraph": { - "source": "iana" - }, - "application/vnd.pagerduty+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.palm": { - "source": "iana", - "extensions": ["pdb","pqa","oprc"] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "iana" - }, - "application/vnd.patentdive": { - "source": "iana" - }, - "application/vnd.patientecommsdoc": { - "source": "iana" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": ["paw"] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": ["str"] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": ["efif"] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": ["plf"] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": ["box"] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": ["mgz"] - }, - "application/vnd.psfs": { - "source": "iana" - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": ["qps"] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quarantainenet": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.rar": { - "source": "iana", - "extensions": ["rar"] - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": ["bed"] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.resilient.logic": { - "source": "iana" - }, - "application/vnd.restful+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": ["cryptonote"] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": ["cod"] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "compressible": true, - "extensions": ["link66"] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": ["st"] - }, - "application/vnd.sar": { - "source": "iana" - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": ["see"] - }, - "application/vnd.seis+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.sema": { - "source": "iana", - "extensions": ["sema"] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": ["semd"] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": ["semf"] - }, - "application/vnd.shade-save-file": { - "source": "iana" - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": ["itp"] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": ["iif"] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": ["ipk"] - }, - "application/vnd.shootproof+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shopkick+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shp": { - "source": "iana" - }, - "application/vnd.shx": { - "source": "iana" - }, - "application/vnd.sigrok.session": { - "source": "iana" - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": ["twd","twds"] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": ["mmf"] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": ["teacher"] - }, - "application/vnd.snesdev-page-table": { - "source": "iana" - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sdkm","sdkd"] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": ["dxp"] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": ["sfs"] - }, - "application/vnd.sqlite3": { - "source": "iana" - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": ["sdc"] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": ["sda"] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": ["sdd"] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": ["smf"] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": ["sdw","vor"] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": ["sgl"] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": ["sm"] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wadl"] - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": ["stc"] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": ["std"] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": ["sti"] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": ["sxm"] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": ["stw"] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": ["sus","susp"] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": ["svd"] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.sycle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.syft+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": ["sis","sisx"] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tableschema+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": ["tao"] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": ["pcap","cap","dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.tml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": ["tmo"] - }, - "application/vnd.tri.onesource": { - "source": "iana" - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": ["tpt"] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": ["mxs"] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": ["tra"] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": ["ufd","ufdl"] - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": ["utz"] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": ["umj"] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": ["unityweb"] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uoml"] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.uri-map": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": ["vcx"] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.vel+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.veritone.aion+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.veryant.thin": { - "source": "iana" - }, - "application/vnd.ves.encrypted": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": ["vsd","vst","vss","vsw"] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": ["vis"] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": ["vsf"] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["wbxml"] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": ["wmlsc"] - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": ["wtb"] - }, - "application/vnd.wfa.dpp": { - "source": "iana" - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": ["nbp"] - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": ["wpd"] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.wv.ssp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": ["xar"] - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": ["xfdl"] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": ["cmp"] - }, - "application/vnd.youtube.yt": { - "source": "iana" - }, - "application/vnd.zul": { - "source": "iana", - "extensions": ["zir","zirz"] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zaz"] - }, - "application/voicexml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["vxml"] - }, - "application/voucher-cms+json": { - "source": "iana", - "compressible": true - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/wasm": { - "source": "iana", - "compressible": true, - "extensions": ["wasm"] - }, - "application/watcherinfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wif"] - }, - "application/webpush-options+json": { - "source": "iana", - "compressible": true - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": ["wgt"] - }, - "application/winhlp": { - "source": "apache", - "extensions": ["hlp"] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wsdl"] - }, - "application/wspolicy+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wspolicy"] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["7z"] - }, - "application/x-abiword": { - "source": "apache", - "extensions": ["abw"] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": ["ace"] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": ["dmg"] - }, - "application/x-arj": { - "compressible": false, - "extensions": ["arj"] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": ["aab","x32","u32","vox"] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": ["aam"] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": ["aas"] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": ["bcpio"] - }, - "application/x-bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": ["torrent"] - }, - "application/x-blorb": { - "source": "apache", - "extensions": ["blb","blorb"] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": ["bz"] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": ["bz2","boz"] - }, - "application/x-cbr": { - "source": "apache", - "extensions": ["cbr","cba","cbt","cbz","cb7"] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": ["vcd"] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": ["cfs"] - }, - "application/x-chat": { - "source": "apache", - "extensions": ["chat"] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": ["pgn"] - }, - "application/x-chrome-extension": { - "extensions": ["crx"] - }, - "application/x-cocoa": { - "source": "nginx", - "extensions": ["cco"] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-conference": { - "source": "apache", - "extensions": ["nsc"] - }, - "application/x-cpio": { - "source": "apache", - "extensions": ["cpio"] - }, - "application/x-csh": { - "source": "apache", - "extensions": ["csh"] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": ["deb","udeb"] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": ["dgc"] - }, - "application/x-director": { - "source": "apache", - "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] - }, - "application/x-doom": { - "source": "apache", - "extensions": ["wad"] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ncx"] - }, - "application/x-dtbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dtb"] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "compressible": true, - "extensions": ["res"] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": ["dvi"] - }, - "application/x-envoy": { - "source": "apache", - "extensions": ["evy"] - }, - "application/x-eva": { - "source": "apache", - "extensions": ["eva"] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": ["bdf"] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": ["gsf"] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": ["psf"] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": ["pcf"] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": ["snf"] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-type1": { - "source": "apache", - "extensions": ["pfa","pfb","pfm","afm"] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": ["arc"] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": ["spl"] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": ["gca"] - }, - "application/x-glulx": { - "source": "apache", - "extensions": ["ulx"] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": ["gnumeric"] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": ["gramps"] - }, - "application/x-gtar": { - "source": "apache", - "extensions": ["gtar"] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": ["hdf"] - }, - "application/x-httpd-php": { - "compressible": true, - "extensions": ["php"] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": ["install"] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - "extensions": ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - "extensions": ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - "extensions": ["pages"] - }, - "application/x-java-archive-diff": { - "source": "nginx", - "extensions": ["jardiff"] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": ["jnlp"] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-keepass2": { - "extensions": ["kdbx"] - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": ["latex"] - }, - "application/x-lua-bytecode": { - "extensions": ["luac"] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": ["lzh","lha"] - }, - "application/x-makeself": { - "source": "nginx", - "extensions": ["run"] - }, - "application/x-mie": { - "source": "apache", - "extensions": ["mie"] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": ["prc","mobi"] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": ["application"] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": ["lnk"] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": ["wmd"] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": ["wmz"] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": ["xbap"] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": ["mdb"] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": ["obd"] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": ["crd"] - }, - "application/x-msclip": { - "source": "apache", - "extensions": ["clp"] - }, - "application/x-msdos-program": { - "extensions": ["exe"] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": ["exe","dll","com","bat","msi"] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": ["mvb","m13","m14"] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": ["wmf","wmz","emf","emz"] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": ["mny"] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": ["pub"] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": ["scd"] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": ["trm"] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": ["wri"] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": ["nc","cdf"] - }, - "application/x-ns-proxy-autoconfig": { - "compressible": true, - "extensions": ["pac"] - }, - "application/x-nzb": { - "source": "apache", - "extensions": ["nzb"] - }, - "application/x-perl": { - "source": "nginx", - "extensions": ["pl","pm"] - }, - "application/x-pilot": { - "source": "nginx", - "extensions": ["prc","pdb"] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": ["p12","pfx"] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": ["p7b","spc"] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": ["p7r"] - }, - "application/x-pki-message": { - "source": "iana" - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["rar"] - }, - "application/x-redhat-package-manager": { - "source": "nginx", - "extensions": ["rpm"] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": ["ris"] - }, - "application/x-sea": { - "source": "nginx", - "extensions": ["sea"] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": ["sh"] - }, - "application/x-shar": { - "source": "apache", - "extensions": ["shar"] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": ["swf"] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": ["xap"] - }, - "application/x-sql": { - "source": "apache", - "extensions": ["sql"] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": ["sit"] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": ["sitx"] - }, - "application/x-subrip": { - "source": "apache", - "extensions": ["srt"] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": ["sv4cpio"] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": ["sv4crc"] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": ["t3"] - }, - "application/x-tads": { - "source": "apache", - "extensions": ["gam"] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": ["tar"] - }, - "application/x-tcl": { - "source": "apache", - "extensions": ["tcl","tk"] - }, - "application/x-tex": { - "source": "apache", - "extensions": ["tex"] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": ["tfm"] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": ["texinfo","texi"] - }, - "application/x-tgif": { - "source": "apache", - "extensions": ["obj"] - }, - "application/x-ustar": { - "source": "apache", - "extensions": ["ustar"] - }, - "application/x-virtualbox-hdd": { - "compressible": true, - "extensions": ["hdd"] - }, - "application/x-virtualbox-ova": { - "compressible": true, - "extensions": ["ova"] - }, - "application/x-virtualbox-ovf": { - "compressible": true, - "extensions": ["ovf"] - }, - "application/x-virtualbox-vbox": { - "compressible": true, - "extensions": ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - "compressible": false, - "extensions": ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - "compressible": true, - "extensions": ["vdi"] - }, - "application/x-virtualbox-vhd": { - "compressible": true, - "extensions": ["vhd"] - }, - "application/x-virtualbox-vmdk": { - "compressible": true, - "extensions": ["vmdk"] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": ["src"] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": ["webapp"] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "iana", - "extensions": ["der","crt","pem"] - }, - "application/x-x509-ca-ra-cert": { - "source": "iana" - }, - "application/x-x509-next-ca-cert": { - "source": "iana" - }, - "application/x-xfig": { - "source": "apache", - "extensions": ["fig"] - }, - "application/x-xliff+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xlf"] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": ["xpi"] - }, - "application/x-xz": { - "source": "apache", - "extensions": ["xz"] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana", - "compressible": true - }, - "application/xaml+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xaml"] - }, - "application/xcap-att+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xav"] - }, - "application/xcap-caps+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xca"] - }, - "application/xcap-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/xcap-el+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xel"] - }, - "application/xcap-error+xml": { - "source": "iana", - "compressible": true - }, - "application/xcap-ns+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xns"] - }, - "application/xcon-conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana", - "compressible": true - }, - "application/xenc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xenc"] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtml","xht"] - }, - "application/xhtml-voice+xml": { - "source": "apache", - "compressible": true - }, - "application/xliff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xlf"] - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml","xsl","xsd","rng"] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": ["dtd"] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/xmpp+xml": { - "source": "iana", - "compressible": true - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xop"] - }, - "application/xproc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xpl"] - }, - "application/xslt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xsl","xslt"] - }, - "application/xspf+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xspf"] - }, - "application/xv+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mxml","xhvml","xvml","xvm"] - }, - "application/yang": { - "source": "iana", - "extensions": ["yang"] - }, - "application/yang-data+json": { - "source": "iana", - "compressible": true - }, - "application/yang-data+xml": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+json": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/yin+xml": { - "source": "iana", - "compressible": true, - "extensions": ["yin"] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": ["zip"] - }, - "application/zlib": { - "source": "iana" - }, - "application/zstd": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana", - "compressible": false, - "extensions": ["3gpp"] - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/aac": { - "source": "iana" - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": ["adp"] - }, - "audio/amr": { - "source": "iana", - "extensions": ["amr"] - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": ["au","snd"] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/evs": { - "source": "iana" - }, - "audio/flexfec": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g711-0": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/melp": { - "source": "iana" - }, - "audio/melp1200": { - "source": "iana" - }, - "audio/melp2400": { - "source": "iana" - }, - "audio/melp600": { - "source": "iana" - }, - "audio/mhas": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": ["mid","midi","kar","rmi"] - }, - "audio/mobile-xmf": { - "source": "iana", - "extensions": ["mxmf"] - }, - "audio/mp3": { - "compressible": false, - "extensions": ["mp3"] - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["m4a","mp4a"] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["oga","ogg","spx","opus"] - }, - "audio/opus": { - "source": "iana" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": ["s3m"] - }, - "audio/scip": { - "source": "iana" - }, - "audio/silk": { - "source": "apache", - "extensions": ["sil"] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sofa": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tetra_acelp": { - "source": "iana" - }, - "audio/tetra_acelp_bb": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/tsvcis": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/usac": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": ["uva","uvva"] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": ["eol"] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": ["dra"] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": ["dts"] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": ["dtshd"] - }, - "audio/vnd.dts.uhd": { - "source": "iana" - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.presonus.multitrack": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": ["rip"] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/wav": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/wave": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": ["weba"] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": ["aac"] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": ["aif","aiff","aifc"] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": ["caf"] - }, - "audio/x-flac": { - "source": "apache", - "extensions": ["flac"] - }, - "audio/x-m4a": { - "source": "nginx", - "extensions": ["m4a"] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": ["mka"] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": ["m3u"] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": ["wax"] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": ["wma"] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": ["ram","ra"] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": ["rmp"] - }, - "audio/x-realaudio": { - "source": "nginx", - "extensions": ["ra"] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": ["wav"] - }, - "audio/xm": { - "source": "apache", - "extensions": ["xm"] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": ["cdx"] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": ["cif"] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": ["cmdf"] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": ["cml"] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": ["csml"] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": ["xyz"] - }, - "font/collection": { - "source": "iana", - "extensions": ["ttc"] - }, - "font/otf": { - "source": "iana", - "compressible": true, - "extensions": ["otf"] - }, - "font/sfnt": { - "source": "iana" - }, - "font/ttf": { - "source": "iana", - "compressible": true, - "extensions": ["ttf"] - }, - "font/woff": { - "source": "iana", - "extensions": ["woff"] - }, - "font/woff2": { - "source": "iana", - "extensions": ["woff2"] - }, - "image/aces": { - "source": "iana", - "extensions": ["exr"] - }, - "image/apng": { - "compressible": false, - "extensions": ["apng"] - }, - "image/avci": { - "source": "iana", - "extensions": ["avci"] - }, - "image/avcs": { - "source": "iana", - "extensions": ["avcs"] - }, - "image/avif": { - "source": "iana", - "compressible": false, - "extensions": ["avif"] - }, - "image/bmp": { - "source": "iana", - "compressible": true, - "extensions": ["bmp"] - }, - "image/cgm": { - "source": "iana", - "extensions": ["cgm"] - }, - "image/dicom-rle": { - "source": "iana", - "extensions": ["drle"] - }, - "image/emf": { - "source": "iana", - "extensions": ["emf"] - }, - "image/fits": { - "source": "iana", - "extensions": ["fits"] - }, - "image/g3fax": { - "source": "iana", - "extensions": ["g3"] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": ["gif"] - }, - "image/heic": { - "source": "iana", - "extensions": ["heic"] - }, - "image/heic-sequence": { - "source": "iana", - "extensions": ["heics"] - }, - "image/heif": { - "source": "iana", - "extensions": ["heif"] - }, - "image/heif-sequence": { - "source": "iana", - "extensions": ["heifs"] - }, - "image/hej2k": { - "source": "iana", - "extensions": ["hej2"] - }, - "image/hsj2": { - "source": "iana", - "extensions": ["hsj2"] - }, - "image/ief": { - "source": "iana", - "extensions": ["ief"] - }, - "image/jls": { - "source": "iana", - "extensions": ["jls"] - }, - "image/jp2": { - "source": "iana", - "compressible": false, - "extensions": ["jp2","jpg2"] - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": ["jpeg","jpg","jpe"] - }, - "image/jph": { - "source": "iana", - "extensions": ["jph"] - }, - "image/jphc": { - "source": "iana", - "extensions": ["jhc"] - }, - "image/jpm": { - "source": "iana", - "compressible": false, - "extensions": ["jpm"] - }, - "image/jpx": { - "source": "iana", - "compressible": false, - "extensions": ["jpx","jpf"] - }, - "image/jxr": { - "source": "iana", - "extensions": ["jxr"] - }, - "image/jxra": { - "source": "iana", - "extensions": ["jxra"] - }, - "image/jxrs": { - "source": "iana", - "extensions": ["jxrs"] - }, - "image/jxs": { - "source": "iana", - "extensions": ["jxs"] - }, - "image/jxsc": { - "source": "iana", - "extensions": ["jxsc"] - }, - "image/jxsi": { - "source": "iana", - "extensions": ["jxsi"] - }, - "image/jxss": { - "source": "iana", - "extensions": ["jxss"] - }, - "image/ktx": { - "source": "iana", - "extensions": ["ktx"] - }, - "image/ktx2": { - "source": "iana", - "extensions": ["ktx2"] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": ["png"] - }, - "image/prs.btif": { - "source": "iana", - "extensions": ["btif"] - }, - "image/prs.pti": { - "source": "iana", - "extensions": ["pti"] - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": ["sgi"] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["svg","svgz"] - }, - "image/t38": { - "source": "iana", - "extensions": ["t38"] - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": ["tif","tiff"] - }, - "image/tiff-fx": { - "source": "iana", - "extensions": ["tfx"] - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana", - "extensions": ["azv"] - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": ["uvi","uvvi","uvg","uvvg"] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": ["djvu","djv"] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": ["dwg"] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": ["dxf"] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": ["fbs"] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": ["fpx"] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana", - "compressible": true, - "extensions": ["ico"] - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.mozilla.apng": { - "source": "iana" - }, - "image/vnd.ms-dds": { - "compressible": true, - "extensions": ["dds"] - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": ["mdi"] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": ["wdp"] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": ["npx"] - }, - "image/vnd.pco.b16": { - "source": "iana", - "extensions": ["b16"] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana", - "extensions": ["tap"] - }, - "image/vnd.valve.source.texture": { - "source": "iana", - "extensions": ["vtf"] - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": ["wbmp"] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": ["xif"] - }, - "image/vnd.zbrush.pcx": { - "source": "iana", - "extensions": ["pcx"] - }, - "image/webp": { - "source": "apache", - "extensions": ["webp"] - }, - "image/wmf": { - "source": "iana", - "extensions": ["wmf"] - }, - "image/x-3ds": { - "source": "apache", - "extensions": ["3ds"] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": ["ras"] - }, - "image/x-cmx": { - "source": "apache", - "extensions": ["cmx"] - }, - "image/x-freehand": { - "source": "apache", - "extensions": ["fh","fhc","fh4","fh5","fh7"] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": ["ico"] - }, - "image/x-jng": { - "source": "nginx", - "extensions": ["jng"] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": ["sid"] - }, - "image/x-ms-bmp": { - "source": "nginx", - "compressible": true, - "extensions": ["bmp"] - }, - "image/x-pcx": { - "source": "apache", - "extensions": ["pcx"] - }, - "image/x-pict": { - "source": "apache", - "extensions": ["pic","pct"] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": ["pnm"] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": ["pbm"] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": ["pgm"] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": ["ppm"] - }, - "image/x-rgb": { - "source": "apache", - "extensions": ["rgb"] - }, - "image/x-tga": { - "source": "apache", - "extensions": ["tga"] - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": ["xbm"] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": ["xpm"] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": ["xwd"] - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana", - "extensions": [ - "disposition-notification" - ] - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana", - "extensions": ["u8msg"] - }, - "message/global-delivery-status": { - "source": "iana", - "extensions": ["u8dsn"] - }, - "message/global-disposition-notification": { - "source": "iana", - "extensions": ["u8mdn"] - }, - "message/global-headers": { - "source": "iana", - "extensions": ["u8hdr"] - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/news": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": ["eml","mime"] - }, - "message/s-http": { - "source": "iana" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "iana" - }, - "message/vnd.wfa.wsc": { - "source": "iana", - "extensions": ["wsc"] - }, - "model/3mf": { - "source": "iana", - "extensions": ["3mf"] - }, - "model/e57": { - "source": "iana" - }, - "model/gltf+json": { - "source": "iana", - "compressible": true, - "extensions": ["gltf"] - }, - "model/gltf-binary": { - "source": "iana", - "compressible": true, - "extensions": ["glb"] - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": ["igs","iges"] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": ["msh","mesh","silo"] - }, - "model/mtl": { - "source": "iana", - "extensions": ["mtl"] - }, - "model/obj": { - "source": "iana", - "extensions": ["obj"] - }, - "model/step": { - "source": "iana" - }, - "model/step+xml": { - "source": "iana", - "compressible": true, - "extensions": ["stpx"] - }, - "model/step+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpz"] - }, - "model/step-xml+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpxz"] - }, - "model/stl": { - "source": "iana", - "extensions": ["stl"] - }, - "model/vnd.collada+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dae"] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": ["dwf"] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": ["gdl"] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": ["gtw"] - }, - "model/vnd.moml+xml": { - "source": "iana", - "compressible": true - }, - "model/vnd.mts": { - "source": "iana", - "extensions": ["mts"] - }, - "model/vnd.opengex": { - "source": "iana", - "extensions": ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana", - "extensions": ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana", - "extensions": ["x_t"] - }, - "model/vnd.pytha.pyox": { - "source": "iana" - }, - "model/vnd.rosette.annotated-data-model": { - "source": "iana" - }, - "model/vnd.sap.vds": { - "source": "iana", - "extensions": ["vds"] - }, - "model/vnd.usdz+zip": { - "source": "iana", - "compressible": false, - "extensions": ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana", - "extensions": ["bsp"] - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": ["vtu"] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": ["wrl","vrml"] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": ["x3db","x3dbz"] - }, - "model/x3d+fastinfoset": { - "source": "iana", - "extensions": ["x3db"] - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": ["x3dv","x3dvz"] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": ["x3d","x3dz"] - }, - "model/x3d-vrml": { - "source": "iana", - "extensions": ["x3dv"] - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana" - }, - "multipart/multilingual": { - "source": "iana" - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/vnd.bint.med-plus": { - "source": "iana" - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": ["appcache","manifest"] - }, - "text/calendar": { - "source": "iana", - "extensions": ["ics","ifb"] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": ["coffee","litcoffee"] - }, - "text/cql": { - "source": "iana" - }, - "text/cql-expression": { - "source": "iana" - }, - "text/cql-identifier": { - "source": "iana" - }, - "text/css": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["css"] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": ["csv"] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "iana" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/fhirpath": { - "source": "iana" - }, - "text/flexfec": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/gff3": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": ["html","htm","shtml"] - }, - "text/jade": { - "extensions": ["jade"] - }, - "text/javascript": { - "source": "iana", - "compressible": true - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": ["jsx"] - }, - "text/less": { - "compressible": true, - "extensions": ["less"] - }, - "text/markdown": { - "source": "iana", - "compressible": true, - "extensions": ["markdown","md"] - }, - "text/mathml": { - "source": "nginx", - "extensions": ["mml"] - }, - "text/mdx": { - "compressible": true, - "extensions": ["mdx"] - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["n3"] - }, - "text/parameters": { - "source": "iana", - "charset": "UTF-8" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": ["txt","text","conf","def","list","log","in","ini"] - }, - "text/provenance-notation": { - "source": "iana", - "charset": "UTF-8" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": ["dsc"] - }, - "text/prs.prop.logic": { - "source": "iana" - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": ["rtx"] - }, - "text/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": ["sgml","sgm"] - }, - "text/shaclc": { - "source": "iana" - }, - "text/shex": { - "source": "iana", - "extensions": ["shex"] - }, - "text/slim": { - "extensions": ["slim","slm"] - }, - "text/spdx": { - "source": "iana", - "extensions": ["spdx"] - }, - "text/strings": { - "source": "iana" - }, - "text/stylus": { - "extensions": ["stylus","styl"] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": ["tsv"] - }, - "text/troff": { - "source": "iana", - "extensions": ["t","tr","roff","man","me","ms"] - }, - "text/turtle": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["ttl"] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": ["uri","uris","urls"] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": ["vcard"] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.ascii-art": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": ["curl"] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": ["dcurl"] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": ["mcurl"] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": ["scurl"] - }, - "text/vnd.debian.copyright": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - "source": "iana", - "extensions": ["ged"] - }, - "text/vnd.ficlab.flt": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": ["fly"] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": ["flx"] - }, - "text/vnd.gml": { - "source": "iana" - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": ["gv"] - }, - "text/vnd.hans": { - "source": "iana" - }, - "text/vnd.hgl": { - "source": "iana" - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": ["3dml"] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": ["spot"] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.senx.warpscript": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "iana" - }, - "text/vnd.sosi": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["jad"] - }, - "text/vnd.trolltech.linguist": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": ["wml"] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": ["wmls"] - }, - "text/vtt": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["vtt"] - }, - "text/x-asm": { - "source": "apache", - "extensions": ["s","asm"] - }, - "text/x-c": { - "source": "apache", - "extensions": ["c","cc","cxx","cpp","h","hh","dic"] - }, - "text/x-component": { - "source": "nginx", - "extensions": ["htc"] - }, - "text/x-fortran": { - "source": "apache", - "extensions": ["f","for","f77","f90"] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": ["hbs"] - }, - "text/x-java-source": { - "source": "apache", - "extensions": ["java"] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": ["lua"] - }, - "text/x-markdown": { - "compressible": true, - "extensions": ["mkd"] - }, - "text/x-nfo": { - "source": "apache", - "extensions": ["nfo"] - }, - "text/x-opml": { - "source": "apache", - "extensions": ["opml"] - }, - "text/x-org": { - "compressible": true, - "extensions": ["org"] - }, - "text/x-pascal": { - "source": "apache", - "extensions": ["p","pas"] - }, - "text/x-processing": { - "compressible": true, - "extensions": ["pde"] - }, - "text/x-sass": { - "extensions": ["sass"] - }, - "text/x-scss": { - "extensions": ["scss"] - }, - "text/x-setext": { - "source": "apache", - "extensions": ["etx"] - }, - "text/x-sfv": { - "source": "apache", - "extensions": ["sfv"] - }, - "text/x-suse-ymp": { - "compressible": true, - "extensions": ["ymp"] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": ["uu"] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": ["vcs"] - }, - "text/x-vcard": { - "source": "apache", - "extensions": ["vcf"] - }, - "text/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml"] - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "compressible": true, - "extensions": ["yaml","yml"] - }, - "video/1d-interleaved-parityfec": { - "source": "iana" - }, - "video/3gpp": { - "source": "iana", - "extensions": ["3gp","3gpp"] - }, - "video/3gpp-tt": { - "source": "iana" - }, - "video/3gpp2": { - "source": "iana", - "extensions": ["3g2"] - }, - "video/av1": { - "source": "iana" - }, - "video/bmpeg": { - "source": "iana" - }, - "video/bt656": { - "source": "iana" - }, - "video/celb": { - "source": "iana" - }, - "video/dv": { - "source": "iana" - }, - "video/encaprtp": { - "source": "iana" - }, - "video/ffv1": { - "source": "iana" - }, - "video/flexfec": { - "source": "iana" - }, - "video/h261": { - "source": "iana", - "extensions": ["h261"] - }, - "video/h263": { - "source": "iana", - "extensions": ["h263"] - }, - "video/h263-1998": { - "source": "iana" - }, - "video/h263-2000": { - "source": "iana" - }, - "video/h264": { - "source": "iana", - "extensions": ["h264"] - }, - "video/h264-rcdo": { - "source": "iana" - }, - "video/h264-svc": { - "source": "iana" - }, - "video/h265": { - "source": "iana" - }, - "video/iso.segment": { - "source": "iana", - "extensions": ["m4s"] - }, - "video/jpeg": { - "source": "iana", - "extensions": ["jpgv"] - }, - "video/jpeg2000": { - "source": "iana" - }, - "video/jpm": { - "source": "apache", - "extensions": ["jpm","jpgm"] - }, - "video/jxsv": { - "source": "iana" - }, - "video/mj2": { - "source": "iana", - "extensions": ["mj2","mjp2"] - }, - "video/mp1s": { - "source": "iana" - }, - "video/mp2p": { - "source": "iana" - }, - "video/mp2t": { - "source": "iana", - "extensions": ["ts"] - }, - "video/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["mp4","mp4v","mpg4"] - }, - "video/mp4v-es": { - "source": "iana" - }, - "video/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpeg","mpg","mpe","m1v","m2v"] - }, - "video/mpeg4-generic": { - "source": "iana" - }, - "video/mpv": { - "source": "iana" - }, - "video/nv": { - "source": "iana" - }, - "video/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogv"] - }, - "video/parityfec": { - "source": "iana" - }, - "video/pointer": { - "source": "iana" - }, - "video/quicktime": { - "source": "iana", - "compressible": false, - "extensions": ["qt","mov"] - }, - "video/raptorfec": { - "source": "iana" - }, - "video/raw": { - "source": "iana" - }, - "video/rtp-enc-aescm128": { - "source": "iana" - }, - "video/rtploopback": { - "source": "iana" - }, - "video/rtx": { - "source": "iana" - }, - "video/scip": { - "source": "iana" - }, - "video/smpte291": { - "source": "iana" - }, - "video/smpte292m": { - "source": "iana" - }, - "video/ulpfec": { - "source": "iana" - }, - "video/vc1": { - "source": "iana" - }, - "video/vc2": { - "source": "iana" - }, - "video/vnd.cctv": { - "source": "iana" - }, - "video/vnd.dece.hd": { - "source": "iana", - "extensions": ["uvh","uvvh"] - }, - "video/vnd.dece.mobile": { - "source": "iana", - "extensions": ["uvm","uvvm"] - }, - "video/vnd.dece.mp4": { - "source": "iana" - }, - "video/vnd.dece.pd": { - "source": "iana", - "extensions": ["uvp","uvvp"] - }, - "video/vnd.dece.sd": { - "source": "iana", - "extensions": ["uvs","uvvs"] - }, - "video/vnd.dece.video": { - "source": "iana", - "extensions": ["uvv","uvvv"] - }, - "video/vnd.directv.mpeg": { - "source": "iana" - }, - "video/vnd.directv.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dvb.file": { - "source": "iana", - "extensions": ["dvb"] - }, - "video/vnd.fvt": { - "source": "iana", - "extensions": ["fvt"] - }, - "video/vnd.hns.video": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "iana" - }, - "video/vnd.motorola.video": { - "source": "iana" - }, - "video/vnd.motorola.videop": { - "source": "iana" - }, - "video/vnd.mpegurl": { - "source": "iana", - "extensions": ["mxu","m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "iana", - "extensions": ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "iana" - }, - "video/vnd.nokia.mp4vr": { - "source": "iana" - }, - "video/vnd.nokia.videovoip": { - "source": "iana" - }, - "video/vnd.objectvideo": { - "source": "iana" - }, - "video/vnd.radgamettools.bink": { - "source": "iana" - }, - "video/vnd.radgamettools.smacker": { - "source": "iana" - }, - "video/vnd.sealed.mpeg1": { - "source": "iana" - }, - "video/vnd.sealed.mpeg4": { - "source": "iana" - }, - "video/vnd.sealed.swf": { - "source": "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "iana" - }, - "video/vnd.uvvu.mp4": { - "source": "iana", - "extensions": ["uvu","uvvu"] - }, - "video/vnd.vivo": { - "source": "iana", - "extensions": ["viv"] - }, - "video/vnd.youtube.yt": { - "source": "iana" - }, - "video/vp8": { - "source": "iana" - }, - "video/vp9": { - "source": "iana" - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": ["webm"] - }, - "video/x-f4v": { - "source": "apache", - "extensions": ["f4v"] - }, - "video/x-fli": { - "source": "apache", - "extensions": ["fli"] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": ["flv"] - }, - "video/x-m4v": { - "source": "apache", - "extensions": ["m4v"] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": ["mkv","mk3d","mks"] - }, - "video/x-mng": { - "source": "apache", - "extensions": ["mng"] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": ["asf","asx"] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": ["vob"] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": ["wm"] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": ["wmv"] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": ["wmx"] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": ["wvx"] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": ["avi"] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": ["movie"] - }, - "video/x-smv": { - "source": "apache", - "extensions": ["smv"] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": ["ice"] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/4f/ac797281b903d00a106d02b1cf946b5270c9d557c08a3f1402a846b9076b03efcdb778c86f972dc6eaa9aab5078d42f10e6fffc852983158a928b53c863957 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/4f/ac797281b903d00a106d02b1cf946b5270c9d557c08a3f1402a846b9076b03efcdb778c86f972dc6eaa9aab5078d42f10e6fffc852983158a928b53c863957 deleted file mode 100644 index 78226982041ce..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/4f/ac797281b903d00a106d02b1cf946b5270c9d557c08a3f1402a846b9076b03efcdb778c86f972dc6eaa9aab5078d42f10e6fffc852983158a928b53c863957 +++ /dev/null @@ -1,25 +0,0 @@ -var serial = require('../serial.js'); - -// API -module.exports = ReadableSerial; - -/** - * Streaming wrapper to `asynckit.serial` - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {stream.Readable#} - */ -function ReadableSerial(list, iterator, callback) -{ - if (!(this instanceof ReadableSerial)) - { - return new ReadableSerial(list, iterator, callback); - } - - // turn on object mode - ReadableSerial.super_.call(this, {objectMode: true}); - - this._start(serial, list, iterator, callback); -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/51/264c2df72bcd5e4b558d1e02630a6251760d15156e4b3619fb0d03b3b17bcf7f9a60acac43a7ad128d6b7dc5d1753f26a228facb75c41bc62e9124d7e64ba5 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/51/264c2df72bcd5e4b558d1e02630a6251760d15156e4b3619fb0d03b3b17bcf7f9a60acac43a7ad128d6b7dc5d1753f26a228facb75c41bc62e9124d7e64ba5 deleted file mode 100644 index 91998186c384e..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/51/264c2df72bcd5e4b558d1e02630a6251760d15156e4b3619fb0d03b3b17bcf7f9a60acac43a7ad128d6b7dc5d1753f26a228facb75c41bc62e9124d7e64ba5 +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -var utils = require('../utils'); -var normalizeHeaderName = require('../helpers/normalizeHeaderName'); -var AxiosError = require('../core/AxiosError'); -var transitionalDefaults = require('./transitional'); -var toFormData = require('../helpers/toFormData'); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = require('../adapters/xhr'); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = require('../adapters/http'); - } - return adapter; -} - -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -var defaults = { - - transitional: transitionalDefaults, - - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - - var isObjectPayload = utils.isObject(data); - var contentType = headers && headers['Content-Type']; - - var isFileList; - - if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) { - var _FormData = this.env && this.env.FormData; - return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData()); - } else if (isObjectPayload || contentType === 'application/json') { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); - } - - return data; - }], - - transformResponse: [function transformResponse(data) { - var transitional = this.transitional || defaults.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; - - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } - - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - env: { - FormData: require('./env/FormData') - }, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - - headers: { - common: { - 'Accept': 'application/json, text/plain, */*' - } - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/55/02c6df7a34e0a690f2e622dad54d6ddad6a75416c4d35e6be9e6201e0454cdbcbf48663f5ef3eda1b5fb002437356ae0a7974eadf6db5c9ee6a4c93fdd49c0-index.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/55/02c6df7a34e0a690f2e622dad54d6ddad6a75416c4d35e6be9e6201e0454cdbcbf48663f5ef3eda1b5fb002437356ae0a7974eadf6db5c9ee6a4c93fdd49c0-index.json deleted file mode 100644 index ffb336c599493..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/55/02c6df7a34e0a690f2e622dad54d6ddad6a75416c4d35e6be9e6201e0454cdbcbf48663f5ef3eda1b5fb002437356ae0a7974eadf6db5c9ee6a4c93fdd49c0-index.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"follow-redirects","version":"1.15.2","files":{"index.js":{"checkedAt":1673270429154,"integrity":"sha512-B3FK4MlylKsijwgbVd8Cn2YffrHeFDzwHLI8YqpLOdG3/u7zKKyUUL3gKnB+bkMQp45Zqt/PwRJWQoXFwp5G9A==","mode":420,"size":18980},"package.json":{"checkedAt":1673270429184,"integrity":"sha512-ZQSfXJAxbcp/MD7B+h71pxhaTVXk9fvIeTjt4kIolO5/EDjy6hu4xvBd7AYJWSIhqLP8Q06UjAnpCzqbqtNswQ==","mode":420,"size":1325},"debug.js":{"checkedAt":1673270429208,"integrity":"sha512-h4sqFYyv9f8LRkIG89GHbKovkdmSTtyZRbUKFkkg0h9BTdIDApCieb+gGewD5Jroxy7kKsLfQht6yDqNq5IpJQ==","mode":420,"size":315},"https.js":{"checkedAt":1673270429212,"integrity":"sha512-bIGBh3hac+BzxKLEgsrPT6u2V3ouUrnASfa3bjDuaqIO6SHcsGUuiRRa90FZ2UhxUHyhGlfNPvG9kZunpoENvw==","mode":420,"size":38},"LICENSE":{"checkedAt":1673270429228,"integrity":"sha512-4iWXAfXXCQHq0OrxtrdgbEZrFnFp5X0kPDhlkAVwOTqsxyOuCrlii+1Tgtx2/9gg4z35sY6p0qbMCXDdqDB90Q==","mode":420,"size":1136},"http.js":{"checkedAt":1673270429231,"integrity":"sha512-c9AAEjRJZlypuZ/g4Iwd9WgLLB7CsvN1PWWGDAZgfHYhL47PwlMyYicsk3JZ2IDEa6Kd5/ku8CoLZUqcxkj/Mw==","mode":420,"size":37},"README.md":{"checkedAt":1673270429269,"integrity":"sha512-fFnjGkPR8ZJxdyu+IQFMJ3oHi6NzIASyymhpPk+eYGY970G0xayONgVsdlh9OR3fOiK+LikFMUPjaxUEZNJcXw==","mode":420,"size":6456}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/56/88dd35e23895763f76a12f27aaff39a46046b1739d01b0cd47e3badf4d41ff2b50bf1449c43d1cef6afa879f335fe349fd19d511dfb142d0eabf29ae5f5e64 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/56/88dd35e23895763f76a12f27aaff39a46046b1739d01b0cd47e3badf4d41ff2b50bf1449c43d1cef6afa879f335fe349fd19d511dfb142d0eabf29ae5f5e64 deleted file mode 100644 index 8095b90e10b43..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/56/88dd35e23895763f76a12f27aaff39a46046b1739d01b0cd47e3badf4d41ff2b50bf1449c43d1cef6afa879f335fe349fd19d511dfb142d0eabf29ae5f5e64 +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var VERSION = require('../env/data').version; -var AxiosError = require('../core/AxiosError'); - -var validators = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -var deprecatedWarnings = {}; - -/** - * Transitional option validator - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); - } - - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new AxiosError( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError.ERR_DEPRECATED - ); - } - - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); - } - } -} - -module.exports = { - assertOptions: assertOptions, - validators: validators -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/56/b07617b9b13fefa23f62f970adbb5515f1bb2388582de729ae89165af3a82478b7d03950afa7126748d754bfcfbda497eecba30a6d0f3f4074812fb71d3862 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/56/b07617b9b13fefa23f62f970adbb5515f1bb2388582de729ae89165af3a82478b7d03950afa7126748d754bfcfbda497eecba30a6d0f3f4074812fb71d3862 deleted file mode 100644 index b4ff85a33b6eb..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/56/b07617b9b13fefa23f62f970adbb5515f1bb2388582de729ae89165af3a82478b7d03950afa7126748d754bfcfbda497eecba30a6d0f3f4074812fb71d3862 +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/57/0f810f55e637828ffbaa63541388bc15b73bf35a73c73f25d77bfb0e55b30f89d036e904130b9bdd5b20c816b3a9d79e49500678fcfdea0eb9be73e070803d b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/57/0f810f55e637828ffbaa63541388bc15b73bf35a73c73f25d77bfb0e55b30f89d036e904130b9bdd5b20c816b3a9d79e49500678fcfdea0eb9be73e070803d deleted file mode 100644 index 4ae34193a1edf..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/57/0f810f55e637828ffbaa63541388bc15b73bf35a73c73f25d77bfb0e55b30f89d036e904130b9bdd5b20c816b3a9d79e49500678fcfdea0eb9be73e070803d +++ /dev/null @@ -1,7 +0,0 @@ -# axios // helpers - -The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - -- Browser polyfills -- Managing cookies -- Parsing HTTP headers diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/59/800893257d77a8313baca5280c98ce674d6305fcb3080457ea5c18acd74da237967bea96f173ba8f09dd8fa9eba75ef92d1134ab004799e862dc09a1f0fd69 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/59/800893257d77a8313baca5280c98ce674d6305fcb3080457ea5c18acd74da237967bea96f173ba8f09dd8fa9eba75ef92d1134ab004799e862dc09a1f0fd69 deleted file mode 100644 index 82ee7dd7af6a7..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/59/800893257d77a8313baca5280c98ce674d6305fcb3080457ea5c18acd74da237967bea96f173ba8f09dd8fa9eba75ef92d1134ab004799e862dc09a1f0fd69 +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var defaults = require('../defaults'); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); - - return data; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/5c/d9760552d300c545dc5de18170a3a0fdbfb799c70d487408abb7884da09a2575a693c3ffe2c9716b28bf46488a68f1a28437e630d04bcc1166e6e849923274 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/5c/d9760552d300c545dc5de18170a3a0fdbfb799c70d487408abb7884da09a2575a693c3ffe2c9716b28bf46488a68f1a28437e630d04bcc1166e6e849923274 deleted file mode 100644 index 7436f64146e87..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/5c/d9760552d300c545dc5de18170a3a0fdbfb799c70d487408abb7884da09a2575a693c3ffe2c9716b28bf46488a68f1a28437e630d04bcc1166e6e849923274 +++ /dev/null @@ -1,507 +0,0 @@ -1.52.0 / 2022-02-21 -=================== - - * Add extensions from IANA for more `image/*` types - * Add extension `.asc` to `application/pgp-keys` - * Add extensions to various XML types - * Add new upstream MIME types - -1.51.0 / 2021-11-08 -=================== - - * Add new upstream MIME types - * Mark `image/vnd.microsoft.icon` as compressible - * Mark `image/vnd.ms-dds` as compressible - -1.50.0 / 2021-09-15 -=================== - - * Add deprecated iWorks mime types and extensions - * Add new upstream MIME types - -1.49.0 / 2021-07-26 -=================== - - * Add extension `.trig` to `application/trig` - * Add new upstream MIME types - -1.48.0 / 2021-05-30 -=================== - - * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - * Add new upstream MIME types - * Mark `text/yaml` as compressible - -1.47.0 / 2021-04-01 -=================== - - * Add new upstream MIME types - * Remove ambigious extensions from IANA for `application/*+xml` types - * Update primary extension to `.es` for `application/ecmascript` - -1.46.0 / 2021-02-13 -=================== - - * Add extension `.amr` to `audio/amr` - * Add extension `.m4s` to `video/iso.segment` - * Add extension `.opus` to `audio/ogg` - * Add new upstream MIME types - -1.45.0 / 2020-09-22 -=================== - - * Add `application/ubjson` with extension `.ubj` - * Add `image/avif` with extension `.avif` - * Add `image/ktx2` with extension `.ktx2` - * Add extension `.dbf` to `application/vnd.dbf` - * Add extension `.rar` to `application/vnd.rar` - * Add extension `.td` to `application/urc-targetdesc+xml` - * Add new upstream MIME types - * Fix extension of `application/vnd.apple.keynote` to be `.key` - -1.44.0 / 2020-04-22 -=================== - - * Add charsets from IANA - * Add extension `.cjs` to `application/node` - * Add new upstream MIME types - -1.43.0 / 2020-01-05 -=================== - - * Add `application/x-keepass2` with extension `.kdbx` - * Add extension `.mxmf` to `audio/mobile-xmf` - * Add extensions from IANA for `application/*+xml` types - * Add new upstream MIME types - -1.42.0 / 2019-09-25 -=================== - - * Add `image/vnd.ms-dds` with extension `.dds` - * Add new upstream MIME types - * Remove compressible from `multipart/mixed` - -1.41.0 / 2019-08-30 -=================== - - * Add new upstream MIME types - * Add `application/toml` with extension `.toml` - * Mark `font/ttf` as compressible - -1.40.0 / 2019-04-20 -=================== - - * Add extensions from IANA for `model/*` types - * Add `text/mdx` with extension `.mdx` - -1.39.0 / 2019-04-04 -=================== - - * Add extensions `.siv` and `.sieve` to `application/sieve` - * Add new upstream MIME types - -1.38.0 / 2019-02-04 -=================== - - * Add extension `.nq` to `application/n-quads` - * Add extension `.nt` to `application/n-triples` - * Add new upstream MIME types - * Mark `text/less` as compressible - -1.37.0 / 2018-10-19 -=================== - - * Add extensions to HEIC image types - * Add new upstream MIME types - -1.36.0 / 2018-08-20 -=================== - - * Add Apple file extensions from IANA - * Add extensions from IANA for `image/*` types - * Add new upstream MIME types - -1.35.0 / 2018-07-15 -=================== - - * Add extension `.owl` to `application/rdf+xml` - * Add new upstream MIME types - - Removes extension `.woff` from `application/font-woff` - -1.34.0 / 2018-06-03 -=================== - - * Add extension `.csl` to `application/vnd.citationstyles.style+xml` - * Add extension `.es` to `application/ecmascript` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/turtle` - * Mark all XML-derived types as compressible - -1.33.0 / 2018-02-15 -=================== - - * Add extensions from IANA for `message/*` types - * Add new upstream MIME types - * Fix some incorrect OOXML types - * Remove `application/font-woff2` - -1.32.0 / 2017-11-29 -=================== - - * Add new upstream MIME types - * Update `text/hjson` to registered `application/hjson` - * Add `text/shex` with extension `.shex` - -1.31.0 / 2017-10-25 -=================== - - * Add `application/raml+yaml` with extension `.raml` - * Add `application/wasm` with extension `.wasm` - * Add new `font` type from IANA - * Add new upstream font extensions - * Add new upstream MIME types - * Add extensions for JPEG-2000 images - -1.30.0 / 2017-08-27 -=================== - - * Add `application/vnd.ms-outlook` - * Add `application/x-arj` - * Add extension `.mjs` to `application/javascript` - * Add glTF types and extensions - * Add new upstream MIME types - * Add `text/x-org` - * Add VirtualBox MIME types - * Fix `source` records for `video/*` types that are IANA - * Update `font/opentype` to registered `font/otf` - -1.29.0 / 2017-07-10 -=================== - - * Add `application/fido.trusted-apps+json` - * Add extension `.wadl` to `application/vnd.sun.wadl+xml` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/css` - -1.28.0 / 2017-05-14 -=================== - - * Add new upstream MIME types - * Add extension `.gz` to `application/gzip` - * Update extensions `.md` and `.markdown` to be `text/markdown` - -1.27.0 / 2017-03-16 -=================== - - * Add new upstream MIME types - * Add `image/apng` with extension `.apng` - -1.26.0 / 2017-01-14 -=================== - - * Add new upstream MIME types - * Add extension `.geojson` to `application/geo+json` - -1.25.0 / 2016-11-11 -=================== - - * Add new upstream MIME types - -1.24.0 / 2016-09-18 -=================== - - * Add `audio/mp3` - * Add new upstream MIME types - -1.23.0 / 2016-05-01 -=================== - - * Add new upstream MIME types - * Add extension `.3gpp` to `audio/3gpp` - -1.22.0 / 2016-02-15 -=================== - - * Add `text/slim` - * Add extension `.rng` to `application/xml` - * Add new upstream MIME types - * Fix extension of `application/dash+xml` to be `.mpd` - * Update primary extension to `.m4a` for `audio/mp4` - -1.21.0 / 2016-01-06 -=================== - - * Add Google document types - * Add new upstream MIME types - -1.20.0 / 2015-11-10 -=================== - - * Add `text/x-suse-ymp` - * Add new upstream MIME types - -1.19.0 / 2015-09-17 -=================== - - * Add `application/vnd.apple.pkpass` - * Add new upstream MIME types - -1.18.0 / 2015-09-03 -=================== - - * Add new upstream MIME types - -1.17.0 / 2015-08-13 -=================== - - * Add `application/x-msdos-program` - * Add `audio/g711-0` - * Add `image/vnd.mozilla.apng` - * Add extension `.exe` to `application/x-msdos-program` - -1.16.0 / 2015-07-29 -=================== - - * Add `application/vnd.uri-map` - -1.15.0 / 2015-07-13 -=================== - - * Add `application/x-httpd-php` - -1.14.0 / 2015-06-25 -=================== - - * Add `application/scim+json` - * Add `application/vnd.3gpp.ussd+xml` - * Add `application/vnd.biopax.rdf+xml` - * Add `text/x-processing` - -1.13.0 / 2015-06-07 -=================== - - * Add nginx as a source - * Add `application/x-cocoa` - * Add `application/x-java-archive-diff` - * Add `application/x-makeself` - * Add `application/x-perl` - * Add `application/x-pilot` - * Add `application/x-redhat-package-manager` - * Add `application/x-sea` - * Add `audio/x-m4a` - * Add `audio/x-realaudio` - * Add `image/x-jng` - * Add `text/mathml` - -1.12.0 / 2015-06-05 -=================== - - * Add `application/bdoc` - * Add `application/vnd.hyperdrive+json` - * Add `application/x-bdoc` - * Add extension `.rtf` to `text/rtf` - -1.11.0 / 2015-05-31 -=================== - - * Add `audio/wav` - * Add `audio/wave` - * Add extension `.litcoffee` to `text/coffeescript` - * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` - * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` - -1.10.0 / 2015-05-19 -=================== - - * Add `application/vnd.balsamiq.bmpr` - * Add `application/vnd.microsoft.portable-executable` - * Add `application/x-ns-proxy-autoconfig` - -1.9.1 / 2015-04-19 -================== - - * Remove `.json` extension from `application/manifest+json` - - This is causing bugs downstream - -1.9.0 / 2015-04-19 -================== - - * Add `application/manifest+json` - * Add `application/vnd.micro+json` - * Add `image/vnd.zbrush.pcx` - * Add `image/x-ms-bmp` - -1.8.0 / 2015-03-13 -================== - - * Add `application/vnd.citationstyles.style+xml` - * Add `application/vnd.fastcopy-disk-image` - * Add `application/vnd.gov.sk.xmldatacontainer+xml` - * Add extension `.jsonld` to `application/ld+json` - -1.7.0 / 2015-02-08 -================== - - * Add `application/vnd.gerber` - * Add `application/vnd.msa-disk-image` - -1.6.1 / 2015-02-05 -================== - - * Community extensions ownership transferred from `node-mime` - -1.6.0 / 2015-01-29 -================== - - * Add `application/jose` - * Add `application/jose+json` - * Add `application/json-seq` - * Add `application/jwk+json` - * Add `application/jwk-set+json` - * Add `application/jwt` - * Add `application/rdap+json` - * Add `application/vnd.gov.sk.e-form+xml` - * Add `application/vnd.ims.imsccv1p3` - -1.5.0 / 2014-12-30 -================== - - * Add `application/vnd.oracle.resource+json` - * Fix various invalid MIME type entries - - `application/mbox+xml` - - `application/oscp-response` - - `application/vwg-multiplexed` - - `audio/g721` - -1.4.0 / 2014-12-21 -================== - - * Add `application/vnd.ims.imsccv1p2` - * Fix various invalid MIME type entries - - `application/vnd-acucobol` - - `application/vnd-curl` - - `application/vnd-dart` - - `application/vnd-dxr` - - `application/vnd-fdf` - - `application/vnd-mif` - - `application/vnd-sema` - - `application/vnd-wap-wmlc` - - `application/vnd.adobe.flash-movie` - - `application/vnd.dece-zip` - - `application/vnd.dvb_service` - - `application/vnd.micrografx-igx` - - `application/vnd.sealed-doc` - - `application/vnd.sealed-eml` - - `application/vnd.sealed-mht` - - `application/vnd.sealed-ppt` - - `application/vnd.sealed-tiff` - - `application/vnd.sealed-xls` - - `application/vnd.sealedmedia.softseal-html` - - `application/vnd.sealedmedia.softseal-pdf` - - `application/vnd.wap-slc` - - `application/vnd.wap-wbxml` - - `audio/vnd.sealedmedia.softseal-mpeg` - - `image/vnd-djvu` - - `image/vnd-svf` - - `image/vnd-wap-wbmp` - - `image/vnd.sealed-png` - - `image/vnd.sealedmedia.softseal-gif` - - `image/vnd.sealedmedia.softseal-jpg` - - `model/vnd-dwf` - - `model/vnd.parasolid.transmit-binary` - - `model/vnd.parasolid.transmit-text` - - `text/vnd-a` - - `text/vnd-curl` - - `text/vnd.wap-wml` - * Remove example template MIME types - - `application/example` - - `audio/example` - - `image/example` - - `message/example` - - `model/example` - - `multipart/example` - - `text/example` - - `video/example` - -1.3.1 / 2014-12-16 -================== - - * Fix missing extensions - - `application/json5` - - `text/hjson` - -1.3.0 / 2014-12-07 -================== - - * Add `application/a2l` - * Add `application/aml` - * Add `application/atfx` - * Add `application/atxml` - * Add `application/cdfx+xml` - * Add `application/dii` - * Add `application/json5` - * Add `application/lxf` - * Add `application/mf4` - * Add `application/vnd.apache.thrift.compact` - * Add `application/vnd.apache.thrift.json` - * Add `application/vnd.coffeescript` - * Add `application/vnd.enphase.envoy` - * Add `application/vnd.ims.imsccv1p1` - * Add `text/csv-schema` - * Add `text/hjson` - * Add `text/markdown` - * Add `text/yaml` - -1.2.0 / 2014-11-09 -================== - - * Add `application/cea` - * Add `application/dit` - * Add `application/vnd.gov.sk.e-form+zip` - * Add `application/vnd.tmd.mediaflex.api+xml` - * Type `application/epub+zip` is now IANA-registered - -1.1.2 / 2014-10-23 -================== - - * Rebuild database for `application/x-www-form-urlencoded` change - -1.1.1 / 2014-10-20 -================== - - * Mark `application/x-www-form-urlencoded` as compressible. - -1.1.0 / 2014-09-28 -================== - - * Add `application/font-woff2` - -1.0.3 / 2014-09-25 -================== - - * Fix engine requirement in package - -1.0.2 / 2014-09-25 -================== - - * Add `application/coap-group+json` - * Add `application/dcd` - * Add `application/vnd.apache.thrift.binary` - * Add `image/vnd.tencent.tap` - * Mark all JSON-derived types as compressible - * Update `text/vtt` data - -1.0.1 / 2014-08-30 -================== - - * Fix extension ordering - -1.0.0 / 2014-08-30 -================== - - * Add `application/atf` - * Add `application/merge-patch+json` - * Add `multipart/x-mixed-replace` - * Add `source: 'apache'` metadata - * Add `source: 'iana'` metadata - * Remove badly-assumed charset data diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/5f/35e548b3003509a6caab668fc3af1dbbf3b7b5a7fb0ad965dbd27a53d9252222410b103fc35c1a1049c78ff3e22c700dacb8e701aa6cabf42ddaaa0b539c18 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/5f/35e548b3003509a6caab668fc3af1dbbf3b7b5a7fb0ad965dbd27a53d9252222410b103fc35c1a1049c78ff3e22c700dacb8e701aa6cabf42ddaaa0b539c18 deleted file mode 100644 index 295e9e9bc5fb9..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/5f/35e548b3003509a6caab668fc3af1dbbf3b7b5a7fb0ad965dbd27a53d9252222410b103fc35c1a1049c78ff3e22c700dacb8e701aa6cabf42ddaaa0b539c18 +++ /dev/null @@ -1,62 +0,0 @@ -// Definitions by: Carlos Ballesteros Velasco -// Leon Yu -// BendingBender -// Maple Miao - -/// -import * as stream from 'stream'; -import * as http from 'http'; - -export = FormData; - -// Extracted because @types/node doesn't export interfaces. -interface ReadableOptions { - highWaterMark?: number; - encoding?: string; - objectMode?: boolean; - read?(this: stream.Readable, size: number): void; - destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean; -} - -interface Options extends ReadableOptions { - writable?: boolean; - readable?: boolean; - dataSize?: number; - maxDataSize?: number; - pauseStreams?: boolean; -} - -declare class FormData extends stream.Readable { - constructor(options?: Options); - append(key: string, value: any, options?: FormData.AppendOptions | string): void; - getHeaders(userHeaders?: FormData.Headers): FormData.Headers; - submit( - params: string | FormData.SubmitOptions, - callback?: (error: Error | null, response: http.IncomingMessage) => void - ): http.ClientRequest; - getBuffer(): Buffer; - setBoundary(boundary: string): void; - getBoundary(): string; - getLength(callback: (err: Error | null, length: number) => void): void; - getLengthSync(): number; - hasKnownLength(): boolean; -} - -declare namespace FormData { - interface Headers { - [key: string]: any; - } - - interface AppendOptions { - header?: string | Headers; - knownLength?: number; - filename?: string; - filepath?: string; - contentType?: string; - } - - interface SubmitOptions extends http.RequestOptions { - protocol?: 'https:' | 'http:'; - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/14c07523f936a1f786017a69f48335bb392fb6a8d8ad6627d9215bf39fbb09b33ec41f7f8a5355486a62b7c8c9192c501d1658f6789c2915124d7c32c52568 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/14c07523f936a1f786017a69f48335bb392fb6a8d8ad6627d9215bf39fbb09b33ec41f7f8a5355486a62b7c8c9192c501d1658f6789c2915124d7c32c52568 deleted file mode 100644 index 607eafea56cb0..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/14c07523f936a1f786017a69f48335bb392fb6a8d8ad6627d9215bf39fbb09b33ec41f7f8a5355486a62b7c8c9192c501d1658f6789c2915124d7c32c52568 +++ /dev/null @@ -1,75 +0,0 @@ -var iterate = require('./lib/iterate.js') - , initState = require('./lib/state.js') - , terminator = require('./lib/terminator.js') - ; - -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; - -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); - - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } - - state.index++; - - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } - - // done here - callback(null, state.results); - }); - - return terminator.bind(state, callback); -} - -/* - * -- Sort methods - */ - -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/27492c460862f31ac4a84a65438531d488785f08e2bc97fa3915055e3a908af812dc881d490efbe60950a899c82c8f057bbb1bb751cc6f9b8dc2e9293a1a4c b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/27492c460862f31ac4a84a65438531d488785f08e2bc97fa3915055e3a908af812dc881d490efbe60950a899c82c8f057bbb1bb751cc6f9b8dc2e9293a1a4c deleted file mode 100644 index b7ceb02567e45..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/27492c460862f31ac4a84a65438531d488785f08e2bc97fa3915055e3a908af812dc881d490efbe60950a899c82c8f057bbb1bb751cc6f9b8dc2e9293a1a4c +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var AxiosError = require('../core/AxiosError'); -var utils = require('../utils'); - -/** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function CanceledError(message) { - // eslint-disable-next-line no-eq-null,eqeqeq - AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED); - this.name = 'CanceledError'; -} - -utils.inherits(CanceledError, AxiosError, { - __CANCEL__: true -}); - -module.exports = CanceledError; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/8ae8ad13ab0c7610941217a4d46d73a5c121dc7b6387af198cf2334f01935d907b50958b59d8b868ceca8698c5ee65fa2bf27301e9f1f64ad81d577114d65a-exec b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/8ae8ad13ab0c7610941217a4d46d73a5c121dc7b6387af198cf2334f01935d907b50958b59d8b868ceca8698c5ee65fa2bf27301e9f1f64ad81d577114d65a-exec deleted file mode 100755 index 04a9aacf843bb..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/63/8ae8ad13ab0c7610941217a4d46d73a5c121dc7b6387af198cf2334f01935d907b50958b59d8b868ceca8698c5ee65fa2bf27301e9f1f64ad81d577114d65a-exec +++ /dev/null @@ -1,424 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var settle = require('./../core/settle'); -var buildFullPath = require('../core/buildFullPath'); -var buildURL = require('./../helpers/buildURL'); -var http = require('http'); -var https = require('https'); -var httpFollow = require('follow-redirects').http; -var httpsFollow = require('follow-redirects').https; -var url = require('url'); -var zlib = require('zlib'); -var VERSION = require('./../env/data').version; -var transitionalDefaults = require('../defaults/transitional'); -var AxiosError = require('../core/AxiosError'); -var CanceledError = require('../cancel/CanceledError'); - -var isHttps = /https:?/; - -var supportedProtocols = [ 'http:', 'https:', 'file:' ]; - -/** - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} proxy - * @param {string} location - */ -function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; - - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - // If a proxy is used, any redirects must also pass through the proxy - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); - }; -} - -/*eslint consistent-return:0*/ -module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); - } - - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); - } - } - var resolve = function resolve(value) { - done(); - resolvePromise(value); - }; - var rejected = false; - var reject = function reject(value) { - done(); - rejected = true; - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - var headerNames = {}; - - Object.keys(headers).forEach(function storeLowerName(name) { - headerNames[name.toLowerCase()] = name; - }); - - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - if ('user-agent' in headerNames) { - // User-Agent is specified; handle case where no UA header is desired - if (!headers[headerNames['user-agent']]) { - delete headers[headerNames['user-agent']]; - } - // Otherwise, use specified value - } else { - // Only set header if it hasn't been set in config - headers['User-Agent'] = 'axios/' + VERSION; - } - - // support for https://www.npmjs.com/package/form-data api - if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { - Object.assign(headers, data.getHeaders()); - } else if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(new AxiosError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - AxiosError.ERR_BAD_REQUEST, - config - )); - } - - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config - )); - } - - // Add Content-Length header if data exists - if (!headerNames['content-length']) { - headers['Content-Length'] = data.length; - } - } - - // HTTP basic authentication - var auth = undefined; - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - auth = username + ':' + password; - } - - // Parse url - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || supportedProtocols[0]; - - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( - 'Unsupported protocol ' + protocol, - AxiosError.ERR_BAD_REQUEST, - config - )); - } - - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(':'); - var urlUsername = urlAuth[0] || ''; - var urlPassword = urlAuth[1] || ''; - auth = urlUsername + ':' + urlPassword; - } - - if (auth && headerNames.authorization) { - delete headers[headerNames.authorization]; - } - - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - - try { - buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); - } catch (err) { - var customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - reject(customErr); - } - - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), - method: config.method.toUpperCase(), - headers: headers, - agent: agent, - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth: auth - }; - - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; - } - - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + '_proxy'; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; - - if (noProxyEnv) { - var noProxy = noProxyEnv.split(',').map(function trim(s) { - return s.trim(); - }); - - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === '*') { - return true; - } - if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } - - return parsed.hostname === proxyElement; - }); - } - - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; - - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(':'); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; - } - } - } - } - - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } - - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirect = config.beforeRedirect; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; - } - - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } - - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } - - // Create the request - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) return; - - // uncompress the response body transparently if required - var stream = res; - - // return the last request in case of redirects - var lastRequest = res.req || req; - - - // if no content, is HEAD request or decompress disabled we should not decompress - if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { - switch (res.headers['content-encoding']) { - /*eslint default-case:0*/ - case 'gzip': - case 'compress': - case 'deflate': - // add the unzipper to the body stream processing pipeline - stream = stream.pipe(zlib.createUnzip()); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - } - } - - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config: config, - request: lastRequest - }; - - if (config.responseType === 'stream') { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - var totalResponseBytes = 0; - stream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - // stream.destoy() emit aborted event before calling reject() on Node.js v16 - rejected = true; - stream.destroy(); - reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); - } - }); - - stream.on('aborted', function handlerStreamAborted() { - if (rejected) { - return; - } - stream.destroy(); - reject(new AxiosError( - 'maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - )); - }); - - stream.on('error', function handleStreamError(err) { - if (req.aborted) return; - reject(AxiosError.from(err, null, config, lastRequest)); - }); - - stream.on('end', function handleStreamEnd() { - try { - var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (config.responseType !== 'arraybuffer') { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - // @todo remove - // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; - reject(AxiosError.from(err, null, config, req)); - }); - - // set tcp keep alive to prevent drop connection by peer - req.on('socket', function handleRequestSocket(socket) { - // default interval of sending ack packet is 1 minute - socket.setKeepAlive(true, 1000 * 60); - }); - - // Handle request timeout - if (config.timeout) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - var timeout = parseInt(config.timeout, 10); - - if (isNaN(timeout)) { - reject(new AxiosError( - 'error trying to parse `config.timeout` to int', - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); - - return; - } - - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devoring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, function handleRequestTimeout() { - req.abort(); - var transitional = config.transitional || transitionalDefaults; - reject(new AxiosError( - 'timeout of ' + timeout + 'ms exceeded', - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - )); - }); - } - - if (config.cancelToken || config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = function(cancel) { - if (req.aborted) return; - - req.abort(); - reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); - }; - - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); - } - } - - - // Send the request - if (utils.isStream(data)) { - data.on('error', function handleStreamError(err) { - reject(AxiosError.from(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); - } - }); -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/64/363e6cf9b9cd34c5f98a42ac053d9cad148080983d3d10b53d4d65616fe2cfbe4cd91c815693d20ebee11dae238323423cf2b07075cf1b962f9d21cda7978b-index.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/64/363e6cf9b9cd34c5f98a42ac053d9cad148080983d3d10b53d4d65616fe2cfbe4cd91c815693d20ebee11dae238323423cf2b07075cf1b962f9d21cda7978b-index.json deleted file mode 100644 index 43ad908312399..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/64/363e6cf9b9cd34c5f98a42ac053d9cad148080983d3d10b53d4d65616fe2cfbe4cd91c815693d20ebee11dae238323423cf2b07075cf1b962f9d21cda7978b-index.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"mime-types","version":"2.1.35","files":{"LICENSE":{"checkedAt":1673270429561,"integrity":"sha512-oaKT6wCX/oeHXzv5CMwLDujxXplcaOmEtqJOJHsulUQH15QeqWq9f+ACob37cT/fsNODnZSKM0YD8F5kSCn2Bg==","mode":420,"size":1167},"package.json":{"checkedAt":1673270429572,"integrity":"sha512-5rWjObB9Emuhyx9d8758o2x9wl4/BbSkysoJYTJSjgXVUgC0GuPTMrS48KQOyt/9kJAhZ9jdASmQ2ADlsUkkQw==","mode":420,"size":1149},"index.js":{"checkedAt":1673270429588,"integrity":"sha512-wkid43nvph1ozqfx1M5AWTpIqG9iyL4doJmkRi3wcFwyTOImCxmY6b3klNKoFYxg11F76ESNJyUjedZ12Zrhvg==","mode":420,"size":3663},"HISTORY.md":{"checkedAt":1673270429617,"integrity":"sha512-uTmDdX0THV9YPxTzIP15WP7vPkTDRm00Dl2WsE1Ka+gSP90MygNc7TbVAcGKHsXRUZVkNFT0HKTgEXQ8kvTthA==","mode":420,"size":8812},"README.md":{"checkedAt":1673270429622,"integrity":"sha512-k6Rw/FmqpVF3vT/SsGdjK9xkoyVLNZBHzownj+sVNA71Uqb83RePzRAmsWHGk/TIS0JnY6iIHc8C504TRcY5QA==","mode":420,"size":3481}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/65/049f5c90316dca7f303ec1fa1ef5a7185a4d55e4f5fbc87938ede2422894ee7f1038f2ea1bb8c6f05dec0609592221a8b3fc434e948c09e90b3a9baad36cc1 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/65/049f5c90316dca7f303ec1fa1ef5a7185a4d55e4f5fbc87938ede2422894ee7f1038f2ea1bb8c6f05dec0609592221a8b3fc434e948c09e90b3a9baad36cc1 deleted file mode 100644 index 97717c5e9a537..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/65/049f5c90316dca7f303ec1fa1ef5a7185a4d55e4f5fbc87938ede2422894ee7f1038f2ea1bb8c6f05dec0609592221a8b3fc434e948c09e90b3a9baad36cc1 +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "follow-redirects", - "version": "1.15.2", - "description": "HTTP and HTTPS modules that follow redirects.", - "license": "MIT", - "main": "index.js", - "files": [ - "*.js" - ], - "engines": { - "node": ">=4.0" - }, - "scripts": { - "test": "npm run lint && npm run mocha", - "lint": "eslint *.js test", - "mocha": "nyc mocha" - }, - "repository": { - "type": "git", - "url": "git@github.com:follow-redirects/follow-redirects.git" - }, - "homepage": "https://github.com/follow-redirects/follow-redirects", - "bugs": { - "url": "https://github.com/follow-redirects/follow-redirects/issues" - }, - "keywords": [ - "http", - "https", - "url", - "redirect", - "client", - "location", - "utility" - ], - "author": "Ruben Verborgh (https://ruben.verborgh.org/)", - "contributors": [ - "Olivier Lalonde (http://www.syskall.com)", - "James Talmage " - ], - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "peerDependenciesMeta": { - "debug": { - "optional": true - } - }, - "devDependencies": { - "concat-stream": "^2.0.0", - "eslint": "^5.16.0", - "express": "^4.16.4", - "lolex": "^3.1.0", - "mocha": "^6.0.2", - "nyc": "^14.1.1" - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/65/9fe1b94b84b0dc2df59484959a722ff7e85e2f1ebdb3aec053f892ff83fc88528d305d8b85d5415be4f99f26449f86bbe7f5b90f3fe44202cf0afe7bbd431d b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/65/9fe1b94b84b0dc2df59484959a722ff7e85e2f1ebdb3aec053f892ff83fc88528d305d8b85d5415be4f99f26449f86bbe7f5b90f3fe44202cf0afe7bbd431d deleted file mode 100644 index 00b2b050a109b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/65/9fe1b94b84b0dc2df59484959a722ff7e85e2f1ebdb3aec053f892ff83fc88528d305d8b85d5415be4f99f26449f86bbe7f5b90f3fe44202cf0afe7bbd431d +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var isAbsoluteURL = require('../helpers/isAbsoluteURL'); -var combineURLs = require('../helpers/combineURLs'); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/06674006e8796e9e17134b8bfc5ad14a0d4b484560f0351fd5142be9ebf1381cdf38b45df6969d04618bcfb86b11fa0735496e6bf488b0b81be8e111a62525 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/06674006e8796e9e17134b8bfc5ad14a0d4b484560f0351fd5142be9ebf1381cdf38b45df6969d04618bcfb86b11fa0735496e6bf488b0b81be8e111a62525 deleted file mode 100644 index c7ff12a2f8af2..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/06674006e8796e9e17134b8bfc5ad14a0d4b484560f0351fd5142be9ebf1381cdf38b45df6969d04618bcfb86b11fa0735496e6bf488b0b81be8e111a62525 +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Felix GeisendΓΆrfer (felix@debuggable.com) and contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/2483ecd7fdd5a2c1d11c4be0a1ab28705797b11db350c098475ca156b05e72c3ed20e1a4d82db88236680920edaed04b8d63c4f499d7ba7855d1a730793731-index.json b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/2483ecd7fdd5a2c1d11c4be0a1ab28705797b11db350c098475ca156b05e72c3ed20e1a4d82db88236680920edaed04b8d63c4f499d7ba7855d1a730793731-index.json deleted file mode 100644 index dab2437f92634..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/2483ecd7fdd5a2c1d11c4be0a1ab28705797b11db350c098475ca156b05e72c3ed20e1a4d82db88236680920edaed04b8d63c4f499d7ba7855d1a730793731-index.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"delayed-stream","version":"1.0.0","files":{".npmignore":{"checkedAt":1673270429559,"integrity":"sha512-Dj51I0q8aPQ3ioaz9LMqGYujAYRbDNblAQbodDRXAMxmY6hsHqEl3F6SvhfJj5oPhcqdX1ldsgEvfMNXGUXBIw==","mode":420,"size":5},"package.json":{"checkedAt":1673270429567,"integrity":"sha512-GbVWu3bA5RXylowMktE8IjjUVdqQj+e4k+WTYieu8k2Nip2wTJQmH/7v06jb5/ZEZ3w0OcYNXh5SRplSIYSorw==","mode":420,"size":684},"License":{"checkedAt":1673270429571,"integrity":"sha512-QC/HN+kDgNYpC7i33wfvn5wKaEz8H4mMLjVuA6w03m1OlQFq5w7L4MbJZrWZaWlso2u4xIS7xZDZT6574cQ1Og==","mode":420,"size":1085},"lib/delayed_stream.js":{"checkedAt":1673270429571,"integrity":"sha512-qxdTU5+ev9ty1SQwdqh0WQaMtNMBTJVy/Y/X1jKJVy0z6huaCTQ3B7zAFW9S2jjUGSVagN3MPQR6y0Ja0TpsZQ==","mode":420,"size":2319},"Makefile":{"checkedAt":1673270429572,"integrity":"sha512-VrB2F7mxP++iP2L5cK27VRXxuyOIWC3nKa6JFlrzqCR4t9A5UK+nEmdI11S/z72kl+7LowptDz9AdIEvtx04Yg==","mode":420,"size":57},"Readme.md":{"checkedAt":1673270429588,"integrity":"sha512-E/kRfSrwwFnzJPSDzGq2tOUcKN7ihwO4O/w/rHwQd8yQ7nyyIrbiFk6zGRpDAAKyTP7ge/2RoqUWBCUM/E1KSg==","mode":420,"size":3871}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/43fec5855e542c8fcc3f5b152024bed3e63fbe5791c0650602398db28f06193d3d68939335cb62c71d9a3550fc62f68789b38c326be0e1e0755180883c113e b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/43fec5855e542c8fcc3f5b152024bed3e63fbe5791c0650602398db28f06193d3d68939335cb62c71d9a3550fc62f68789b38c326be0e1e0755180883c113e deleted file mode 100644 index d36c80ef27bf3..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/67/43fec5855e542c8fcc3f5b152024bed3e63fbe5791c0650602398db28f06193d3d68939335cb62c71d9a3550fc62f68789b38c326be0e1e0755180883c113e +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014-present Matt Zabriskie - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6c/818187785a73e073c4a2c482cacf4fabb6577a2e52b9c049f6b76e30ee6aa20ee921dcb0652e89145af74159d94871507ca11a57cd3ef1bd919ba7a6810dbf b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6c/818187785a73e073c4a2c482cacf4fabb6577a2e52b9c049f6b76e30ee6aa20ee921dcb0652e89145af74159d94871507ca11a57cd3ef1bd919ba7a6810dbf deleted file mode 100644 index d21c921d99a73..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6c/818187785a73e073c4a2c482cacf4fabb6577a2e52b9c049f6b76e30ee6aa20ee921dcb0652e89145af74159d94871507ca11a57cd3ef1bd919ba7a6810dbf +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./").https; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6d/d2594fa982201d026e633e5a83cfa3e5463bdb18d57343ee7678e4cda1beaab9ecde03e8b14df221d5361fff24e57b5d47441657cb795ed8d2c0b332d0cfd1 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6d/d2594fa982201d026e633e5a83cfa3e5463bdb18d57343ee7678e4cda1beaab9ecde03e8b14df221d5361fff24e57b5d47441657cb795ed8d2c0b332d0cfd1 deleted file mode 100644 index 6147c608e1a33..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6d/d2594fa982201d026e633e5a83cfa3e5463bdb18d57343ee7678e4cda1beaab9ecde03e8b14df221d5361fff24e57b5d47441657cb795ed8d2c0b332d0cfd1 +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6e/1ae1f9c66e88acae73b1bc1040d187f3377070f682befda148299ce3d71f213dee0177368634bf07e0a12c62604abab71cf205be6511265dafc1bcf40c6c72 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6e/1ae1f9c66e88acae73b1bc1040d187f3377070f682befda148299ce3d71f213dee0177368634bf07e0a12c62604abab71cf205be6511265dafc1bcf40c6c72 deleted file mode 100644 index 8af2cc7f1b625..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6e/1ae1f9c66e88acae73b1bc1040d187f3377070f682befda148299ce3d71f213dee0177368634bf07e0a12c62604abab71cf205be6511265dafc1bcf40c6c72 +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6e/8713f975ce4960499a4488e63f1fa7713d50915d776a843995022350040e28214feeb56edaf89f527777834d3daf4363bd8916d33da16f946f2bc06fd5866d b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6e/8713f975ce4960499a4488e63f1fa7713d50915d776a843995022350040e28214feeb56edaf89f527777834d3daf4363bd8916d33da16f946f2bc06fd5866d deleted file mode 100644 index cf6583cfe5307..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/6e/8713f975ce4960499a4488e63f1fa7713d50915d776a843995022350040e28214feeb56edaf89f527777834d3daf4363bd8916d33da16f946f2bc06fd5866d +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var bind = require('./helpers/bind'); -var Axios = require('./core/Axios'); -var mergeConfig = require('./core/mergeConfig'); -var defaults = require('./defaults'); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Expose Cancel & CancelToken -axios.CanceledError = require('./cancel/CanceledError'); -axios.CancelToken = require('./cancel/CancelToken'); -axios.isCancel = require('./cancel/isCancel'); -axios.VERSION = require('./env/data').version; -axios.toFormData = require('./helpers/toFormData'); - -// Expose AxiosError class -axios.AxiosError = require('../lib/core/AxiosError'); - -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = require('./helpers/spread'); - -// Expose isAxiosError -axios.isAxiosError = require('./helpers/isAxiosError'); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports.default = axios; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/72/a173fc9ce25d9ae8df620f9d9581c73eacec5ca16c96b25527cc010a13b622319854e1ca3be3e2ed20191a0253992326952fe258b6b8359dcff38e9172a9ad b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/72/a173fc9ce25d9ae8df620f9d9581c73eacec5ca16c96b25527cc010a13b622319854e1ca3be3e2ed20191a0253992326952fe258b6b8359dcff38e9172a9ad deleted file mode 100644 index 25e3cdd394d16..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/72/a173fc9ce25d9ae8df620f9d9581c73eacec5ca16c96b25527cc010a13b622319854e1ca3be3e2ed20191a0253992326952fe258b6b8359dcff38e9172a9ad +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/73/d000123449665ca9b99fe0e08c1df5680b2c1ec2b2f3753d65860c06607c76212f8ecfc2533262272c937259d880c46ba29de7f92ef02a0b654a9cc648ff33 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/73/d000123449665ca9b99fe0e08c1df5680b2c1ec2b2f3753d65860c06607c76212f8ecfc2533262272c937259d880c46ba29de7f92ef02a0b654a9cc648ff33 deleted file mode 100644 index 695e356174a86..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/73/d000123449665ca9b99fe0e08c1df5680b2c1ec2b2f3753d65860c06607c76212f8ecfc2533262272c937259d880c46ba29de7f92ef02a0b654a9cc648ff33 +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./").http; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/76/257a4fa2ea50b3cf72339b5a01c2ff8f07a744f746ac53874c5a14d3c97373fed4f0b1292550bb372c664d9bb112a653aaae264a1c61262952113e85f3b936 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/76/257a4fa2ea50b3cf72339b5a01c2ff8f07a744f746ac53874c5a14d3c97373fed4f0b1292550bb372c664d9bb112a653aaae264a1c61262952113e85f3b936 deleted file mode 100644 index ddcc7e6b95ca9..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/76/257a4fa2ea50b3cf72339b5a01c2ff8f07a744f746ac53874c5a14d3c97373fed4f0b1292550bb372c664d9bb112a653aaae264a1c61262952113e85f3b936 +++ /dev/null @@ -1,233 +0,0 @@ -# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) - -Minimal async jobs utility library, with streams support. - -[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) -[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) -[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) - -[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) -[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) -[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) - - - -AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. -Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. - -It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. - -| compression | size | -| :----------------- | -------: | -| asynckit.js | 12.34 kB | -| asynckit.min.js | 4.11 kB | -| asynckit.min.js.gz | 1.47 kB | - - -## Install - -```sh -$ npm install --save asynckit -``` - -## Examples - -### Parallel Jobs - -Runs iterator over provided array in parallel. Stores output in the `result` array, -on the matching positions. In unlikely event of an error from one of the jobs, -will terminate rest of the active jobs (if abort function is provided) -and return error along with salvaged data to the main callback function. - -#### Input Array - -```javascript -var parallel = require('asynckit').parallel - , assert = require('assert') - ; - -var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] - , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] - , target = [] - ; - -parallel(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); -}); - -// async job accepts one element from the array -// and a callback function -function asyncJob(item, cb) -{ - // different delays (in ms) per item - var delay = item * 25; - - // pretend different jobs take different time to finish - // and not in consequential order - var timeoutId = setTimeout(function() { - target.push(item); - cb(null, item * 2); - }, delay); - - // allow to cancel "leftover" jobs upon error - // return function, invoking of which will abort this job - return clearTimeout.bind(null, timeoutId); -} -``` - -More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). - -#### Input Object - -Also it supports named jobs, listed via object. - -```javascript -var parallel = require('asynckit/parallel') - , assert = require('assert') - ; - -var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } - , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } - , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] - , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] - , target = [] - , keys = [] - ; - -parallel(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); - assert.deepEqual(keys, expectedKeys); -}); - -// supports full value, key, callback (shortcut) interface -function asyncJob(item, key, cb) -{ - // different delays (in ms) per item - var delay = item * 25; - - // pretend different jobs take different time to finish - // and not in consequential order - var timeoutId = setTimeout(function() { - keys.push(key); - target.push(item); - cb(null, item * 2); - }, delay); - - // allow to cancel "leftover" jobs upon error - // return function, invoking of which will abort this job - return clearTimeout.bind(null, timeoutId); -} -``` - -More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). - -### Serial Jobs - -Runs iterator over provided array sequentially. Stores output in the `result` array, -on the matching positions. In unlikely event of an error from one of the jobs, -will not proceed to the rest of the items in the list -and return error along with salvaged data to the main callback function. - -#### Input Array - -```javascript -var serial = require('asynckit/serial') - , assert = require('assert') - ; - -var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] - , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] - , target = [] - ; - -serial(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); -}); - -// extended interface (item, key, callback) -// also supported for arrays -function asyncJob(item, key, cb) -{ - target.push(key); - - // it will be automatically made async - // even it iterator "returns" in the same event loop - cb(null, item * 2); -} -``` - -More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). - -#### Input Object - -Also it supports named jobs, listed via object. - -```javascript -var serial = require('asynckit').serial - , assert = require('assert') - ; - -var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] - , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] - , target = [] - ; - -var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } - , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } - , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , target = [] - ; - - -serial(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); -}); - -// shortcut interface (item, callback) -// works for object as well as for the arrays -function asyncJob(item, cb) -{ - target.push(item); - - // it will be automatically made async - // even it iterator "returns" in the same event loop - cb(null, item * 2); -} -``` - -More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). - -_Note: Since _object_ is an _unordered_ collection of properties, -it may produce unexpected results with sequential iterations. -Whenever order of the jobs' execution is important please use `serialOrdered` method._ - -### Ordered Serial Iterations - -TBD - -For example [compare-property](compare-property) package. - -### Streaming interface - -TBD - -## Want to Know More? - -More examples can be found in [test folder](test/). - -Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. - -## License - -AsyncKit is licensed under the MIT license. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7b/cb6b463d7be20668ccb3f5a93c60b9b5a48a6264ab4e27094a8c25f2ee362995829326222ca593e7c169e1e19d6ba0aaa4a78a55c6c23046d9391a80a7a927 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7b/cb6b463d7be20668ccb3f5a93c60b9b5a48a6264ab4e27094a8c25f2ee362995829326222ca593e7c169e1e19d6ba0aaa4a78a55c6c23046d9391a80a7a927 deleted file mode 100644 index 5a8fcfe4d0d81..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7b/cb6b463d7be20668ccb3f5a93c60b9b5a48a6264ab4e27094a8c25f2ee362995829326222ca593e7c169e1e19d6ba0aaa4a78a55c6c23046d9391a80a7a927 +++ /dev/null @@ -1,100 +0,0 @@ -# mime-db - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -This is a large database of mime types and information about them. -It consists of a single, public JSON file and does not include any logic, -allowing it to remain as un-opinionated as possible with an API. -It aggregates data from the following sources: - -- http://www.iana.org/assignments/media-types/media-types.xhtml -- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types - -## Installation - -```bash -npm install mime-db -``` - -### Database Download - -If you're crazy enough to use this in the browser, you can just grab the -JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to -replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) -as the JSON format may change in the future. - -``` -https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json -``` - -## Usage - -```js -var db = require('mime-db') - -// grab data on .js files -var data = db['application/javascript'] -``` - -## Data Structure - -The JSON file is a map lookup for lowercased mime types. -Each mime type has the following properties: - -- `.source` - where the mime type is defined. - If not set, it's probably a custom media type. - - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) - - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) -- `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type can be gzipped. -- `.charset` - the default charset associated with this type, if any. - -If unknown, every property could be `undefined`. - -## Contributing - -To edit the database, only make PRs against `src/custom-types.json` or -`src/custom-suffix.json`. - -The `src/custom-types.json` file is a JSON object with the MIME type as the -keys and the values being an object with the following keys: - -- `compressible` - leave out if you don't know, otherwise `true`/`false` to - indicate whether the data represented by the type is typically compressible. -- `extensions` - include an array of file extensions that are associated with - the type. -- `notes` - human-readable notes about the type, typically what the type is. -- `sources` - include an array of URLs of where the MIME type and the associated - extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); - links to type aggregating sites and Wikipedia are _not acceptable_. - -To update the build, run `npm run build`. - -### Adding Custom Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -If that is not possible / feasible, they can be added directly here as a -"custom" type. To do this, it is required to have a primary source that -definitively lists the media type. If an extension is going to be listed as -associateed with this media type, the source must definitively link the -media type and extension as well. - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci -[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://badgen.net/npm/node/mime-db -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-db -[npm-url]: https://npmjs.org/package/mime-db -[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7c/59e31a43d1f19271772bbe21014c277a078ba3732004b2ca68693e4f9e60663def41b4c5ac8e36056c76587d391ddf3a22be2e29053143e36b150464d25c5f b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7c/59e31a43d1f19271772bbe21014c277a078ba3732004b2ca68693e4f9e60663def41b4c5ac8e36056c76587d391ddf3a22be2e29053143e36b150464d25c5f deleted file mode 100644 index eb869a6f046ba..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7c/59e31a43d1f19271772bbe21014c277a078ba3732004b2ca68693e4f9e60663def41b4c5ac8e36056c76587d391ddf3a22be2e29053143e36b150464d25c5f +++ /dev/null @@ -1,155 +0,0 @@ -## Follow Redirects - -Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. - -[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) -[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions) -[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) -[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) -[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh) - -`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) - methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) - modules, with the exception that they will seamlessly follow redirects. - -```javascript -const { http, https } = require('follow-redirects'); - -http.get('http://bit.ly/900913', response => { - response.on('data', chunk => { - console.log(chunk); - }); -}).on('error', err => { - console.error(err); -}); -``` - -You can inspect the final redirected URL through the `responseUrl` property on the `response`. -If no redirection happened, `responseUrl` is the original request URL. - -```javascript -const request = https.request({ - host: 'bitly.com', - path: '/UHfDGO', -}, response => { - console.log(response.responseUrl); - // 'http://duckduckgo.com/robots.txt' -}); -request.end(); -``` - -## Options -### Global options -Global options are set directly on the `follow-redirects` module: - -```javascript -const followRedirects = require('follow-redirects'); -followRedirects.maxRedirects = 10; -followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB -``` - -The following global options are supported: - -- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - -- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - -### Per-request options -Per-request options are set by passing an `options` object: - -```javascript -const url = require('url'); -const { http, https } = require('follow-redirects'); - -const options = url.parse('http://bit.ly/900913'); -options.maxRedirects = 10; -options.beforeRedirect = (options, response, request) => { - // Use this to adjust the request options upon redirecting, - // to inspect the latest response headers, - // or to cancel the request by throwing an error - - // response.headers = the redirect response headers - // response.statusCode = the redirect response code (eg. 301, 307, etc.) - - // request.url = the requested URL that resulted in a redirect - // request.headers = the headers in the request that resulted in a redirect - // request.method = the method of the request that resulted in a redirect - if (options.hostname === "example.com") { - options.auth = "user:password"; - } -}; -http.request(options); -``` - -In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback), -the following per-request options are supported: -- `followRedirects` (default: `true`) – whether redirects should be followed. - -- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - -- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - -- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error. - -- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` - -- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. - - -### Advanced usage -By default, `follow-redirects` will use the Node.js default implementations -of [`http`](https://nodejs.org/api/http.html) -and [`https`](https://nodejs.org/api/https.html). -To enable features such as caching and/or intermediate request tracking, -you might instead want to wrap `follow-redirects` around custom protocol implementations: - -```javascript -const { http, https } = require('follow-redirects').wrap({ - http: require('your-custom-http'), - https: require('your-custom-https'), -}); -``` - -Such custom protocols only need an implementation of the `request` method. - -## Browser Usage - -Due to the way the browser works, -the `http` and `https` browser equivalents perform redirects by default. - -By requiring `follow-redirects` this way: -```javascript -const http = require('follow-redirects/http'); -const https = require('follow-redirects/https'); -``` -you can easily tell webpack and friends to replace -`follow-redirect` by the built-in versions: - -```json -{ - "follow-redirects/http" : "http", - "follow-redirects/https" : "https" -} -``` - -## Contributing - -Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues) - detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied - by tests. You can run the test suite locally with a simple `npm test` command. - -## Debug Logging - -`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging - set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test - suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well. - -## Authors - -- [Ruben Verborgh](https://ruben.verborgh.org/) -- [Olivier Lalonde](mailto:olalonde@gmail.com) -- [James Talmage](mailto:james@talmage.io) - -## License - -[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE) diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7c/bb8ddf4a6c0c82684a25b0e2d680490362453d9f344a773323f3ffe84c5c515ed881f4ce7952b1283109bdccc1d927eac4735985217c25813c805a8163c79a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7c/bb8ddf4a6c0c82684a25b0e2d680490362453d9f344a773323f3ffe84c5c515ed881f4ce7952b1283109bdccc1d927eac4735985217c25813c805a8163c79a deleted file mode 100644 index 0b9e1d35c9a6b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7c/bb8ddf4a6c0c82684a25b0e2d680490362453d9f344a773323f3ffe84c5c515ed881f4ce7952b1283109bdccc1d927eac4735985217c25813c805a8163c79a +++ /dev/null @@ -1,254 +0,0 @@ -// TypeScript Version: 3.0 -export type AxiosRequestHeaders = Record; - -export type AxiosResponseHeaders = Record & { - "set-cookie"?: string[] -}; - -export interface AxiosRequestTransformer { - (data: any, headers?: AxiosRequestHeaders): any; -} - -export interface AxiosResponseTransformer { - (data: any, headers?: AxiosResponseHeaders): any; -} - -export interface AxiosAdapter { - (config: AxiosRequestConfig): AxiosPromise; -} - -export interface AxiosBasicCredentials { - username: string; - password: string; -} - -export interface AxiosProxyConfig { - host: string; - port: number; - auth?: { - username: string; - password: string; - }; - protocol?: string; -} - -export type Method = - | 'get' | 'GET' - | 'delete' | 'DELETE' - | 'head' | 'HEAD' - | 'options' | 'OPTIONS' - | 'post' | 'POST' - | 'put' | 'PUT' - | 'patch' | 'PATCH' - | 'purge' | 'PURGE' - | 'link' | 'LINK' - | 'unlink' | 'UNLINK'; - -export type ResponseType = - | 'arraybuffer' - | 'blob' - | 'document' - | 'json' - | 'text' - | 'stream'; - - export type responseEncoding = - | 'ascii' | 'ASCII' - | 'ansi' | 'ANSI' - | 'binary' | 'BINARY' - | 'base64' | 'BASE64' - | 'base64url' | 'BASE64URL' - | 'hex' | 'HEX' - | 'latin1' | 'LATIN1' - | 'ucs-2' | 'UCS-2' - | 'ucs2' | 'UCS2' - | 'utf-8' | 'UTF-8' - | 'utf8' | 'UTF8' - | 'utf16le' | 'UTF16LE'; - -export interface TransitionalOptions { - silentJSONParsing?: boolean; - forcedJSONParsing?: boolean; - clarifyTimeoutError?: boolean; -} - -export interface AxiosRequestConfig { - url?: string; - method?: Method | string; - baseURL?: string; - transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; - transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; - headers?: AxiosRequestHeaders; - params?: any; - paramsSerializer?: (params: any) => string; - data?: D; - timeout?: number; - timeoutErrorMessage?: string; - withCredentials?: boolean; - adapter?: AxiosAdapter; - auth?: AxiosBasicCredentials; - responseType?: ResponseType; - responseEncoding?: responseEncoding | string; - xsrfCookieName?: string; - xsrfHeaderName?: string; - onUploadProgress?: (progressEvent: any) => void; - onDownloadProgress?: (progressEvent: any) => void; - maxContentLength?: number; - validateStatus?: ((status: number) => boolean) | null; - maxBodyLength?: number; - maxRedirects?: number; - beforeRedirect?: (options: Record, responseDetails: {headers: Record}) => void; - socketPath?: string | null; - httpAgent?: any; - httpsAgent?: any; - proxy?: AxiosProxyConfig | false; - cancelToken?: CancelToken; - decompress?: boolean; - transitional?: TransitionalOptions; - signal?: AbortSignal; - insecureHTTPParser?: boolean; - env?: { - FormData?: new (...args: any[]) => object; - }; -} - -export interface HeadersDefaults { - common: AxiosRequestHeaders; - delete: AxiosRequestHeaders; - get: AxiosRequestHeaders; - head: AxiosRequestHeaders; - post: AxiosRequestHeaders; - put: AxiosRequestHeaders; - patch: AxiosRequestHeaders; - options?: AxiosRequestHeaders; - purge?: AxiosRequestHeaders; - link?: AxiosRequestHeaders; - unlink?: AxiosRequestHeaders; -} - -export interface AxiosDefaults extends Omit, 'headers'> { - headers: HeadersDefaults; -} - -export interface AxiosResponse { - data: T; - status: number; - statusText: string; - headers: AxiosResponseHeaders; - config: AxiosRequestConfig; - request?: any; -} - -export class AxiosError extends Error { - constructor( - message?: string, - code?: string, - config?: AxiosRequestConfig, - request?: any, - response?: AxiosResponse - ); - - config: AxiosRequestConfig; - code?: string; - request?: any; - response?: AxiosResponse; - isAxiosError: boolean; - status?: string; - toJSON: () => object; - static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; - static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; - static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; - static readonly ERR_NETWORK = "ERR_NETWORK"; - static readonly ERR_DEPRECATED = "ERR_DEPRECATED"; - static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; - static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; - static readonly ERR_CANCELED = "ERR_CANCELED"; - static readonly ECONNABORTED = "ECONNABORTED"; - static readonly ETIMEDOUT = "ETIMEDOUT"; -} - -export class CanceledError extends AxiosError { -} - -export interface AxiosPromise extends Promise> { -} - -export interface CancelStatic { - new (message?: string): Cancel; -} - -export interface Cancel { - message: string | undefined; -} - -export interface Canceler { - (message?: string): void; -} - -export interface CancelTokenStatic { - new (executor: (cancel: Canceler) => void): CancelToken; - source(): CancelTokenSource; -} - -export interface CancelToken { - promise: Promise; - reason?: Cancel; - throwIfRequested(): void; -} - -export interface CancelTokenSource { - token: CancelToken; - cancel: Canceler; -} - -export interface AxiosInterceptorOptions { - synchronous?: boolean; - runWhen?: (config: AxiosRequestConfig) => boolean; -} - -export interface AxiosInterceptorManager { - use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number; - eject(id: number): void; -} - -export class Axios { - constructor(config?: AxiosRequestConfig); - defaults: AxiosDefaults; - interceptors: { - request: AxiosInterceptorManager; - response: AxiosInterceptorManager; - }; - getUri(config?: AxiosRequestConfig): string; - request, D = any>(config: AxiosRequestConfig): Promise; - get, D = any>(url: string, config?: AxiosRequestConfig): Promise; - delete, D = any>(url: string, config?: AxiosRequestConfig): Promise; - head, D = any>(url: string, config?: AxiosRequestConfig): Promise; - options, D = any>(url: string, config?: AxiosRequestConfig): Promise; - post, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - put, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - patch, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - postForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - putForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - patchForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; -} - -export interface AxiosInstance extends Axios { - (config: AxiosRequestConfig): AxiosPromise; - (url: string, config?: AxiosRequestConfig): AxiosPromise; -} - -export interface AxiosStatic extends AxiosInstance { - create(config?: AxiosRequestConfig): AxiosInstance; - Cancel: CancelStatic; - CancelToken: CancelTokenStatic; - Axios: typeof Axios; - readonly VERSION: string; - isCancel(value: any): boolean; - all(values: Array>): Promise; - spread(callback: (...args: T[]) => R): (array: T[]) => R; - isAxiosError(payload: any): payload is AxiosError; -} - -declare const axios: AxiosStatic; - -export default axios; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7d/7241c3f55f5ce7dc0cf980279b1d8e72d25063a89b640e1f4cc63db921dc04267d33602ac9b1c8b96793ca3f5f2717e77499fa9c05cfc4b54313b15b48f08a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7d/7241c3f55f5ce7dc0cf980279b1d8e72d25063a89b640e1f4cc63db921dc04267d33602ac9b1c8b96793ca3f5f2717e77499fa9c05cfc4b54313b15b48f08a deleted file mode 100644 index 3c50344d8515f..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/7d/7241c3f55f5ce7dc0cf980279b1d8e72d25063a89b640e1f4cc63db921dc04267d33602ac9b1c8b96793ca3f5f2717e77499fa9c05cfc4b54313b15b48f08a +++ /dev/null @@ -1,43 +0,0 @@ -var iterate = require('./lib/iterate.js') - , initState = require('./lib/state.js') - , terminator = require('./lib/terminator.js') - ; - -// Public API -module.exports = parallel; - -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); - - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } - - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); - - state.index++; - } - - return terminator.bind(state, callback); -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/82/8a467310483cc1bd852c555c9651e63ca05219b6f438c7feed53c998a58fe7f00e3a011cf8c5c6760e5eb81f0755899838e7248707b416da7cf31a818e58b3 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/82/8a467310483cc1bd852c555c9651e63ca05219b6f438c7feed53c998a58fe7f00e3a011cf8c5c6760e5eb81f0755899838e7248707b416da7cf31a818e58b3 deleted file mode 100644 index ec2be30de1663..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/82/8a467310483cc1bd852c555c9651e63ca05219b6f438c7feed53c998a58fe7f00e3a011cf8c5c6760e5eb81f0755899838e7248707b416da7cf31a818e58b3 +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = require('./db.json') diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/82/e274f294c5b6dddd9cae77a17ec251fd8fd0eca79b219d7d1891e7d152fff15068357f7cd4e9b8d17d52ba8c9103fdf481149e1ec193729afad5ecf53c479d b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/82/e274f294c5b6dddd9cae77a17ec251fd8fd0eca79b219d7d1891e7d152fff15068357f7cd4e9b8d17d52ba8c9103fdf481149e1ec193729afad5ecf53c479d deleted file mode 100644 index fa1ad95765ef9..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/82/e274f294c5b6dddd9cae77a17ec251fd8fd0eca79b219d7d1891e7d152fff15068357f7cd4e9b8d17d52ba8c9103fdf481149e1ec193729afad5ecf53c479d +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var transformData = require('./transformData'); -var isCancel = require('../cancel/isCancel'); -var defaults = require('../defaults'); -var CanceledError = require('../cancel/CanceledError'); - -/** - * Throws a `CanceledError` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - - if (config.signal && config.signal.aborted) { - throw new CanceledError(); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/86/5222f396d460e938abe95c4a2b20bce66dc18d569c0574256d29023e22688720cba05510c7bcfd34774dc96ec6d6a7b3383a029b794e0b85f21fdd7659225b b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/86/5222f396d460e938abe95c4a2b20bce66dc18d569c0574256d29023e22688720cba05510c7bcfd34774dc96ec6d6a7b3383a029b794e0b85f21fdd7659225b deleted file mode 100644 index 4d35738dd502a..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/86/5222f396d460e938abe95c4a2b20bce66dc18d569c0574256d29023e22688720cba05510c7bcfd34774dc96ec6d6a7b3383a029b794e0b85f21fdd7659225b +++ /dev/null @@ -1,10 +0,0 @@ -// populates missing values -module.exports = function(dst, src) { - - Object.keys(src).forEach(function(prop) - { - dst[prop] = dst[prop] || src[prop]; - }); - - return dst; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/87/8b2a158caff5ff0b464206f3d1876caa2f91d9924edc9945b50a164920d21f414dd2030290a279bfa019ec03e49ae8c72ee42ac2df421b7ac83a8dab922925 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/87/8b2a158caff5ff0b464206f3d1876caa2f91d9924edc9945b50a164920d21f414dd2030290a279bfa019ec03e49ae8c72ee42ac2df421b7ac83a8dab922925 deleted file mode 100644 index decb77dedde56..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/87/8b2a158caff5ff0b464206f3d1876caa2f91d9924edc9945b50a164920d21f414dd2030290a279bfa019ec03e49ae8c72ee42ac2df421b7ac83a8dab922925 +++ /dev/null @@ -1,15 +0,0 @@ -var debug; - -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = require("debug")("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/87/f0feb0a2feb1c79b57ee045257309225b2dca064d097c9f2b6e90a4346bd62626fa3cc33e537036641348cc819bd5ed39941dcbc06dc390fa38946aab3f5b7 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/87/f0feb0a2feb1c79b57ee045257309225b2dca064d097c9f2b6e90a4346bd62626fa3cc33e537036641348cc819bd5ed39941dcbc06dc390fa38946aab3f5b7 deleted file mode 100644 index 09e7c70e6e9d7..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/87/f0feb0a2feb1c79b57ee045257309225b2dca064d097c9f2b6e90a4346bd62626fa3cc33e537036641348cc819bd5ed39941dcbc06dc390fa38946aab3f5b7 +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-env browser */ -module.exports = typeof self == 'object' ? self.FormData : window.FormData; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/8b/f97f2f8385896b631e9b8918881c426c17593cbb1a666758b9808901358653e7d9f03c1de39c781436fdc66b0af20b84443f8476f0699a2ef919697a0f9a4a b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/8b/f97f2f8385896b631e9b8918881c426c17593cbb1a666758b9808901358653e7d9f03c1de39c781436fdc66b0af20b84443f8476f0699a2ef919697a0f9a4a deleted file mode 100644 index 051f3ae4c5a52..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/8b/f97f2f8385896b631e9b8918881c426c17593cbb1a666758b9808901358653e7d9f03c1de39c781436fdc66b0af20b84443f8476f0699a2ef919697a0f9a4a +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/8c/435fca9a0fed9c6e77f4405d84f6f5378a7d872fdf3dbca9a29e3a29aa004fa3774bf3ac83f17921024016782e54e8947097c020c0eacb194f7b309319a671 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/8c/435fca9a0fed9c6e77f4405d84f6f5378a7d872fdf3dbca9a29e3a29aa004fa3774bf3ac83f17921024016782e54e8947097c020c0eacb194f7b309319a671 deleted file mode 100644 index f1b58a586439c..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/8c/435fca9a0fed9c6e77f4405d84f6f5378a7d872fdf3dbca9a29e3a29aa004fa3774bf3ac83f17921024016782e54e8947097c020c0eacb194f7b309319a671 +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/92/e93689b732d288308a33c173c946fadf64a0ebd9fe6d402a79c7d0773b70dd11ec054de55d8b6f29c58271adc581d02711bccda9ea97d845de2a89a38a159e b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/92/e93689b732d288308a33c173c946fadf64a0ebd9fe6d402a79c7d0773b70dd11ec054de55d8b6f29c58271adc581d02711bccda9ea97d845de2a89a38a159e deleted file mode 100644 index 900f44880dc9d..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/92/e93689b732d288308a33c173c946fadf64a0ebd9fe6d402a79c7d0773b70dd11ec054de55d8b6f29c58271adc581d02711bccda9ea97d845de2a89a38a159e +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -function InterceptorManager() { - this.handlers = []; -} - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; -}; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; - -module.exports = InterceptorManager; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/93/44c3df2a8b5d3abf4f1a7be8a7a3b885445d1355b294c69f855185bc1556f179ab4e2d8657b5ccc558494a382db37df57dfabb83574604c22f8de5f7233808 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/93/44c3df2a8b5d3abf4f1a7be8a7a3b885445d1355b294c69f855185bc1556f179ab4e2d8657b5ccc558494a382db37df57dfabb83574604c22f8de5f7233808 deleted file mode 100644 index 32c14b846848a..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/93/44c3df2a8b5d3abf4f1a7be8a7a3b885445d1355b294c69f855185bc1556f179ab4e2d8657b5ccc558494a382db37df57dfabb83574604c22f8de5f7233808 +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "mime-db", - "description": "Media Type Database", - "version": "1.52.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)", - "Robert Kieffer (http://github.com/broofa)" - ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": "jshttp/mime-db", - "devDependencies": { - "bluebird": "3.7.2", - "co": "4.6.0", - "cogent": "1.0.1", - "csv-parse": "4.16.3", - "eslint": "7.32.0", - "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.1.1", - "eslint-plugin-standard": "4.1.0", - "gnode": "0.1.2", - "media-typer": "1.1.0", - "mocha": "9.2.1", - "nyc": "15.1.0", - "raw-body": "2.5.0", - "stream-to-array": "2.3.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "db.json", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "update": "npm run fetch && npm run build", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/93/a470fc59aaa55177bd3fd2b067632bdc64a3254b359047ce8c278feb15340ef552a6fcdd178fcd1026b161c693f4c84b426763a8881dcf02e74e1345c63940 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/93/a470fc59aaa55177bd3fd2b067632bdc64a3254b359047ce8c278feb15340ef552a6fcdd178fcd1026b161c693f4c84b426763a8881dcf02e74e1345c63940 deleted file mode 100644 index 48d2fb477241e..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/93/a470fc59aaa55177bd3fd2b067632bdc64a3254b359047ce8c278feb15340ef552a6fcdd178fcd1026b161c693f4c84b426763a8881dcf02e74e1345c63940 +++ /dev/null @@ -1,113 +0,0 @@ -# mime-types - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -The ultimate javascript content-type utility. - -Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: - -- __No fallbacks.__ Instead of naively returning the first available type, - `mime-types` simply returns `false`, so do - `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. -- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. -- No `.define()` functionality -- Bug fixes for `.lookup(path)` - -Otherwise, the API is compatible with `mime` 1.x. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install mime-types -``` - -## Adding Types - -All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), -so open a PR there if you'd like to add mime types. - -## API - -```js -var mime = require('mime-types') -``` - -All functions return `false` if input is invalid or not found. - -### mime.lookup(path) - -Lookup the content-type associated with a file. - -```js -mime.lookup('json') // 'application/json' -mime.lookup('.md') // 'text/markdown' -mime.lookup('file.html') // 'text/html' -mime.lookup('folder/file.js') // 'application/javascript' -mime.lookup('folder/.htaccess') // false - -mime.lookup('cats') // false -``` - -### mime.contentType(type) - -Create a full content-type header given a content-type or extension. -When given an extension, `mime.lookup` is used to get the matching -content-type, otherwise the given content-type is used. Then if the -content-type does not already have a `charset` parameter, `mime.charset` -is used to get the default charset and add to the returned content-type. - -```js -mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' -mime.contentType('file.json') // 'application/json; charset=utf-8' -mime.contentType('text/html') // 'text/html; charset=utf-8' -mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' - -// from a full path -mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' -``` - -### mime.extension(type) - -Get the default extension for a content-type. - -```js -mime.extension('application/octet-stream') // 'bin' -``` - -### mime.charset(type) - -Lookup the implied default charset of a content-type. - -```js -mime.charset('text/markdown') // 'UTF-8' -``` - -### var type = mime.types[extension] - -A map of content-types by extension. - -### [extensions...] = mime.extensions[type] - -A map of extensions by content-type. - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci -[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master -[node-version-image]: https://badgen.net/npm/node/mime-types -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-types -[npm-url]: https://npmjs.org/package/mime-types -[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/9a/5328f01683d07f75a7183d86356680d4e9115bb8d27221be4cec8cf73ffdeb4fe1a2eccff28745269ff6a29dc52af3cb66cf2090deab82c94aceca93dde312 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/9a/5328f01683d07f75a7183d86356680d4e9115bb8d27221be4cec8cf73ffdeb4fe1a2eccff28745269ff6a29dc52af3cb66cf2090deab82c94aceca93dde312 deleted file mode 100644 index 6b659782f68ff..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/9a/5328f01683d07f75a7183d86356680d4e9115bb8d27221be4cec8cf73ffdeb4fe1a2eccff28745269ff6a29dc52af3cb66cf2090deab82c94aceca93dde312 +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/core/AxiosError.js","webpack://axios/./lib/cancel/CanceledError.js","webpack://axios/./lib/defaults/index.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/defaults/transitional.js","webpack://axios/./lib/helpers/toFormData.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/env/data.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/parseProtocol.js","webpack://axios/./lib/helpers/null.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","cache","toString","kindOf","thing","str","slice","toLowerCase","kindOfTest","type","isArray","val","Array","isUndefined","isArrayBuffer","isObject","isPlainObject","getPrototypeOf","isDate","isFile","isBlob","isFileList","isFunction","isURLSearchParams","forEach","obj","fn","length","TypedArray","isTypedArray","Uint8Array","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isStream","pipe","isStandardBrowserEnv","navigator","product","window","document","merge","result","assignValue","arguments","extend","a","b","thisArg","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","descriptors","assign","toFlatObject","sourceObj","destObj","filter","prop","merged","getOwnPropertyNames","endsWith","searchString","position","String","undefined","lastIndex","indexOf","toArray","arr","utils","AxiosError","message","code","config","request","response","Error","toJSON","description","number","fileName","lineNumber","columnNumber","stack","status","defineProperties","from","error","customProps","axiosError","CanceledError","ERR_CANCELED","__CANCEL__","normalizeHeaderName","transitionalDefaults","toFormData","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","XMLHttpRequest","process","transformRequest","data","isObjectPayload","contentType","_FormData","env","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","silentJSONParsing","forcedJSONParsing","strictJSONParsing","responseType","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","method","args","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","clarifyTimeoutError","formData","convertValue","Blob","Buffer","build","parentKey","fullKey","el","append","pop","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","parseProtocol","Promise","resolve","reject","onCanceled","requestData","requestHeaders","done","cancelToken","unsubscribe","signal","removeEventListener","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","err","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","protocol","ERR_BAD_REQUEST","send","isAbsoluteURL","combineURLs","requestedURL","config1","config2","getMergedValue","target","source","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","keys","concat","configValue","Axios","mergeConfig","axios","createInstance","defaultConfig","context","instance","instanceConfig","CancelToken","isCancel","VERSION","version","Cancel","all","promises","spread","isAxiosError","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","configOrUrl","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","promise","responseInterceptorChain","chain","then","shift","newConfig","onFulfilled","onRejected","getUri","generateHTTPMethod","isForm","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","Math","floor","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","host","search","hash","hostname","port","pathname","charAt","location","requestURL","exec","deprecatedWarnings","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","executor","TypeError","resolvePromise","token","_listeners","onfulfilled","_resolve","listener","index","splice","callback","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,MAAM,WACT,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOnB,EAAoBQ,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRvB,EAAoB2B,EAAI,SAAShC,GAChC,IAAIe,EAASf,GAAUA,EAAO2B,WAC7B,WAAwB,OAAO3B,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAK,EAAoBQ,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRV,EAAoBW,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG7B,EAAoBgC,EAAI,GAIjBhC,EAAoBA,EAAoBiC,EAAI,I,+BChFrD,IAOuBC,EAPnBR,EAAO,EAAQ,GAIfS,EAAWvB,OAAOkB,UAAUK,SAG5BC,GAAmBF,EAMpBtB,OAAOY,OAAO,MAJR,SAASa,GACd,IAAIC,EAAMH,EAAS9B,KAAKgC,GACxB,OAAOH,EAAMI,KAASJ,EAAMI,GAAOA,EAAIC,MAAM,GAAI,GAAGC,iBAIxD,SAASC,EAAWC,GAElB,OADAA,EAAOA,EAAKF,cACL,SAAkBH,GACvB,OAAOD,EAAOC,KAAWK,GAU7B,SAASC,EAAQC,GACf,OAAOC,MAAMF,QAAQC,GASvB,SAASE,EAAYF,GACnB,YAAsB,IAARA,EAqBhB,IAAIG,EAAgBN,EAAW,eA6C/B,SAASO,EAASJ,GAChB,OAAe,OAARA,GAA+B,iBAARA,EAShC,SAASK,EAAcL,GACrB,GAAoB,WAAhBR,EAAOQ,GACT,OAAO,EAGT,IAAId,EAAYlB,OAAOsC,eAAeN,GACtC,OAAqB,OAAdd,GAAsBA,IAAclB,OAAOkB,UAUpD,IAAIqB,EAASV,EAAW,QASpBW,EAASX,EAAW,QASpBY,EAASZ,EAAW,QASpBa,EAAab,EAAW,YAQ5B,SAASc,EAAWX,GAClB,MAA8B,sBAAvBT,EAAS9B,KAAKuC,GAkCvB,IAAIY,EAAoBf,EAAW,mBAmDnC,SAASgB,EAAQC,EAAKC,GAEpB,GAAID,QAUJ,GALmB,iBAARA,IAETA,EAAM,CAACA,IAGLf,EAAQe,GAEV,IAAK,IAAIxD,EAAI,EAAGC,EAAIuD,EAAIE,OAAQ1D,EAAIC,EAAGD,IACrCyD,EAAGtD,KAAK,KAAMqD,EAAIxD,GAAIA,EAAGwD,QAI3B,IAAK,IAAIjC,KAAOiC,EACV9C,OAAOkB,UAAUC,eAAe1B,KAAKqD,EAAKjC,IAC5CkC,EAAGtD,KAAK,KAAMqD,EAAIjC,GAAMA,EAAKiC,GA4JrC,IAA6BG,EAAzBC,GAAyBD,EAKJ,oBAAfE,YAA8BnD,OAAOsC,eAAea,YAHrD,SAAS1B,GACd,OAAOwB,GAAcxB,aAAiBwB,IAI1ClE,EAAOD,QAAU,CACfiD,QAASA,EACTI,cAAeA,EACfiB,SAvYF,SAAkBpB,GAChB,OAAe,OAARA,IAAiBE,EAAYF,IAA4B,OAApBA,EAAIqB,cAAyBnB,EAAYF,EAAIqB,cAChD,mBAA7BrB,EAAIqB,YAAYD,UAA2BpB,EAAIqB,YAAYD,SAASpB,IAsYhFsB,WA9PF,SAAoB7B,GAElB,OAAOA,IACgB,mBAAb8B,UAA2B9B,aAAiB8B,UAFxC,sBAGZhC,EAAS9B,KAAKgC,IACbkB,EAAWlB,EAAMF,WAJN,sBAImBE,EAAMF,aA0PvCiC,kBApXF,SAA2BxB,GAOzB,MAL4B,oBAAhByB,aAAiCA,YAAkB,OACpDA,YAAYC,OAAO1B,GAEnB,GAAUA,EAAU,QAAMG,EAAcH,EAAI2B,SAgXvDC,SArWF,SAAkB5B,GAChB,MAAsB,iBAARA,GAqWd6B,SA5VF,SAAkB7B,GAChB,MAAsB,iBAARA,GA4VdI,SAAUA,EACVC,cAAeA,EACfH,YAAaA,EACbK,OAAQA,EACRC,OAAQA,EACRC,OAAQA,EACRE,WAAYA,EACZmB,SAnRF,SAAkB9B,GAChB,OAAOI,EAASJ,IAAQW,EAAWX,EAAI+B,OAmRvCnB,kBAAmBA,EACnBoB,qBAjOF,WACE,OAAyB,oBAAdC,WAAoD,gBAAtBA,UAAUC,SACY,iBAAtBD,UAAUC,SACY,OAAtBD,UAAUC,WAI/B,oBAAXC,QACa,oBAAbC,WA0NTvB,QAASA,EACTwB,MA/JF,SAASA,IACP,IAAIC,EAAS,GACb,SAASC,EAAYvC,EAAKnB,GACpBwB,EAAciC,EAAOzD,KAASwB,EAAcL,GAC9CsC,EAAOzD,GAAOwD,EAAMC,EAAOzD,GAAMmB,GACxBK,EAAcL,GACvBsC,EAAOzD,GAAOwD,EAAM,GAAIrC,GACfD,EAAQC,GACjBsC,EAAOzD,GAAOmB,EAAIL,QAElB2C,EAAOzD,GAAOmB,EAIlB,IAAK,IAAI1C,EAAI,EAAGC,EAAIiF,UAAUxB,OAAQ1D,EAAIC,EAAGD,IAC3CuD,EAAQ2B,UAAUlF,GAAIiF,GAExB,OAAOD,GA+IPG,OApIF,SAAgBC,EAAGC,EAAGC,GAQpB,OAPA/B,EAAQ8B,GAAG,SAAqB3C,EAAKnB,GAEjC6D,EAAE7D,GADA+D,GAA0B,mBAAR5C,EACXlB,EAAKkB,EAAK4C,GAEV5C,KAGN0C,GA6HPG,KAxPF,SAAcnD,GACZ,OAAOA,EAAImD,KAAOnD,EAAImD,OAASnD,EAAIoD,QAAQ,aAAc,KAwPzDC,SArHF,SAAkBC,GAIhB,OAH8B,QAA1BA,EAAQC,WAAW,KACrBD,EAAUA,EAAQrD,MAAM,IAEnBqD,GAkHPE,SAvGF,SAAkB7B,EAAa8B,EAAkBC,EAAOC,GACtDhC,EAAYnC,UAAYlB,OAAOY,OAAOuE,EAAiBjE,UAAWmE,GAClEhC,EAAYnC,UAAUmC,YAAcA,EACpC+B,GAASpF,OAAOsF,OAAOjC,EAAYnC,UAAWkE,IAqG9CG,aA1FF,SAAsBC,EAAWC,EAASC,GACxC,IAAIN,EACA9F,EACAqG,EACAC,EAAS,GAEbH,EAAUA,GAAW,GAErB,EAAG,CAGD,IADAnG,GADA8F,EAAQpF,OAAO6F,oBAAoBL,IACzBxC,OACH1D,KAAM,GAENsG,EADLD,EAAOP,EAAM9F,MAEXmG,EAAQE,GAAQH,EAAUG,GAC1BC,EAAOD,IAAQ,GAGnBH,EAAYxF,OAAOsC,eAAekD,SAC3BA,KAAeE,GAAUA,EAAOF,EAAWC,KAAaD,IAAcxF,OAAOkB,WAEtF,OAAOuE,GAsEPjE,OAAQA,EACRK,WAAYA,EACZiE,SA9DF,SAAkBpE,EAAKqE,EAAcC,GACnCtE,EAAMuE,OAAOvE,SACIwE,IAAbF,GAA0BA,EAAWtE,EAAIsB,UAC3CgD,EAAWtE,EAAIsB,QAEjBgD,GAAYD,EAAa/C,OACzB,IAAImD,EAAYzE,EAAI0E,QAAQL,EAAcC,GAC1C,OAAsB,IAAfG,GAAoBA,IAAcH,GAwDzCK,QA/CF,SAAiB5E,GACf,IAAKA,EAAO,OAAO,KACnB,IAAInC,EAAImC,EAAMuB,OACd,GAAId,EAAY5C,GAAI,OAAO,KAE3B,IADA,IAAIgH,EAAM,IAAIrE,MAAM3C,GACbA,KAAM,GACXgH,EAAIhH,GAAKmC,EAAMnC,GAEjB,OAAOgH,GAwCPpD,aAAcA,EACdR,WAAYA,I,6BCldd,IAAI6D,EAAQ,EAAQ,GAYpB,SAASC,EAAWC,EAASC,EAAMC,EAAQC,EAASC,GAClDC,MAAMrH,KAAKP,MACXA,KAAKuH,QAAUA,EACfvH,KAAKW,KAAO,aACZ6G,IAASxH,KAAKwH,KAAOA,GACrBC,IAAWzH,KAAKyH,OAASA,GACzBC,IAAY1H,KAAK0H,QAAUA,GAC3BC,IAAa3H,KAAK2H,SAAWA,GAG/BN,EAAMrB,SAASsB,EAAYM,MAAO,CAChCC,OAAQ,WACN,MAAO,CAELN,QAASvH,KAAKuH,QACd5G,KAAMX,KAAKW,KAEXmH,YAAa9H,KAAK8H,YAClBC,OAAQ/H,KAAK+H,OAEbC,SAAUhI,KAAKgI,SACfC,WAAYjI,KAAKiI,WACjBC,aAAclI,KAAKkI,aACnBC,MAAOnI,KAAKmI,MAEZV,OAAQzH,KAAKyH,OACbD,KAAMxH,KAAKwH,KACXY,OAAQpI,KAAK2H,UAAY3H,KAAK2H,SAASS,OAASpI,KAAK2H,SAASS,OAAS,SAK7E,IAAIpG,EAAYsF,EAAWtF,UACvBmE,EAAc,GAElB,CACE,uBACA,iBACA,eACA,YACA,cACA,4BACA,iBACA,mBACA,kBACA,gBAEAxC,SAAQ,SAAS6D,GACjBrB,EAAYqB,GAAQ,CAACnG,MAAOmG,MAG9B1G,OAAOuH,iBAAiBf,EAAYnB,GACpCrF,OAAOC,eAAeiB,EAAW,eAAgB,CAACX,OAAO,IAGzDiG,EAAWgB,KAAO,SAASC,EAAOf,EAAMC,EAAQC,EAASC,EAAUa,GACjE,IAAIC,EAAa3H,OAAOY,OAAOM,GAY/B,OAVAqF,EAAMhB,aAAakC,EAAOE,GAAY,SAAgB7E,GACpD,OAAOA,IAAQgE,MAAM5F,aAGvBsF,EAAW/G,KAAKkI,EAAYF,EAAMhB,QAASC,EAAMC,EAAQC,EAASC,GAElEc,EAAW9H,KAAO4H,EAAM5H,KAExB6H,GAAe1H,OAAOsF,OAAOqC,EAAYD,GAElCC,GAGT5I,EAAOD,QAAU0H,G,6BCnFjB,IAAIA,EAAa,EAAQ,GASzB,SAASoB,EAAcnB,GAErBD,EAAW/G,KAAKP,KAAiB,MAAXuH,EAAkB,WAAaA,EAASD,EAAWqB,cACzE3I,KAAKW,KAAO,gBAXF,EAAQ,GAcdqF,SAAS0C,EAAepB,EAAY,CACxCsB,YAAY,IAGd/I,EAAOD,QAAU8I,G,6BCnBjB,IAAIrB,EAAQ,EAAQ,GAChBwB,EAAsB,EAAQ,IAC9BvB,EAAa,EAAQ,GACrBwB,EAAuB,EAAQ,GAC/BC,EAAa,EAAQ,GAErBC,EAAuB,CACzB,eAAgB,qCAGlB,SAASC,EAAsBC,EAAS7H,IACjCgG,EAAMrE,YAAYkG,IAAY7B,EAAMrE,YAAYkG,EAAQ,mBAC3DA,EAAQ,gBAAkB7H,GA+B9B,IA1BM8H,EA0BFC,EAAW,CAEbC,aAAcP,EAEdK,UA7B8B,oBAAnBG,gBAGmB,oBAAZC,SAAuE,qBAA5CzI,OAAOkB,UAAUK,SAAS9B,KAAKgJ,YAD1EJ,EAAU,EAAQ,IAKbA,GAwBPK,iBAAkB,CAAC,SAA0BC,EAAMP,GAIjD,GAHAL,EAAoBK,EAAS,UAC7BL,EAAoBK,EAAS,gBAEzB7B,EAAMjD,WAAWqF,IACnBpC,EAAMpE,cAAcwG,IACpBpC,EAAMnD,SAASuF,IACfpC,EAAMzC,SAAS6E,IACfpC,EAAM/D,OAAOmG,IACbpC,EAAM9D,OAAOkG,GAEb,OAAOA,EAET,GAAIpC,EAAM/C,kBAAkBmF,GAC1B,OAAOA,EAAKhF,OAEd,GAAI4C,EAAM3D,kBAAkB+F,GAE1B,OADAR,EAAsBC,EAAS,mDACxBO,EAAKpH,WAGd,IAGImB,EAHAkG,EAAkBrC,EAAMnE,SAASuG,GACjCE,EAAcT,GAAWA,EAAQ,gBAIrC,IAAK1F,EAAa6D,EAAM7D,WAAWiG,KAAWC,GAAmC,wBAAhBC,EAAwC,CACvG,IAAIC,EAAY5J,KAAK6J,KAAO7J,KAAK6J,IAAIxF,SACrC,OAAO0E,EAAWvF,EAAa,CAAC,UAAWiG,GAAQA,EAAMG,GAAa,IAAIA,GACrE,OAAIF,GAAmC,qBAAhBC,GAC5BV,EAAsBC,EAAS,oBAnDrC,SAAyBY,EAAUC,EAAQC,GACzC,GAAI3C,EAAM3C,SAASoF,GACjB,IAEE,OADCC,GAAUE,KAAKC,OAAOJ,GAChBzC,EAAM1B,KAAKmE,GAClB,MAAOK,GACP,GAAe,gBAAXA,EAAExJ,KACJ,MAAMwJ,EAKZ,OAAQH,GAAWC,KAAKG,WAAWN,GAwCxBO,CAAgBZ,IAGlBA,IAGTa,kBAAmB,CAAC,SAA2Bb,GAC7C,IAAIJ,EAAerJ,KAAKqJ,cAAgBD,EAASC,aAC7CkB,EAAoBlB,GAAgBA,EAAakB,kBACjDC,EAAoBnB,GAAgBA,EAAamB,kBACjDC,GAAqBF,GAA2C,SAAtBvK,KAAK0K,aAEnD,GAAID,GAAsBD,GAAqBnD,EAAM3C,SAAS+E,IAASA,EAAK3F,OAC1E,IACE,OAAOmG,KAAKC,MAAMT,GAClB,MAAOU,GACP,GAAIM,EAAmB,CACrB,GAAe,gBAAXN,EAAExJ,KACJ,MAAM2G,EAAWgB,KAAK6B,EAAG7C,EAAWqD,iBAAkB3K,KAAM,KAAMA,KAAK2H,UAEzE,MAAMwC,GAKZ,OAAOV,IAOTmB,QAAS,EAETC,eAAgB,aAChBC,eAAgB,eAEhBC,kBAAmB,EACnBC,eAAgB,EAEhBnB,IAAK,CACHxF,SAAU,EAAQ,KAGpB4G,eAAgB,SAAwB7C,GACtC,OAAOA,GAAU,KAAOA,EAAS,KAGnCc,QAAS,CACPgC,OAAQ,CACN,OAAU,uCAKhB7D,EAAM1D,QAAQ,CAAC,SAAU,MAAO,SAAS,SAA6BwH,GACpE/B,EAASF,QAAQiC,GAAU,MAG7B9D,EAAM1D,QAAQ,CAAC,OAAQ,MAAO,UAAU,SAA+BwH,GACrE/B,EAASF,QAAQiC,GAAU9D,EAAMlC,MAAM6D,MAGzCnJ,EAAOD,QAAUwJ,G,6BC/IjBvJ,EAAOD,QAAU,SAAciE,EAAI6B,GACjC,OAAO,WAEL,IADA,IAAI0F,EAAO,IAAIrI,MAAMuC,UAAUxB,QACtB1D,EAAI,EAAGA,EAAIgL,EAAKtH,OAAQ1D,IAC/BgL,EAAKhL,GAAKkF,UAAUlF,GAEtB,OAAOyD,EAAGwH,MAAM3F,EAAS0F,M,6BCN7B,IAAI/D,EAAQ,EAAQ,GAEpB,SAASiE,EAAOxI,GACd,OAAOyI,mBAAmBzI,GACxB8C,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,QAAS,KAUrB/F,EAAOD,QAAU,SAAkB4L,EAAKC,EAAQC,GAE9C,IAAKD,EACH,OAAOD,EAGT,IAAIG,EACJ,GAAID,EACFC,EAAmBD,EAAiBD,QAC/B,GAAIpE,EAAM3D,kBAAkB+H,GACjCE,EAAmBF,EAAOpJ,eACrB,CACL,IAAIuJ,EAAQ,GAEZvE,EAAM1D,QAAQ8H,GAAQ,SAAmB3I,EAAKnB,GACxCmB,UAIAuE,EAAMxE,QAAQC,GAChBnB,GAAY,KAEZmB,EAAM,CAACA,GAGTuE,EAAM1D,QAAQb,GAAK,SAAoB+I,GACjCxE,EAAMhE,OAAOwI,GACfA,EAAIA,EAAEC,cACGzE,EAAMnE,SAAS2I,KACxBA,EAAI5B,KAAKG,UAAUyB,IAErBD,EAAMG,KAAKT,EAAO3J,GAAO,IAAM2J,EAAOO,WAI1CF,EAAmBC,EAAMI,KAAK,KAGhC,GAAIL,EAAkB,CACpB,IAAIM,EAAgBT,EAAItE,QAAQ,MACT,IAAnB+E,IACFT,EAAMA,EAAI/I,MAAM,EAAGwJ,IAGrBT,KAA8B,IAAtBA,EAAItE,QAAQ,KAAc,IAAM,KAAOyE,EAGjD,OAAOH,I,6BClET3L,EAAOD,QAAU,CACf2K,mBAAmB,EACnBC,mBAAmB,EACnB0B,qBAAqB,I,6BCHvB,IAAI7E,EAAQ,EAAQ,GAqEpBxH,EAAOD,QA5DP,SAAoBgE,EAAKuI,GAEvBA,EAAWA,GAAY,IAAI9H,SAE3B,IAAI8D,EAAQ,GAEZ,SAASiE,EAAa/K,GACpB,OAAc,OAAVA,EAAuB,GAEvBgG,EAAMhE,OAAOhC,GACRA,EAAMyK,cAGXzE,EAAMpE,cAAc5B,IAAUgG,EAAMrD,aAAa3C,GAC5B,mBAATgL,KAAsB,IAAIA,KAAK,CAAChL,IAAUiL,OAAOhE,KAAKjH,GAG/DA,EAwCT,OArCA,SAASkL,EAAM9C,EAAM+C,GACnB,GAAInF,EAAMlE,cAAcsG,IAASpC,EAAMxE,QAAQ4G,GAAO,CACpD,IAA6B,IAAzBtB,EAAMjB,QAAQuC,GAChB,MAAM7B,MAAM,kCAAoC4E,GAGlDrE,EAAM4D,KAAKtC,GAEXpC,EAAM1D,QAAQ8F,GAAM,SAAcpI,EAAOM,GACvC,IAAI0F,EAAMrE,YAAY3B,GAAtB,CACA,IACI+F,EADAqF,EAAUD,EAAYA,EAAY,IAAM7K,EAAMA,EAGlD,GAAIN,IAAUmL,GAA8B,iBAAVnL,EAChC,GAAIgG,EAAMT,SAASjF,EAAK,MAEtBN,EAAQ4I,KAAKG,UAAU/I,QAClB,GAAIgG,EAAMT,SAASjF,EAAK,QAAUyF,EAAMC,EAAMF,QAAQ9F,IAK3D,YAHA+F,EAAIzD,SAAQ,SAAS+I,IAClBrF,EAAMrE,YAAY0J,IAAOP,EAASQ,OAAOF,EAASL,EAAaM,OAMtEH,EAAMlL,EAAOoL,OAGftE,EAAMyE,WAENT,EAASQ,OAAOH,EAAWJ,EAAa3C,IAI5C8C,CAAM3I,GAECuI,I,6BClET,IAAI9E,EAAQ,EAAQ,GAChBwF,EAAS,EAAQ,IACjBC,EAAU,EAAQ,IAClBC,EAAW,EAAQ,GACnBC,EAAgB,EAAQ,GACxBC,EAAe,EAAQ,IACvBC,EAAkB,EAAQ,IAC1BpE,EAAuB,EAAQ,GAC/BxB,EAAa,EAAQ,GACrBoB,EAAgB,EAAQ,GACxByE,EAAgB,EAAQ,IAE5BtN,EAAOD,QAAU,SAAoB6H,GACnC,OAAO,IAAI2F,SAAQ,SAA4BC,EAASC,GACtD,IAGIC,EAHAC,EAAc/F,EAAOgC,KACrBgE,EAAiBhG,EAAOyB,QACxBwB,EAAejD,EAAOiD,aAE1B,SAASgD,IACHjG,EAAOkG,aACTlG,EAAOkG,YAAYC,YAAYL,GAG7B9F,EAAOoG,QACTpG,EAAOoG,OAAOC,oBAAoB,QAASP,GAI3ClG,EAAMjD,WAAWoJ,IAAgBnG,EAAMvC,+BAClC2I,EAAe,gBAGxB,IAAI/F,EAAU,IAAI4B,eAGlB,GAAI7B,EAAOsG,KAAM,CACf,IAAIC,EAAWvG,EAAOsG,KAAKC,UAAY,GACnCC,EAAWxG,EAAOsG,KAAKE,SAAWC,SAAS3C,mBAAmB9D,EAAOsG,KAAKE,WAAa,GAC3FR,EAAeU,cAAgB,SAAWC,KAAKJ,EAAW,IAAMC,GAGlE,IAAII,EAAWrB,EAAcvF,EAAO6G,QAAS7G,EAAO+D,KAOpD,SAAS+C,IACP,GAAK7G,EAAL,CAIA,IAAI8G,EAAkB,0BAA2B9G,EAAUuF,EAAavF,EAAQ+G,yBAA2B,KAGvG9G,EAAW,CACb8B,KAHkBiB,GAAiC,SAAjBA,GAA6C,SAAjBA,EACvChD,EAAQC,SAA/BD,EAAQgH,aAGRtG,OAAQV,EAAQU,OAChBuG,WAAYjH,EAAQiH,WACpBzF,QAASsF,EACT/G,OAAQA,EACRC,QAASA,GAGXmF,GAAO,SAAkBxL,GACvBgM,EAAQhM,GACRqM,OACC,SAAiBkB,GAClBtB,EAAOsB,GACPlB,MACC/F,GAGHD,EAAU,MAoEZ,GAnGAA,EAAQmH,KAAKpH,EAAO0D,OAAO2D,cAAe/B,EAASsB,EAAU5G,EAAOgE,OAAQhE,EAAOiE,mBAAmB,GAGtGhE,EAAQkD,QAAUnD,EAAOmD,QA+BrB,cAAelD,EAEjBA,EAAQ6G,UAAYA,EAGpB7G,EAAQqH,mBAAqB,WACtBrH,GAAkC,IAAvBA,EAAQsH,aAQD,IAAnBtH,EAAQU,QAAkBV,EAAQuH,aAAwD,IAAzCvH,EAAQuH,YAAY/H,QAAQ,WAKjFgI,WAAWX,IAKf7G,EAAQyH,QAAU,WACXzH,IAIL4F,EAAO,IAAIhG,EAAW,kBAAmBA,EAAW8H,aAAc3H,EAAQC,IAG1EA,EAAU,OAIZA,EAAQ2H,QAAU,WAGhB/B,EAAO,IAAIhG,EAAW,gBAAiBA,EAAWgI,YAAa7H,EAAQC,EAASA,IAGhFA,EAAU,MAIZA,EAAQ6H,UAAY,WAClB,IAAIC,EAAsB/H,EAAOmD,QAAU,cAAgBnD,EAAOmD,QAAU,cAAgB,mBACxFvB,EAAe5B,EAAO4B,cAAgBP,EACtCrB,EAAO+H,sBACTA,EAAsB/H,EAAO+H,qBAE/BlC,EAAO,IAAIhG,EACTkI,EACAnG,EAAa6C,oBAAsB5E,EAAWmI,UAAYnI,EAAW8H,aACrE3H,EACAC,IAGFA,EAAU,MAMRL,EAAMvC,uBAAwB,CAEhC,IAAI4K,GAAajI,EAAOkI,iBAAmBzC,EAAgBmB,KAAc5G,EAAOoD,eAC9EiC,EAAQ8C,KAAKnI,EAAOoD,qBACpB7D,EAEE0I,IACFjC,EAAehG,EAAOqD,gBAAkB4E,GAKxC,qBAAsBhI,GACxBL,EAAM1D,QAAQ8J,GAAgB,SAA0B3K,EAAKnB,QAChC,IAAhB6L,GAAqD,iBAAtB7L,EAAIe,qBAErC+K,EAAe9L,GAGtB+F,EAAQmI,iBAAiBlO,EAAKmB,MAM/BuE,EAAMrE,YAAYyE,EAAOkI,mBAC5BjI,EAAQiI,kBAAoBlI,EAAOkI,iBAIjCjF,GAAiC,SAAjBA,IAClBhD,EAAQgD,aAAejD,EAAOiD,cAIS,mBAA9BjD,EAAOqI,oBAChBpI,EAAQqI,iBAAiB,WAAYtI,EAAOqI,oBAIP,mBAA5BrI,EAAOuI,kBAAmCtI,EAAQuI,QAC3DvI,EAAQuI,OAAOF,iBAAiB,WAAYtI,EAAOuI,mBAGjDvI,EAAOkG,aAAelG,EAAOoG,UAG/BN,EAAa,SAAS2C,GACfxI,IAGL4F,GAAQ4C,GAAWA,GAAUA,EAAOtN,KAAQ,IAAI8F,EAAkBwH,GAClExI,EAAQyI,QACRzI,EAAU,OAGZD,EAAOkG,aAAelG,EAAOkG,YAAYyC,UAAU7C,GAC/C9F,EAAOoG,SACTpG,EAAOoG,OAAOwC,QAAU9C,IAAe9F,EAAOoG,OAAOkC,iBAAiB,QAASxC,KAI9EC,IACHA,EAAc,MAGhB,IAAI8C,EAAWnD,EAAckB,GAEzBiC,IAA+D,IAAnD,CAAE,OAAQ,QAAS,QAASpJ,QAAQoJ,GAClDhD,EAAO,IAAIhG,EAAW,wBAA0BgJ,EAAW,IAAKhJ,EAAWiJ,gBAAiB9I,IAM9FC,EAAQ8I,KAAKhD,Q,6BCzNjB,IAAIiD,EAAgB,EAAQ,IACxBC,EAAc,EAAQ,IAW1B7Q,EAAOD,QAAU,SAAuB0O,EAASqC,GAC/C,OAAIrC,IAAYmC,EAAcE,GACrBD,EAAYpC,EAASqC,GAEvBA,I,6BChBT9Q,EAAOD,QAAU,SAAkByB,GACjC,SAAUA,IAASA,EAAMuH,c,6BCD3B,IAAIvB,EAAQ,EAAQ,GAUpBxH,EAAOD,QAAU,SAAqBgR,EAASC,GAE7CA,EAAUA,GAAW,GACrB,IAAIpJ,EAAS,GAEb,SAASqJ,EAAeC,EAAQC,GAC9B,OAAI3J,EAAMlE,cAAc4N,IAAW1J,EAAMlE,cAAc6N,GAC9C3J,EAAMlC,MAAM4L,EAAQC,GAClB3J,EAAMlE,cAAc6N,GACtB3J,EAAMlC,MAAM,GAAI6L,GACd3J,EAAMxE,QAAQmO,GAChBA,EAAOvO,QAETuO,EAIT,SAASC,EAAoBxK,GAC3B,OAAKY,EAAMrE,YAAY6N,EAAQpK,IAEnBY,EAAMrE,YAAY4N,EAAQnK,SAA/B,EACEqK,OAAe9J,EAAW4J,EAAQnK,IAFlCqK,EAAeF,EAAQnK,GAAOoK,EAAQpK,IAOjD,SAASyK,EAAiBzK,GACxB,IAAKY,EAAMrE,YAAY6N,EAAQpK,IAC7B,OAAOqK,OAAe9J,EAAW6J,EAAQpK,IAK7C,SAAS0K,EAAiB1K,GACxB,OAAKY,EAAMrE,YAAY6N,EAAQpK,IAEnBY,EAAMrE,YAAY4N,EAAQnK,SAA/B,EACEqK,OAAe9J,EAAW4J,EAAQnK,IAFlCqK,OAAe9J,EAAW6J,EAAQpK,IAO7C,SAAS2K,EAAgB3K,GACvB,OAAIA,KAAQoK,EACHC,EAAeF,EAAQnK,GAAOoK,EAAQpK,IACpCA,KAAQmK,EACVE,OAAe9J,EAAW4J,EAAQnK,SADpC,EAKT,IAAI4K,EAAW,CACb,IAAOH,EACP,OAAUA,EACV,KAAQA,EACR,QAAWC,EACX,iBAAoBA,EACpB,kBAAqBA,EACrB,iBAAoBA,EACpB,QAAWA,EACX,eAAkBA,EAClB,gBAAmBA,EACnB,QAAWA,EACX,aAAgBA,EAChB,eAAkBA,EAClB,eAAkBA,EAClB,iBAAoBA,EACpB,mBAAsBA,EACtB,WAAcA,EACd,iBAAoBA,EACpB,cAAiBA,EACjB,eAAkBA,EAClB,UAAaA,EACb,UAAaA,EACb,WAAcA,EACd,YAAeA,EACf,WAAcA,EACd,iBAAoBA,EACpB,eAAkBC,GASpB,OANA/J,EAAM1D,QAAQ7C,OAAOwQ,KAAKV,GAASW,OAAOzQ,OAAOwQ,KAAKT,KAAW,SAA4BpK,GAC3F,IAAItB,EAAQkM,EAAS5K,IAASwK,EAC1BO,EAAcrM,EAAMsB,GACvBY,EAAMrE,YAAYwO,IAAgBrM,IAAUiM,IAAqB3J,EAAOhB,GAAQ+K,MAG5E/J,I,cClGT5H,EAAOD,QAAU,CACf,QAAW,W,gBCDbC,EAAOD,QAAU,EAAQ,K,6BCEzB,IAAIyH,EAAQ,EAAQ,GAChBzF,EAAO,EAAQ,GACf6P,EAAQ,EAAQ,IAChBC,EAAc,EAAQ,IA4B1B,IAAIC,EAnBJ,SAASC,EAAeC,GACtB,IAAIC,EAAU,IAAIL,EAAMI,GACpBE,EAAWnQ,EAAK6P,EAAMzP,UAAU0F,QAASoK,GAa7C,OAVAzK,EAAM9B,OAAOwM,EAAUN,EAAMzP,UAAW8P,GAGxCzK,EAAM9B,OAAOwM,EAAUD,GAGvBC,EAASrQ,OAAS,SAAgBsQ,GAChC,OAAOJ,EAAeF,EAAYG,EAAeG,KAG5CD,EAIGH,CA3BG,EAAQ,IA8BvBD,EAAMF,MAAQA,EAGdE,EAAMjJ,cAAgB,EAAQ,GAC9BiJ,EAAMM,YAAc,EAAQ,IAC5BN,EAAMO,SAAW,EAAQ,IACzBP,EAAMQ,QAAU,EAAQ,IAAcC,QACtCT,EAAM5I,WAAa,EAAQ,GAG3B4I,EAAMrK,WAAa,EAAQ,GAG3BqK,EAAMU,OAASV,EAAMjJ,cAGrBiJ,EAAMW,IAAM,SAAaC,GACvB,OAAOnF,QAAQkF,IAAIC,IAErBZ,EAAMa,OAAS,EAAQ,IAGvBb,EAAMc,aAAe,EAAQ,IAE7B5S,EAAOD,QAAU+R,EAGjB9R,EAAOD,QAAQ8S,QAAUf,G,6BC7DzB,IAAItK,EAAQ,EAAQ,GAChB0F,EAAW,EAAQ,GACnB4F,EAAqB,EAAQ,IAC7BC,EAAkB,EAAQ,IAC1BlB,EAAc,EAAQ,IACtB1E,EAAgB,EAAQ,GACxB6F,EAAY,EAAQ,IAEpBC,EAAaD,EAAUC,WAM3B,SAASrB,EAAMO,GACbhS,KAAKoJ,SAAW4I,EAChBhS,KAAK+S,aAAe,CAClBrL,QAAS,IAAIiL,EACbhL,SAAU,IAAIgL,GASlBlB,EAAMzP,UAAU0F,QAAU,SAAiBsL,EAAavL,GAG3B,iBAAhBuL,GACTvL,EAASA,GAAU,IACZ+D,IAAMwH,EAEbvL,EAASuL,GAAe,IAG1BvL,EAASiK,EAAY1R,KAAKoJ,SAAU3B,IAGzB0D,OACT1D,EAAO0D,OAAS1D,EAAO0D,OAAOzI,cACrB1C,KAAKoJ,SAAS+B,OACvB1D,EAAO0D,OAASnL,KAAKoJ,SAAS+B,OAAOzI,cAErC+E,EAAO0D,OAAS,MAGlB,IAAI9B,EAAe5B,EAAO4B,kBAELrC,IAAjBqC,GACFwJ,EAAUI,cAAc5J,EAAc,CACpCkB,kBAAmBuI,EAAWzJ,aAAayJ,EAAWI,SACtD1I,kBAAmBsI,EAAWzJ,aAAayJ,EAAWI,SACtDhH,oBAAqB4G,EAAWzJ,aAAayJ,EAAWI,WACvD,GAIL,IAAIC,EAA0B,GAC1BC,GAAiC,EACrCpT,KAAK+S,aAAarL,QAAQ/D,SAAQ,SAAoC0P,GACjC,mBAAxBA,EAAYC,UAA0D,IAAhCD,EAAYC,QAAQ7L,KAIrE2L,EAAiCA,GAAkCC,EAAYE,YAE/EJ,EAAwBK,QAAQH,EAAYI,UAAWJ,EAAYK,cAGrE,IAKIC,EALAC,EAA2B,GAO/B,GANA5T,KAAK+S,aAAapL,SAAShE,SAAQ,SAAkC0P,GACnEO,EAAyB7H,KAAKsH,EAAYI,UAAWJ,EAAYK,cAK9DN,EAAgC,CACnC,IAAIS,EAAQ,CAACjB,OAAiB5L,GAM9B,IAJAjE,MAAMf,UAAUwR,QAAQnI,MAAMwI,EAAOV,GACrCU,EAAQA,EAAMtC,OAAOqC,GAErBD,EAAUvG,QAAQC,QAAQ5F,GACnBoM,EAAM/P,QACX6P,EAAUA,EAAQG,KAAKD,EAAME,QAASF,EAAME,SAG9C,OAAOJ,EAKT,IADA,IAAIK,EAAYvM,EACT0L,EAAwBrP,QAAQ,CACrC,IAAImQ,EAAcd,EAAwBY,QACtCG,EAAaf,EAAwBY,QACzC,IACEC,EAAYC,EAAYD,GACxB,MAAOzL,GACP2L,EAAW3L,GACX,OAIJ,IACEoL,EAAUf,EAAgBoB,GAC1B,MAAOzL,GACP,OAAO6E,QAAQE,OAAO/E,GAGxB,KAAOqL,EAAyB9P,QAC9B6P,EAAUA,EAAQG,KAAKF,EAAyBG,QAASH,EAAyBG,SAGpF,OAAOJ,GAGTlC,EAAMzP,UAAUmS,OAAS,SAAgB1M,GACvCA,EAASiK,EAAY1R,KAAKoJ,SAAU3B,GACpC,IAAI4G,EAAWrB,EAAcvF,EAAO6G,QAAS7G,EAAO+D,KACpD,OAAOuB,EAASsB,EAAU5G,EAAOgE,OAAQhE,EAAOiE,mBAIlDrE,EAAM1D,QAAQ,CAAC,SAAU,MAAO,OAAQ,YAAY,SAA6BwH,GAE/EsG,EAAMzP,UAAUmJ,GAAU,SAASK,EAAK/D,GACtC,OAAOzH,KAAK0H,QAAQgK,EAAYjK,GAAU,GAAI,CAC5C0D,OAAQA,EACRK,IAAKA,EACL/B,MAAOhC,GAAU,IAAIgC,YAK3BpC,EAAM1D,QAAQ,CAAC,OAAQ,MAAO,UAAU,SAA+BwH,GAGrE,SAASiJ,EAAmBC,GAC1B,OAAO,SAAoB7I,EAAK/B,EAAMhC,GACpC,OAAOzH,KAAK0H,QAAQgK,EAAYjK,GAAU,GAAI,CAC5C0D,OAAQA,EACRjC,QAASmL,EAAS,CAChB,eAAgB,uBACd,GACJ7I,IAAKA,EACL/B,KAAMA,MAKZgI,EAAMzP,UAAUmJ,GAAUiJ,IAE1B3C,EAAMzP,UAAUmJ,EAAS,QAAUiJ,GAAmB,MAGxDvU,EAAOD,QAAU6R,G,6BC7JjB,IAAIpK,EAAQ,EAAQ,GAEpB,SAASsL,IACP3S,KAAKsU,SAAW,GAWlB3B,EAAmB3Q,UAAUuS,IAAM,SAAad,EAAWC,EAAUc,GAOnE,OANAxU,KAAKsU,SAASvI,KAAK,CACjB0H,UAAWA,EACXC,SAAUA,EACVH,cAAaiB,GAAUA,EAAQjB,YAC/BD,QAASkB,EAAUA,EAAQlB,QAAU,OAEhCtT,KAAKsU,SAASxQ,OAAS,GAQhC6O,EAAmB3Q,UAAUyS,MAAQ,SAAeC,GAC9C1U,KAAKsU,SAASI,KAChB1U,KAAKsU,SAASI,GAAM,OAYxB/B,EAAmB3Q,UAAU2B,QAAU,SAAiBE,GACtDwD,EAAM1D,QAAQ3D,KAAKsU,UAAU,SAAwBK,GACzC,OAANA,GACF9Q,EAAG8Q,OAKT9U,EAAOD,QAAU+S,G,6BCnDjB,IAAItL,EAAQ,EAAQ,GAChBuN,EAAgB,EAAQ,IACxB1C,EAAW,EAAQ,IACnB9I,EAAW,EAAQ,GACnBV,EAAgB,EAAQ,GAK5B,SAASmM,EAA6BpN,GAKpC,GAJIA,EAAOkG,aACTlG,EAAOkG,YAAYmH,mBAGjBrN,EAAOoG,QAAUpG,EAAOoG,OAAOwC,QACjC,MAAM,IAAI3H,EAUd7I,EAAOD,QAAU,SAAyB6H,GA8BxC,OA7BAoN,EAA6BpN,GAG7BA,EAAOyB,QAAUzB,EAAOyB,SAAW,GAGnCzB,EAAOgC,KAAOmL,EAAcrU,KAC1BkH,EACAA,EAAOgC,KACPhC,EAAOyB,QACPzB,EAAO+B,kBAIT/B,EAAOyB,QAAU7B,EAAMlC,MACrBsC,EAAOyB,QAAQgC,QAAU,GACzBzD,EAAOyB,QAAQzB,EAAO0D,SAAW,GACjC1D,EAAOyB,SAGT7B,EAAM1D,QACJ,CAAC,SAAU,MAAO,OAAQ,OAAQ,MAAO,QAAS,WAClD,SAA2BwH,UAClB1D,EAAOyB,QAAQiC,OAIZ1D,EAAO0B,SAAWC,EAASD,SAE1B1B,GAAQqM,MAAK,SAA6BnM,GAWvD,OAVAkN,EAA6BpN,GAG7BE,EAAS8B,KAAOmL,EAAcrU,KAC5BkH,EACAE,EAAS8B,KACT9B,EAASuB,QACTzB,EAAO6C,mBAGF3C,KACN,SAA4BoN,GAe7B,OAdK7C,EAAS6C,KACZF,EAA6BpN,GAGzBsN,GAAUA,EAAOpN,WACnBoN,EAAOpN,SAAS8B,KAAOmL,EAAcrU,KACnCkH,EACAsN,EAAOpN,SAAS8B,KAChBsL,EAAOpN,SAASuB,QAChBzB,EAAO6C,qBAKN8C,QAAQE,OAAOyH,Q,6BClF1B,IAAI1N,EAAQ,EAAQ,GAChB+B,EAAW,EAAQ,GAUvBvJ,EAAOD,QAAU,SAAuB6J,EAAMP,EAAS8L,GACrD,IAAIlD,EAAU9R,MAAQoJ,EAMtB,OAJA/B,EAAM1D,QAAQqR,GAAK,SAAmBnR,GACpC4F,EAAO5F,EAAGtD,KAAKuR,EAASrI,EAAMP,MAGzBO,I,6BClBT,IAAIpC,EAAQ,EAAQ,GAEpBxH,EAAOD,QAAU,SAA6BsJ,EAAS+L,GACrD5N,EAAM1D,QAAQuF,GAAS,SAAuB7H,EAAOV,GAC/CA,IAASsU,GAAkBtU,EAAKmO,gBAAkBmG,EAAenG,gBACnE5F,EAAQ+L,GAAkB5T,SACnB6H,EAAQvI,S,6BCNrB,IAAI2G,EAAa,EAAQ,GASzBzH,EAAOD,QAAU,SAAgByN,EAASC,EAAQ3F,GAChD,IAAIsD,EAAiBtD,EAASF,OAAOwD,eAChCtD,EAASS,QAAW6C,IAAkBA,EAAetD,EAASS,QAGjEkF,EAAO,IAAIhG,EACT,mCAAqCK,EAASS,OAC9C,CAACd,EAAWiJ,gBAAiBjJ,EAAWqD,kBAAkBuK,KAAKC,MAAMxN,EAASS,OAAS,KAAO,GAC9FT,EAASF,OACTE,EAASD,QACTC,IAPF0F,EAAQ1F,K,6BCZZ,IAAIN,EAAQ,EAAQ,GAEpBxH,EAAOD,QACLyH,EAAMvC,uBAIK,CACLsQ,MAAO,SAAezU,EAAMU,EAAOgU,EAASC,EAAMC,EAAQC,GACxD,IAAIC,EAAS,GACbA,EAAO1J,KAAKpL,EAAO,IAAM4K,mBAAmBlK,IAExCgG,EAAM1C,SAAS0Q,IACjBI,EAAO1J,KAAK,WAAa,IAAI2J,KAAKL,GAASM,eAGzCtO,EAAM3C,SAAS4Q,IACjBG,EAAO1J,KAAK,QAAUuJ,GAGpBjO,EAAM3C,SAAS6Q,IACjBE,EAAO1J,KAAK,UAAYwJ,IAGX,IAAXC,GACFC,EAAO1J,KAAK,UAGd7G,SAASuQ,OAASA,EAAOzJ,KAAK,OAGhC4D,KAAM,SAAcjP,GAClB,IAAIiV,EAAQ1Q,SAASuQ,OAAOG,MAAM,IAAIC,OAAO,aAAelV,EAAO,cACnE,OAAQiV,EAAQE,mBAAmBF,EAAM,IAAM,MAGjDG,OAAQ,SAAgBpV,GACtBX,KAAKoV,MAAMzU,EAAM,GAAI+U,KAAKM,MAAQ,SAO/B,CACLZ,MAAO,aACPxF,KAAM,WAAkB,OAAO,MAC/BmG,OAAQ,e,6BCzChBlW,EAAOD,QAAU,SAAuB4L,GAItC,MAAO,8BAA8ByK,KAAKzK,K,6BCH5C3L,EAAOD,QAAU,SAAqB0O,EAAS4H,GAC7C,OAAOA,EACH5H,EAAQ1I,QAAQ,OAAQ,IAAM,IAAMsQ,EAAYtQ,QAAQ,OAAQ,IAChE0I,I,6BCVN,IAAIjH,EAAQ,EAAQ,GAIhB8O,EAAoB,CACtB,MAAO,gBAAiB,iBAAkB,eAAgB,OAC1D,UAAW,OAAQ,OAAQ,oBAAqB,sBAChD,gBAAiB,WAAY,eAAgB,sBAC7C,UAAW,cAAe,cAgB5BtW,EAAOD,QAAU,SAAsBsJ,GACrC,IACIvH,EACAmB,EACA1C,EAHAgW,EAAS,GAKb,OAAKlN,GAEL7B,EAAM1D,QAAQuF,EAAQmN,MAAM,OAAO,SAAgBC,GAKjD,GAJAlW,EAAIkW,EAAKpP,QAAQ,KACjBvF,EAAM0F,EAAM1B,KAAK2Q,EAAKC,OAAO,EAAGnW,IAAIsC,cACpCI,EAAMuE,EAAM1B,KAAK2Q,EAAKC,OAAOnW,EAAI,IAE7BuB,EAAK,CACP,GAAIyU,EAAOzU,IAAQwU,EAAkBjP,QAAQvF,IAAQ,EACnD,OAGAyU,EAAOzU,GADG,eAARA,GACayU,EAAOzU,GAAOyU,EAAOzU,GAAO,IAAI4P,OAAO,CAACzO,IAEzCsT,EAAOzU,GAAOyU,EAAOzU,GAAO,KAAOmB,EAAMA,MAKtDsT,GAnBgBA,I,6BC9BzB,IAAI/O,EAAQ,EAAQ,GAEpBxH,EAAOD,QACLyH,EAAMvC,uBAIJ,WACE,IAEI0R,EAFAC,EAAO,kBAAkBR,KAAKlR,UAAU2R,WACxCC,EAAiBzR,SAAS0R,cAAc,KAS5C,SAASC,EAAWrL,GAClB,IAAIsL,EAAOtL,EAWX,OATIiL,IAEFE,EAAeI,aAAa,OAAQD,GACpCA,EAAOH,EAAeG,MAGxBH,EAAeI,aAAa,OAAQD,GAG7B,CACLA,KAAMH,EAAeG,KACrBxG,SAAUqG,EAAerG,SAAWqG,EAAerG,SAAS1K,QAAQ,KAAM,IAAM,GAChFoR,KAAML,EAAeK,KACrBC,OAAQN,EAAeM,OAASN,EAAeM,OAAOrR,QAAQ,MAAO,IAAM,GAC3EsR,KAAMP,EAAeO,KAAOP,EAAeO,KAAKtR,QAAQ,KAAM,IAAM,GACpEuR,SAAUR,EAAeQ,SACzBC,KAAMT,EAAeS,KACrBC,SAAiD,MAAtCV,EAAeU,SAASC,OAAO,GACxCX,EAAeU,SACf,IAAMV,EAAeU,UAY3B,OARAb,EAAYK,EAAW5R,OAAOsS,SAAST,MAQhC,SAAyBU,GAC9B,IAAIpB,EAAU/O,EAAM3C,SAAS8S,GAAeX,EAAWW,GAAcA,EACrE,OAAQpB,EAAO9F,WAAakG,EAAUlG,UAClC8F,EAAOY,OAASR,EAAUQ,MAhDlC,GAsDS,WACL,OAAO,I,6BC9DfnX,EAAOD,QAAU,SAAuB4L,GACtC,IAAIoK,EAAQ,4BAA4B6B,KAAKjM,GAC7C,OAAOoK,GAASA,EAAM,IAAM,K,cCH9B/V,EAAOD,QAAU,M,6BCCjB,IAAIuS,EAAU,EAAQ,IAAeC,QACjC9K,EAAa,EAAQ,GAErBwL,EAAa,GAGjB,CAAC,SAAU,UAAW,SAAU,WAAY,SAAU,UAAUnP,SAAQ,SAASf,EAAMxC,GACrF0S,EAAWlQ,GAAQ,SAAmBL,GACpC,cAAcA,IAAUK,GAAQ,KAAOxC,EAAI,EAAI,KAAO,KAAOwC,MAIjE,IAAI8U,EAAqB,GASzB5E,EAAWzJ,aAAe,SAAsBwJ,EAAWT,EAAS7K,GAClE,SAASoQ,EAAcC,EAAKC,GAC1B,MAAO,WAAa1F,EAAU,0BAA6ByF,EAAM,IAAOC,GAAQtQ,EAAU,KAAOA,EAAU,IAI7G,OAAO,SAASlG,EAAOuW,EAAKE,GAC1B,IAAkB,IAAdjF,EACF,MAAM,IAAIvL,EACRqQ,EAAcC,EAAK,qBAAuBxF,EAAU,OAASA,EAAU,KACvE9K,EAAWyQ,gBAef,OAXI3F,IAAYsF,EAAmBE,KACjCF,EAAmBE,IAAO,EAE1BI,QAAQC,KACNN,EACEC,EACA,+BAAiCxF,EAAU,8CAK1CS,GAAYA,EAAUxR,EAAOuW,EAAKE,KAkC7CjY,EAAOD,QAAU,CACfqT,cAxBF,SAAuBuB,EAAS0D,EAAQC,GACtC,GAAuB,iBAAZ3D,EACT,MAAM,IAAIlN,EAAW,4BAA6BA,EAAW8Q,sBAI/D,IAFA,IAAI9G,EAAOxQ,OAAOwQ,KAAKkD,GACnBpU,EAAIkR,EAAKxN,OACN1D,KAAM,GAAG,CACd,IAAIwX,EAAMtG,EAAKlR,GACXyS,EAAYqF,EAAON,GACvB,GAAI/E,EAAJ,CACE,IAAIxR,EAAQmT,EAAQoD,GAChBxS,OAAmB4B,IAAV3F,GAAuBwR,EAAUxR,EAAOuW,EAAKpD,GAC1D,IAAe,IAAXpP,EACF,MAAM,IAAIkC,EAAW,UAAYsQ,EAAM,YAAcxS,EAAQkC,EAAW8Q,2BAI5E,IAAqB,IAAjBD,EACF,MAAM,IAAI7Q,EAAW,kBAAoBsQ,EAAKtQ,EAAW+Q,kBAO7DvF,WAAYA,I,6BClFd,IAAIpK,EAAgB,EAAQ,GAQ5B,SAASuJ,EAAYqG,GACnB,GAAwB,mBAAbA,EACT,MAAM,IAAIC,UAAU,gCAGtB,IAAIC,EAEJxY,KAAK2T,QAAU,IAAIvG,SAAQ,SAAyBC,GAClDmL,EAAiBnL,KAGnB,IAAIoL,EAAQzY,KAGZA,KAAK2T,QAAQG,MAAK,SAAS5D,GACzB,GAAKuI,EAAMC,WAAX,CAEA,IAAItY,EACAC,EAAIoY,EAAMC,WAAW5U,OAEzB,IAAK1D,EAAI,EAAGA,EAAIC,EAAGD,IACjBqY,EAAMC,WAAWtY,GAAG8P,GAEtBuI,EAAMC,WAAa,SAIrB1Y,KAAK2T,QAAQG,KAAO,SAAS6E,GAC3B,IAAIC,EAEAjF,EAAU,IAAIvG,SAAQ,SAASC,GACjCoL,EAAMrI,UAAU/C,GAChBuL,EAAWvL,KACVyG,KAAK6E,GAMR,OAJAhF,EAAQzD,OAAS,WACfuI,EAAM7K,YAAYgL,IAGbjF,GAGT2E,GAAS,SAAgB/Q,GACnBkR,EAAM1D,SAKV0D,EAAM1D,OAAS,IAAIrM,EAAcnB,GACjCiR,EAAeC,EAAM1D,YAOzB9C,EAAYjQ,UAAU8S,iBAAmB,WACvC,GAAI9U,KAAK+U,OACP,MAAM/U,KAAK+U,QAQf9C,EAAYjQ,UAAUoO,UAAY,SAAmByI,GAC/C7Y,KAAK+U,OACP8D,EAAS7Y,KAAK+U,QAIZ/U,KAAK0Y,WACP1Y,KAAK0Y,WAAW3M,KAAK8M,GAErB7Y,KAAK0Y,WAAa,CAACG,IAQvB5G,EAAYjQ,UAAU4L,YAAc,SAAqBiL,GACvD,GAAK7Y,KAAK0Y,WAAV,CAGA,IAAII,EAAQ9Y,KAAK0Y,WAAWxR,QAAQ2R,IACrB,IAAXC,GACF9Y,KAAK0Y,WAAWK,OAAOD,EAAO,KAQlC7G,EAAYjB,OAAS,WACnB,IAAId,EAIJ,MAAO,CACLuI,MAJU,IAAIxG,GAAY,SAAkBxR,GAC5CyP,EAASzP,KAITyP,OAAQA,IAIZrQ,EAAOD,QAAUqS,G,6BChGjBpS,EAAOD,QAAU,SAAgBoZ,GAC/B,OAAO,SAAc5R,GACnB,OAAO4R,EAAS3N,MAAM,KAAMjE,M,6BCtBhC,IAAIC,EAAQ,EAAQ,GAQpBxH,EAAOD,QAAU,SAAsBqZ,GACrC,OAAO5R,EAAMnE,SAAS+V,KAAsC,IAAzBA,EAAQxG","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n */\n\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function} [filter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if (!merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = Object.getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/*\n * determines whether a string ends with the characters of a specified string\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction endsWith(str, searchString, position) {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object\n * @param {*} [thing]\n * @returns {Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n var i = thing.length;\n if (isUndefined(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nvar prototype = AxiosError.prototype;\nvar descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED'\n// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction CanceledError(message) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isObjectPayload = utils.isObject(data);\n var contentType = headers && headers['Content-Type'];\n\n var isFileList;\n\n if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {\n var _FormData = this.env && this.env.FormData;\n return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());\n } else if (isObjectPayload || contentType === 'application/json') {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: require('./env/FormData')\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData) {\n // eslint-disable-next-line no-param-reassign\n formData = formData || new FormData();\n\n var stack = [];\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n function build(data, parentKey) {\n if (utils.isPlainObject(data) || utils.isArray(data)) {\n if (stack.indexOf(data) !== -1) {\n throw Error('Circular reference detected in ' + parentKey);\n }\n\n stack.push(data);\n\n utils.forEach(data, function each(value, key) {\n if (utils.isUndefined(value)) return;\n var fullKey = parentKey ? parentKey + '.' + key : key;\n var arr;\n\n if (value && !parentKey && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {\n // eslint-disable-next-line func-names\n arr.forEach(function(el) {\n !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));\n });\n return;\n }\n }\n\n build(value, fullKey);\n });\n\n stack.pop();\n } else {\n formData.append(parentKey, convertValue(data));\n }\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.27.2\"\n};","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/AxiosError');\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","// eslint-disable-next-line strict\nmodule.exports = null;\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/a1/a293eb0097fe87875f3bf908cc0b0ee8f15e995c68e984b6a24e247b2e954407d7941ea96abd7fe002a1bdfb713fdfb0d3839d948a334603f05e644829f606 b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/a1/a293eb0097fe87875f3bf908cc0b0ee8f15e995c68e984b6a24e247b2e954407d7941ea96abd7fe002a1bdfb713fdfb0d3839d948a334603f05e644829f606 deleted file mode 100644 index 06166077be4d1..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/a1/a293eb0097fe87875f3bf908cc0b0ee8f15e995c68e984b6a24e247b2e954407d7941ea96abd7fe002a1bdfb713fdfb0d3839d948a334603f05e644829f606 +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/a1/d366a1cd57272e71d5331531d0bb10cb37215748b4b3e509e2f9bd250f37696560a309d9e0724d30088a2baa2e0f8674dafd845eb3f35a76ec302b445293ec b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/a1/d366a1cd57272e71d5331531d0bb10cb37215748b4b3e509e2f9bd250f37696560a309d9e0724d30088a2baa2e0f8674dafd845eb3f35a76ec302b445293ec deleted file mode 100644 index e8e4fc1603835..0000000000000 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies-pnpm.js.snapshot/asset.a343904202d7c998eb5411d4fae053e829aa44a82bc9a60c3dc0d7c63dd71a19/.pnpm-store/v3/files/a1/d366a1cd57272e71d5331531d0bb10cb37215748b4b3e509e2f9bd250f37696560a309d9e0724d30088a2baa2e0f8674dafd845eb3f35a76ec302b445293ec +++ /dev/null @@ -1,3 +0,0 @@ -/* axios v0.27.2 | (c) 2022 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){"use strict";var r,o=n(4),i=Object.prototype.toString,s=(r=Object.create(null),function(e){var t=i.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return s(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var f=a("ArrayBuffer");function l(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==s(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var d=a("Date"),h=a("File"),m=a("Blob"),v=a("FileList");function y(e){return"[object Function]"===i.call(e)}var g=a("URLSearchParams");function E(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n0;)s[i=r[o]]||(t[i]=e[i],s[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:O,isFileList:v}},function(e,t,n){"use strict";var r=n(0);function o(e,t,n,r,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}r.inherits(o,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var i=o.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){s[e]={value:e}})),Object.defineProperties(o,s),Object.defineProperty(i,"isAxiosError",{value:!0}),o.from=function(e,t,n,s,a,u){var c=Object.create(i);return r.toFlatObject(e,c,(function(e){return e!==Error.prototype})),o.call(c,e.message,t,n,s,a),c.name=e.name,u&&Object.assign(c,u),c},e.exports=o},function(e,t,n){"use strict";var r=n(1);function o(e){r.call(this,null==e?"canceled":e,r.ERR_CANCELED),this.name="CanceledError"}n(0).inherits(o,r,{__CANCEL__:!0}),e.exports=o},function(e,t,n){"use strict";var r=n(0),o=n(19),i=n(1),s=n(6),a=n(7),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var f,l={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(f=n(8)),f),transformRequest:[function(e,t){if(o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,i=r.isObject(e),s=t&&t["Content-Type"];if((n=r.isFileList(e))||i&&"multipart/form-data"===s){var u=this.env&&this.env.FormData;return a(n?{"files[]":e}:e,u&&new u)}return i||"application/json"===s?(c(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i.from(e,i.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:n(27)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(u)})),e.exports=l},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},function(e,t){e.exports=null},function(e,t,n){"use strict";var r=n(12).version,o=n(1),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new o(i(r," has been removed"+(t?" in "+t:"")),o.ERR_DEPRECATED);return t&&!s[r]&&(s[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new o("options must be an object",o.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var s=r[i],a=t[s];if(a){var u=e[s],c=void 0===u||a(u,s,e);if(!0!==c)throw new o("option "+s+" must be "+c,o.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new o("Unknown option "+s,o.ERR_BAD_OPTION)}},validators:i}},function(e,t,n){"use strict";var r=n(2);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t { return x; } + public get rootGraph(): Graph { + const root = this.root; + if (!(root instanceof Graph)) { + throw new Error(`Expecting a graph as root, got: ${root}`); + } + return root; + } + public get parentGraph() { return this._parentGraph; } @@ -93,50 +101,103 @@ export class GraphNode { } /** - * A dependency set that can be constructed partially and later finished + * A dependency set that is constructed over time * * It doesn't matter in what order sources and targets for the dependency * relationship(s) get added. This class can serve as a synchronization * point if the order in which graph nodes get added to the graph is not * well-defined. * - * Useful utility during graph building. + * You can think of a DependencyBuilder as a vertex that doesn't actually exist in the tree: + * + * β”Œβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β” + * β”‚ P1 │◀─┐ β”Œβ”€β”€β”‚ S1 β”‚ + * β””β”€β”€β”€β”€β”˜ β”‚ .─. β”‚ β””β”€β”€β”€β”€β”˜ + * β”œβ”€β”€( B )◀── + * β”Œβ”€β”€β”€β”€β” β”‚ `─' β”‚ β”Œβ”€β”€β”€β”€β” + * β”‚ P2 β”‚β—€β”€β”˜ └──│ S2 β”‚ + * β””β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”˜ + * + * Ultimately leads to: { S1 -> P1, S1 -> P2, S2 -> P1, S2 -> P2 }. */ export class DependencyBuilder { - private readonly targets: GraphNode[] = []; - private readonly sources: GraphNode[] = []; + private readonly _producers: GraphNode[] = []; + private readonly _consumers: GraphNode[] = []; + /** + * Add a producer: make all nodes added by 'dependBy' depend on these + */ public dependOn(...targets: GraphNode[]) { for (const target of targets) { - for (const source of this.sources) { + for (const source of this._consumers) { source.dependOn(target); } - this.targets.push(target); + this._producers.push(target); } return this; } + /** + * Add a consumer: make these nodes depend on all nodes added by 'dependOn'. + */ public dependBy(...sources: GraphNode[]) { for (const source of sources) { - for (const target of this.targets) { + for (const target of this._producers) { source.dependOn(target); } - this.sources.push(source); + this._consumers.push(source); } return this; } + + /** + * Whether there are any consumers (nodes added by 'dependBy') but no producers (nodes added by 'dependOn') + */ + public get hasUnsatisfiedConsumers() { + return this._consumers.length > 0 && this._producers.length === 0; + } + + public get consumers(): ReadonlyArray> { + return this._consumers; + } + + public consumersAsString() { + return this.consumers.map(c => `${c}`).join(','); + } } -export class DependencyBuilders { +/** + * A set of dependency builders identified by a given key. + */ +export class DependencyBuilders { private readonly builders = new Map>(); - public get(key: K) { + public for(key: K) { const b = this.builders.get(key); if (b) { return b; } const ret = new DependencyBuilder(); this.builders.set(key, ret); return ret; } + + /** + * @deprecated Use 'for' + */ + public get(key: K) { + return this.for(key); + } + + public unsatisfiedBuilders() { + const ret = new Array<[K, DependencyBuilder]>(); + + for (const [k, builder] of this.builders.entries()) { + if (builder.hasUnsatisfiedConsumers) { + ret.push([k, builder]); + } + } + + return ret; + } } export interface GraphProps extends GraphNodeProps { @@ -304,12 +365,32 @@ export class GraphNodeCollection { this.nodes = Array.from(nodes); } + /** + * Add one or more dependencies to all nodes in the collection + */ public dependOn(...dependencies: Array | undefined>) { for (const node of this.nodes) { node.dependOn(...dependencies.filter(isDefined)); } } + /** + * Return the topographically first node in the collection + */ + public first() { + const nodes = new Set(this.nodes); + const sorted = this.nodes[0].rootGraph.sortedLeaves(); + for (const tranche of sorted) { + for (const node of tranche) { + if (nodes.has(node)) { + return node; + } + } + } + + throw new Error(`Could not calculate first node between ${this}`); + } + /** * Returns the graph node that's shared between these nodes */ @@ -351,6 +432,10 @@ export class GraphNodeCollection { return paths[0][0]; } + + public toString() { + return this.nodes.map(n => `${n}`).join(', '); + } } /** diff --git a/packages/@aws-cdk/pipelines/lib/helpers-internal/pipeline-graph.ts b/packages/@aws-cdk/pipelines/lib/helpers-internal/pipeline-graph.ts index a411a2dfc547a..cc245cd58e4d4 100644 --- a/packages/@aws-cdk/pipelines/lib/helpers-internal/pipeline-graph.ts +++ b/packages/@aws-cdk/pipelines/lib/helpers-internal/pipeline-graph.ts @@ -54,7 +54,9 @@ export class PipelineGraph { private readonly assetNodesByType = new Map(); private readonly synthNode?: AGraphNode; private readonly selfMutateNode?: AGraphNode; - private readonly stackOutputDependencies = new DependencyBuilders(); + private readonly stackOutputDependencies = new DependencyBuilders(); + /** Mapping steps to depbuilders, satisfied by the step itself */ + private readonly nodeDependencies = new DependencyBuilders(); private readonly publishTemplate: boolean; private readonly prepareStep: boolean; private readonly singlePublisher: boolean; @@ -102,8 +104,7 @@ export class PipelineGraph { waves[i].dependOn(waves[i - 1]); } - // Add additional dependencies between steps that depend on stack outputs and the stacks - // that produce them. + this.addMissingDependencyNodes(); } public isSynthNode(node: AGraphNode) { @@ -111,7 +112,7 @@ export class PipelineGraph { } private addBuildStep(step: Step) { - return this.addAndRecurse(step, this.topLevelGraph('Build')); + return this.addStepNode(step, this.topLevelGraph('Build')); } private addWave(wave: Wave): AGraph { @@ -174,7 +175,7 @@ export class PipelineGraph { const cloudAssembly = this.cloudAssemblyFileSet; - firstDeployNode.dependOn(this.addAndRecurse(cloudAssembly.producer, retGraph)); + firstDeployNode.dependOn(this.addStepNode(cloudAssembly.producer, retGraph)); // add the template asset if (this.publishTemplate) { @@ -195,7 +196,7 @@ export class PipelineGraph { // Add stack output synchronization point if (this.queries.stackOutputsReferenced(stack).length > 0) { - this.stackOutputDependencies.get(stack).dependOn(deployNode); + this.stackOutputDependencies.for(stack).dependOn(deployNode); } } @@ -220,7 +221,7 @@ export class PipelineGraph { private addChangeSetNode(changeSet: Step[], prepareNode: AGraphNode, deployNode: AGraphNode, graph: AGraph) { for (const c of changeSet) { - const changeSetNode = this.addAndRecurse(c, graph); + const changeSetNode = this.addStepNode(c, graph); changeSetNode?.dependOn(prepareNode); deployNode.dependOn(changeSetNode); } @@ -230,12 +231,12 @@ export class PipelineGraph { const currentNodes = new GraphNodeCollection(parent.nodes); const preNodes = new GraphNodeCollection(new Array()); for (const p of pre) { - const preNode = this.addAndRecurse(p, parent); + const preNode = this.addStepNode(p, parent); currentNodes.dependOn(preNode); preNodes.nodes.push(preNode!); } for (const p of post) { - const postNode = this.addAndRecurse(p, parent); + const postNode = this.addStepNode(p, parent); postNode?.dependOn(...currentNodes.nodes); } return preNodes; @@ -250,7 +251,12 @@ export class PipelineGraph { return ret as AGraph; } - private addAndRecurse(step: Step, parent: AGraph) { + /** + * Add a Node to a Graph for a given Step + * + * Adds all dependencies for that Node to the same Step as well. + */ + private addStepNode(step: Step, parent: AGraph) { if (step === PipelineGraph.NO_STEP) { return undefined; } const previous = this.added.get(step); @@ -267,21 +273,56 @@ export class PipelineGraph { parent.add(node); this.added.set(step, node); + // This used to recurse -- that's not safe, because it might create nodes in the + // wrong graph (it would create a dependency node, that might need to be created in + // a different graph, in the current one). Instead, use DependencyBuilders. for (const dep of step.dependencies) { - const producerNode = this.addAndRecurse(dep, parent); - node.dependOn(producerNode); + this.nodeDependencies.for(dep).dependBy(node); } + this.nodeDependencies.for(step).dependOn(node); // Add stack dependencies (by use of the dependency builder this also works // if we encounter the Step before the Stack has been properly added yet) for (const output of step.consumedStackOutputs) { const stack = this.queries.producingStack(output); - this.stackOutputDependencies.get(stack).dependBy(node); + this.stackOutputDependencies.for(stack).dependBy(node); } return node; } + /** + * Add dependencies that aren't in the pipeline yet + * + * Build steps reference as many sources (or other builds) as they want, which will be added + * automatically. Do that here. We couldn't do it earlier, because if there were dependencies + * between steps we didn't want to reparent those unnecessarily. + */ + private addMissingDependencyNodes() { + // May need to do this more than once to recursively add all missing producers + let attempts = 20; + while (attempts-- > 0) { + const unsatisfied = this.nodeDependencies.unsatisfiedBuilders().filter(([s]) => s !== PipelineGraph.NO_STEP); + if (unsatisfied.length === 0) { return; } + + for (const [step, builder] of unsatisfied) { + // Add a new node for this step to the parent of the "leftmost" consumer. + const leftMostConsumer = new GraphNodeCollection(builder.consumers).first(); + const parent = leftMostConsumer.parentGraph; + if (!parent) { + throw new Error(`Consumer doesn't have a parent graph: ${leftMostConsumer}`); + } + this.addStepNode(step, parent); + } + } + + const unsatisfied = this.nodeDependencies.unsatisfiedBuilders(); + throw new Error([ + 'Recursion depth too large while adding dependency nodes:', + unsatisfied.map(([step, builder]) => `${builder.consumersAsString()} awaiting ${step}.`), + ].join(' ')); + } + private publishAsset(stackAsset: StackAsset): AGraphNode { const assetsGraph = this.topLevelGraph('Assets'); diff --git a/packages/@aws-cdk/pipelines/test/blueprint/helpers-internal/pipeline-graph.test.ts b/packages/@aws-cdk/pipelines/test/blueprint/helpers-internal/pipeline-graph.test.ts index 747dcfcb91d77..f473d4e0cf001 100644 --- a/packages/@aws-cdk/pipelines/test/blueprint/helpers-internal/pipeline-graph.test.ts +++ b/packages/@aws-cdk/pipelines/test/blueprint/helpers-internal/pipeline-graph.test.ts @@ -340,8 +340,8 @@ describe('with app with output', () => { }); // WHEN - const graph = new PipelineGraph(blueprint).graph; expect(() => { + const graph = new PipelineGraph(blueprint).graph; assertGraph(nodeAt(graph, 'Alpha')).sortedLeaves(); }).toThrow(/Dependency cycle/); }); diff --git a/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline.test.ts b/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline.test.ts index b0ecae2286d1a..246c3173efc0f 100644 --- a/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline.test.ts +++ b/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline.test.ts @@ -8,7 +8,7 @@ import { Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as cdkp from '../../lib'; import { CodePipeline } from '../../lib'; -import { PIPELINE_ENV, TestApp, ModernTestGitHubNpmPipeline, FileAssetApp } from '../testhelpers'; +import { PIPELINE_ENV, TestApp, ModernTestGitHubNpmPipeline, FileAssetApp, TwoStackApp } from '../testhelpers'; let app: TestApp; @@ -81,6 +81,11 @@ describe('Providing codePipeline parameter and prop(s) of codePipeline parameter pipelineName: 'randomName', }).create()).toThrowError('Cannot set \'pipelineName\' if an existing CodePipeline is given using \'codePipeline\''); }); + test('Providing codePipeline parameter and enableKeyRotation parameter should throw error', () => { + expect(() => new CodePipelinePropsCheckTest(app, 'CodePipeline', { + enableKeyRotation: true, + }).create()).toThrowError('Cannot set \'enableKeyRotation\' if an existing CodePipeline is given using \'codePipeline\''); + }); test('Providing codePipeline parameter and crossAccountKeys parameter should throw error', () => { expect(() => new CodePipelinePropsCheckTest(app, 'CodePipeline', { crossAccountKeys: true, @@ -192,6 +197,60 @@ test('CodeBuild action role has the right AssumeRolePolicyDocument', () => { }); }); +test('CodePipeline throws when key rotation is enabled without enabling cross account keys', ()=>{ + const pipelineStack = new cdk.Stack(app, 'PipelineStack', { env: PIPELINE_ENV }); + const repo = new ccommit.Repository(pipelineStack, 'Repo', { + repositoryName: 'MyRepo', + }); + const cdkInput = cdkp.CodePipelineSource.codeCommit( + repo, + 'main', + ); + + expect(() => new CodePipeline(pipelineStack, 'Pipeline', { + enableKeyRotation: true, + synth: new cdkp.ShellStep('Synth', { + input: cdkInput, + installCommands: ['npm ci'], + commands: [ + 'npm run build', + 'npx cdk synth', + ], + }), + }).buildPipeline()).toThrowError('Setting \'enableKeyRotation\' to true also requires \'crossAccountKeys\' to be enabled'); +}); + + +test('CodePipeline enables key rotation on cross account keys', ()=>{ + const pipelineStack = new cdk.Stack(app, 'PipelineStack', { env: PIPELINE_ENV }); + const repo = new ccommit.Repository(pipelineStack, 'Repo', { + repositoryName: 'MyRepo', + }); + const cdkInput = cdkp.CodePipelineSource.codeCommit( + repo, + 'main', + ); + + new CodePipeline(pipelineStack, 'Pipeline', { + enableKeyRotation: true, + crossAccountKeys: true, // requirement of key rotation + synth: new cdkp.ShellStep('Synth', { + input: cdkInput, + installCommands: ['npm ci'], + commands: [ + 'npm run build', + 'npx cdk synth', + ], + }), + }); + + const template = Template.fromStack(pipelineStack); + + template.hasResourceProperties('AWS::KMS::Key', { + EnableKeyRotation: true, + }); +}); + test('CodePipeline supports use of existing role', () => { const pipelineStack = new cdk.Stack(app, 'PipelineStack', { env: PIPELINE_ENV }); const repo = new ccommit.Repository(pipelineStack, 'Repo', { @@ -298,6 +357,41 @@ describe('deployment of stack', () => { }); }); +test('action name is calculated properly if it has cross-stack dependencies', () => { + // GIVEN + const pipelineStack = new cdk.Stack(app, 'PipelineStack', { env: PIPELINE_ENV }); + const pipeline = new ModernTestGitHubNpmPipeline(pipelineStack, 'Cdk', { + crossAccountKeys: true, + }); + + // WHEN + const s1step = new cdkp.ManualApprovalStep('S1'); + const s2step = new cdkp.ManualApprovalStep('S2'); + s1step.addStepDependency(s2step); + + // The issue we were diagnosing only manifests if the stacks don't have + // a dependency on each other + const stage = new TwoStackApp(app, 'TheApp', { withDependency: false }); + pipeline.addStage(stage, { + stackSteps: [ + { stack: stage.stack1, post: [s1step] }, + { stack: stage.stack2, post: [s2step] }, + ], + }); + + // THEN + const template = Template.fromStack(pipelineStack); + template.hasResourceProperties('AWS::CodePipeline::Pipeline', { + Stages: Match.arrayWith([{ + Name: 'TheApp', + Actions: Match.arrayWith([ + Match.objectLike({ Name: 'Stack2.S2', RunOrder: 3 }), + Match.objectLike({ Name: 'Stack1.S1', RunOrder: 4 }), + ]), + }]), + }); +}); + interface ReuseCodePipelineStackProps extends cdk.StackProps { reuseCrossRegionSupportStacks?: boolean; } @@ -358,6 +452,7 @@ class ReuseStack extends cdk.Stack { interface CodePipelineStackProps extends cdk.StackProps { pipelineName?: string; crossAccountKeys?: boolean; + enableKeyRotation?: boolean; reuseCrossRegionSupportStacks?: boolean; role?: iam.IRole; } @@ -379,21 +474,28 @@ class CodePipelinePropsCheckTest extends cdk.Stack { if (this.cProps.crossAccountKeys !== undefined) { new cdkp.CodePipeline(this, 'CodePipeline2', { crossAccountKeys: this.cProps.crossAccountKeys, - codePipeline: new Pipeline(this, 'Pipline2'), + codePipeline: new Pipeline(this, 'Pipeline2'), synth: new cdkp.ShellStep('Synth', { commands: ['ls'] }), }).buildPipeline(); } - if (this.cProps.reuseCrossRegionSupportStacks !== undefined) { + if (this.cProps.enableKeyRotation !== undefined) { new cdkp.CodePipeline(this, 'CodePipeline3', { + enableKeyRotation: this.cProps.enableKeyRotation, + codePipeline: new Pipeline(this, 'Pipeline3'), + synth: new cdkp.ShellStep('Synth', { commands: ['ls'] }), + }).buildPipeline(); + } + if (this.cProps.reuseCrossRegionSupportStacks !== undefined) { + new cdkp.CodePipeline(this, 'CodePipeline4', { reuseCrossRegionSupportStacks: this.cProps.reuseCrossRegionSupportStacks, - codePipeline: new Pipeline(this, 'Pipline3'), + codePipeline: new Pipeline(this, 'Pipeline4'), synth: new cdkp.ShellStep('Synth', { commands: ['ls'] }), }).buildPipeline(); } if (this.cProps.role !== undefined) { - new cdkp.CodePipeline(this, 'CodePipeline4', { + new cdkp.CodePipeline(this, 'CodePipeline5', { role: this.cProps.role, - codePipeline: new Pipeline(this, 'Pipline4'), + codePipeline: new Pipeline(this, 'Pipeline5'), synth: new cdkp.ShellStep('Synth', { commands: ['ls'] }), }).buildPipeline(); } diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json new file mode 100644 index 0000000000000..94246814e0a48 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "LambdaTestDefaultTestDeployAssert1AF2B360.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/PipelineStack.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/PipelineStack.assets.json new file mode 100644 index 0000000000000..af32741f7bc44 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/PipelineStack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "c1bda7e2c84e91a5658af0b194a4c8918dead52ad783e29acbc3701149e73f45": { + "source": { + "path": "PipelineStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "c1bda7e2c84e91a5658af0b194a4c8918dead52ad783e29acbc3701149e73f45.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/PipelineStack.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/PipelineStack.template.json new file mode 100644 index 0000000000000..855088e557cb5 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/PipelineStack.template.json @@ -0,0 +1,2546 @@ +{ + "Resources": { + "PipelineArtifactsBucketEncryptionKeyF5BF0670": { + "Type": "AWS::KMS::Key", + "Properties": { + "KeyPolicy": { + "Statement": [ + { + "Action": "kms:*", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "EnableKeyRotation": true + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PipelineArtifactsBucketEncryptionKeyAlias94A07392": { + "Type": "AWS::KMS::Alias", + "Properties": { + "AliasName": "alias/codepipeline-pipelinestack-pipeline-e95eedaa", + "TargetKeyId": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PipelineArtifactsBucketAEA9A052": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "KMSMasterKeyID": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + }, + "SSEAlgorithm": "aws:kms" + } + } + ] + }, + "PublicAccessBlockConfiguration": { + "BlockPublicAcls": true, + "BlockPublicPolicy": true, + "IgnorePublicAcls": true, + "RestrictPublicBuckets": true + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "PipelineArtifactsBucketPolicyF53CCC52": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "PipelineArtifactsBucketAEA9A052" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "PipelineRoleB27FAA37": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codepipeline.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PipelineRoleDefaultPolicy7BDC1ABB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:Abort*", + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey", + "kms:Encrypt", + "kms:GenerateDataKey*", + "kms:ReEncrypt*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + }, + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineCodeBuildActionRole226DB0CB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PipelineRoleDefaultPolicy7BDC1ABB", + "Roles": [ + { + "Ref": "PipelineRoleB27FAA37" + } + ] + } + }, + "Pipeline9850B417": { + "Type": "AWS::CodePipeline::Pipeline", + "Properties": { + "RoleArn": { + "Fn::GetAtt": [ + "PipelineRoleB27FAA37", + "Arn" + ] + }, + "Stages": [ + { + "Actions": [ + { + "ActionTypeId": { + "Category": "Source", + "Owner": "ThirdParty", + "Provider": "GitHub", + "Version": "1" + }, + "Configuration": { + "Owner": "tkglaser", + "Repo": "cdk-pipelines-demo", + "Branch": "main", + "OAuthToken": "{{resolve:secretsmanager:github-token:SecretString:::}}", + "PollForSourceChanges": false + }, + "Name": "tkglaser_cdk-pipelines-demo", + "OutputArtifacts": [ + { + "Name": "tkglaser_cdk_pipelines_demo_Source" + } + ], + "RunOrder": 1 + } + ], + "Name": "Source" + }, + { + "Actions": [ + { + "ActionTypeId": { + "Category": "Build", + "Owner": "AWS", + "Provider": "CodeBuild", + "Version": "1" + }, + "Configuration": { + "ProjectName": { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + }, + "EnvironmentVariables": "[{\"name\":\"_PROJECT_CONFIG_HASH\",\"type\":\"PLAINTEXT\",\"value\":\"00ebacfb32b1bde8d3638577308e7b7144dfa3b0a58a83bc6ff38a3b1f26951c\"}]" + }, + "InputArtifacts": [ + { + "Name": "tkglaser_cdk_pipelines_demo_Source" + } + ], + "Name": "Synth", + "OutputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "RoleArn": { + "Fn::GetAtt": [ + "PipelineCodeBuildActionRole226DB0CB", + "Arn" + ] + }, + "RunOrder": 1 + } + ], + "Name": "Build" + }, + { + "Actions": [ + { + "ActionTypeId": { + "Category": "Build", + "Owner": "AWS", + "Provider": "CodeBuild", + "Version": "1" + }, + "Configuration": { + "ProjectName": { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + }, + "EnvironmentVariables": "[{\"name\":\"_PROJECT_CONFIG_HASH\",\"type\":\"PLAINTEXT\",\"value\":\"c0779bd925c3a7f19be75a4973c668d10d00ce3552b882c7d2ba3fa3cee6d976\"}]" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "SelfMutate", + "RoleArn": { + "Fn::GetAtt": [ + "PipelineCodeBuildActionRole226DB0CB", + "Arn" + ] + }, + "RunOrder": 1 + } + ], + "Name": "UpdatePipeline" + }, + { + "Actions": [ + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Beta-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Beta-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Beta-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Beta-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + } + ], + "Name": "Beta" + }, + { + "Actions": [ + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod1-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod1.Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod2-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod2.Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod1-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod1.Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod2-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod2.Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod1-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod1.Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod2-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod2.Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod1-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod1.Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod2-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod2.Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + } + ], + "Name": "Wave1" + }, + { + "Actions": [ + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod3-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod3.Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod4-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod4.Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod5-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod5.Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod6-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod6.Stack1.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 1 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod3-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod3.Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod4-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod4.Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod5-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod5.Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod6-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod6.Stack1.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 2 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod3-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod3.Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod4-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod4.Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod5-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod5.Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod6-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.template.json" + }, + "InputArtifacts": [ + { + "Name": "Synth_Output" + } + ], + "Name": "Prod6.Stack2.Prepare", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 3 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod3-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod3.Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod4-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod4.Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod5-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod5.Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + }, + { + "ActionTypeId": { + "Category": "Deploy", + "Owner": "AWS", + "Provider": "CloudFormation", + "Version": "1" + }, + "Configuration": { + "StackName": "Prod6-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "Name": "Prod6.Stack2.Deploy", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "RunOrder": 4 + } + ], + "Name": "Wave2" + } + ], + "ArtifactStore": { + "EncryptionKey": { + "Id": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + }, + "Type": "KMS" + }, + "Location": { + "Ref": "PipelineArtifactsBucketAEA9A052" + }, + "Type": "S3" + }, + "RestartExecutionOnUpdate": true + }, + "DependsOn": [ + "PipelineRoleDefaultPolicy7BDC1ABB", + "PipelineRoleB27FAA37" + ] + }, + "PipelineSourcetkglasercdkpipelinesdemoWebhookResource54EE51BE": { + "Type": "AWS::CodePipeline::Webhook", + "Properties": { + "Authentication": "GITHUB_HMAC", + "AuthenticationConfiguration": { + "SecretToken": "{{resolve:secretsmanager:github-token:SecretString:::}}" + }, + "Filters": [ + { + "JsonPath": "$.ref", + "MatchEquals": "refs/heads/{Branch}" + } + ], + "TargetAction": "tkglaser_cdk-pipelines-demo", + "TargetPipeline": { + "Ref": "Pipeline9850B417" + }, + "TargetPipelineVersion": 1, + "RegisterWithThirdParty": true + } + }, + "PipelineBuildSynthCdkBuildProjectRole231EEA2A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PipelineBuildSynthCdkBuildProjectRoleDefaultPolicyFB6C941C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + }, + ":*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + } + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:BatchPutCodeCoverages", + "codebuild:BatchPutTestCases", + "codebuild:CreateReport", + "codebuild:CreateReportGroup", + "codebuild:UpdateReport" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "s3:Abort*", + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey", + "kms:Encrypt", + "kms:GenerateDataKey*", + "kms:ReEncrypt*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PipelineBuildSynthCdkBuildProjectRoleDefaultPolicyFB6C941C", + "Roles": [ + { + "Ref": "PipelineBuildSynthCdkBuildProjectRole231EEA2A" + } + ] + } + }, + "PipelineBuildSynthCdkBuildProject6BEFA8E6": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "CODEPIPELINE" + }, + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": false, + "Type": "LINUX_CONTAINER" + }, + "ServiceRole": { + "Fn::GetAtt": [ + "PipelineBuildSynthCdkBuildProjectRole231EEA2A", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm ci\",\n \"npm run build\",\n \"npx cdk synth\"\n ]\n }\n },\n \"artifacts\": {\n \"base-directory\": \"cdk.out\",\n \"files\": \"**/*\"\n }\n}", + "Type": "CODEPIPELINE" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Pipeline step PipelineStack/Pipeline/Build/Synth", + "EncryptionKey": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + }, + "PipelineCodeBuildActionRole226DB0CB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Condition": { + "Bool": { + "aws:ViaAWSService": "codepipeline.amazonaws.com" + } + }, + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PipelineCodeBuildActionRoleDefaultPolicy1D62A6FE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "codebuild:BatchGetBuilds", + "codebuild:StartBuild", + "codebuild:StopBuild" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineBuildSynthCdkBuildProject6BEFA8E6", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "PipelineUpdatePipelineSelfMutationDAA41400", + "Arn" + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PipelineCodeBuildActionRoleDefaultPolicy1D62A6FE", + "Roles": [ + { + "Ref": "PipelineCodeBuildActionRole226DB0CB" + } + ] + } + }, + "PipelineUpdatePipelineSelfMutationRole57E559E8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PipelineUpdatePipelineSelfMutationRoleDefaultPolicyA225DA4E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + }, + ":*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + } + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:BatchPutCodeCoverages", + "codebuild:BatchPutTestCases", + "codebuild:CreateReport", + "codebuild:CreateReportGroup", + "codebuild:UpdateReport" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + }, + "-*" + ] + ] + } + }, + { + "Action": "sts:AssumeRole", + "Condition": { + "ForAnyValue:StringEquals": { + "iam:ResourceTag/aws-cdk:bootstrap-role": [ + "image-publishing", + "file-publishing", + "deploy" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:*:iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/*" + ] + ] + } + }, + { + "Action": [ + "cloudformation:DescribeStacks", + "s3:ListBucket" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey", + "kms:Encrypt", + "kms:GenerateDataKey*", + "kms:ReEncrypt*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PipelineUpdatePipelineSelfMutationRoleDefaultPolicyA225DA4E", + "Roles": [ + { + "Ref": "PipelineUpdatePipelineSelfMutationRole57E559E8" + } + ] + } + }, + "PipelineUpdatePipelineSelfMutationDAA41400": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "CODEPIPELINE" + }, + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": false, + "Type": "LINUX_CONTAINER" + }, + "ServiceRole": { + "Fn::GetAtt": [ + "PipelineUpdatePipelineSelfMutationRole57E559E8", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"npm install -g aws-cdk@1\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cdk -a . deploy PipelineStack --require-approval=never --verbose\"\n ]\n }\n }\n}", + "Type": "CODEPIPELINE" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Pipeline step PipelineStack/Pipeline/UpdatePipeline/SelfMutate", + "EncryptionKey": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.assets.json new file mode 100644 index 0000000000000..f199f50526e58 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "91031b26c04588c38a59e3481d308182b5244c5f5a3af3ee05566e2f4f70ce65": { + "source": { + "path": "PipelineStackBetaStack1E6541489.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "91031b26c04588c38a59e3481d308182b5244c5f5a3af3ee05566e2f4f70ce65.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.template.json new file mode 100644 index 0000000000000..c1339d0126ee2 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Beta-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.assets.json new file mode 100644 index 0000000000000..de61f2f0d61b8 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "e3aa38ca82b00b776ad3834e9ee862d2e529d91c0f0b12fad846884e1e600326": { + "source": { + "path": "PipelineStackBetaStack2C79AD00A.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "e3aa38ca82b00b776ad3834e9ee862d2e529d91c0f0b12fad846884e1e600326.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.template.json new file mode 100644 index 0000000000000..f7390e702aa6d --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Beta-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/manifest.json new file mode 100644 index 0000000000000..44178c8276b5a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Beta/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackBetaStack1E6541489.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackBetaStack1E6541489.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackBetaStack1E6541489": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackBetaStack1E6541489.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/91031b26c04588c38a59e3481d308182b5244c5f5a3af3ee05566e2f4f70ce65.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackBetaStack1E6541489.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Beta-Stack1" + }, + "dependencies": [ + "PipelineStackBetaStack1E6541489.assets" + ], + "metadata": { + "/PipelineStack/Beta/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Beta/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Beta/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Beta/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Beta/Stack1" + }, + "PipelineStackBetaStack2C79AD00A.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackBetaStack2C79AD00A.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackBetaStack2C79AD00A": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackBetaStack2C79AD00A.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e3aa38ca82b00b776ad3834e9ee862d2e529d91c0f0b12fad846884e1e600326.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackBetaStack2C79AD00A.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Beta-Stack2" + }, + "dependencies": [ + "PipelineStackBetaStack1E6541489", + "PipelineStackBetaStack2C79AD00A.assets" + ], + "metadata": { + "/PipelineStack/Beta/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Beta/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Beta/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Beta/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.assets.json new file mode 100644 index 0000000000000..b7ffa2a662eb3 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "774f0c3cec814003a4da7d6cab73aec82952a0cb52a221b3f94fae483d9922a3": { + "source": { + "path": "PipelineStackProd1Stack14013D698.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "774f0c3cec814003a4da7d6cab73aec82952a0cb52a221b3f94fae483d9922a3.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.template.json new file mode 100644 index 0000000000000..b46a5cc4fbb7d --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Prod1-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.assets.json new file mode 100644 index 0000000000000..7726d630cea66 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "c1cb4eebe68ea920a89e618efa29c36ecc1aa0c6f6ef6b65559efe9c0bba4059": { + "source": { + "path": "PipelineStackProd1Stack2F0681AFF.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "c1cb4eebe68ea920a89e618efa29c36ecc1aa0c6f6ef6b65559efe9c0bba4059.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.template.json new file mode 100644 index 0000000000000..fcabd32211080 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod1-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/manifest.json new file mode 100644 index 0000000000000..84e886b05f023 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod1/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackProd1Stack14013D698.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd1Stack14013D698.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd1Stack14013D698": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd1Stack14013D698.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/774f0c3cec814003a4da7d6cab73aec82952a0cb52a221b3f94fae483d9922a3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd1Stack14013D698.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod1-Stack1" + }, + "dependencies": [ + "PipelineStackProd1Stack14013D698.assets" + ], + "metadata": { + "/PipelineStack/Prod1/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Prod1/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Prod1/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod1/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod1/Stack1" + }, + "PipelineStackProd1Stack2F0681AFF.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd1Stack2F0681AFF.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd1Stack2F0681AFF": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd1Stack2F0681AFF.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c1cb4eebe68ea920a89e618efa29c36ecc1aa0c6f6ef6b65559efe9c0bba4059.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd1Stack2F0681AFF.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod1-Stack2" + }, + "dependencies": [ + "PipelineStackProd1Stack14013D698", + "PipelineStackProd1Stack2F0681AFF.assets" + ], + "metadata": { + "/PipelineStack/Prod1/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Prod1/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod1/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod1/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.assets.json new file mode 100644 index 0000000000000..3c89b6ce514f5 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "a595899a57366f015e986ac46c3da09fac75670ea0f4719de8defc67d731fa68": { + "source": { + "path": "PipelineStackProd2Stack1FD464162.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a595899a57366f015e986ac46c3da09fac75670ea0f4719de8defc67d731fa68.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.template.json new file mode 100644 index 0000000000000..302ccbd07207e --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Prod2-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.assets.json new file mode 100644 index 0000000000000..d53df689d7a91 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "364ee9a72c6c371a00c6e41438695af070848a2d625a4c953bfc4666e7ad5ae9": { + "source": { + "path": "PipelineStackProd2Stack2176123EB.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "364ee9a72c6c371a00c6e41438695af070848a2d625a4c953bfc4666e7ad5ae9.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.template.json new file mode 100644 index 0000000000000..933decc98d696 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod2-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/manifest.json new file mode 100644 index 0000000000000..793401e5b7f4b --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod2/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackProd2Stack1FD464162.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd2Stack1FD464162.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd2Stack1FD464162": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd2Stack1FD464162.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a595899a57366f015e986ac46c3da09fac75670ea0f4719de8defc67d731fa68.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd2Stack1FD464162.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod2-Stack1" + }, + "dependencies": [ + "PipelineStackProd2Stack1FD464162.assets" + ], + "metadata": { + "/PipelineStack/Prod2/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Prod2/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Prod2/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod2/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod2/Stack1" + }, + "PipelineStackProd2Stack2176123EB.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd2Stack2176123EB.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd2Stack2176123EB": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd2Stack2176123EB.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/364ee9a72c6c371a00c6e41438695af070848a2d625a4c953bfc4666e7ad5ae9.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd2Stack2176123EB.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod2-Stack2" + }, + "dependencies": [ + "PipelineStackProd2Stack1FD464162", + "PipelineStackProd2Stack2176123EB.assets" + ], + "metadata": { + "/PipelineStack/Prod2/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Prod2/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod2/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod2/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.assets.json new file mode 100644 index 0000000000000..c55b572802965 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "e8c78794529aa32b354a78b7b979165b0cadd9d113a37f537d083f946c0e7bff": { + "source": { + "path": "PipelineStackProd3Stack1795F3D43.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "e8c78794529aa32b354a78b7b979165b0cadd9d113a37f537d083f946c0e7bff.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.template.json new file mode 100644 index 0000000000000..001e76f16f49a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Prod3-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.assets.json new file mode 100644 index 0000000000000..d2499d3c6f9ef --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "9fee5ad34559e603d3fc184456935445ea09549b147d2cbc2acd8cf6b916dd99": { + "source": { + "path": "PipelineStackProd3Stack2DFBBA0B2.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "9fee5ad34559e603d3fc184456935445ea09549b147d2cbc2acd8cf6b916dd99.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.template.json new file mode 100644 index 0000000000000..dc2e4203973f5 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod3-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/manifest.json new file mode 100644 index 0000000000000..dab78742ac8f3 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod3/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackProd3Stack1795F3D43.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd3Stack1795F3D43.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd3Stack1795F3D43": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd3Stack1795F3D43.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e8c78794529aa32b354a78b7b979165b0cadd9d113a37f537d083f946c0e7bff.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd3Stack1795F3D43.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod3-Stack1" + }, + "dependencies": [ + "PipelineStackProd3Stack1795F3D43.assets" + ], + "metadata": { + "/PipelineStack/Prod3/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Prod3/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Prod3/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod3/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod3/Stack1" + }, + "PipelineStackProd3Stack2DFBBA0B2.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd3Stack2DFBBA0B2.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd3Stack2DFBBA0B2": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd3Stack2DFBBA0B2.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9fee5ad34559e603d3fc184456935445ea09549b147d2cbc2acd8cf6b916dd99.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd3Stack2DFBBA0B2.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod3-Stack2" + }, + "dependencies": [ + "PipelineStackProd3Stack1795F3D43", + "PipelineStackProd3Stack2DFBBA0B2.assets" + ], + "metadata": { + "/PipelineStack/Prod3/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Prod3/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod3/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod3/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.assets.json new file mode 100644 index 0000000000000..450141f8baf32 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "7e0ecf5ec563ed47798cfb17d4c3ce0e6c710c075fc53bf8cd15d8fb9a210f78": { + "source": { + "path": "PipelineStackProd4Stack118F74ADB.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "7e0ecf5ec563ed47798cfb17d4c3ce0e6c710c075fc53bf8cd15d8fb9a210f78.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.template.json new file mode 100644 index 0000000000000..2b548d4d93efd --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Prod4-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.assets.json new file mode 100644 index 0000000000000..44abc221b7ad2 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "a9cddd81a8937cbadd9bf93c6fe07766501a7c137605bb09e6cfa322b2eb09fd": { + "source": { + "path": "PipelineStackProd4Stack2E2CB4ED3.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a9cddd81a8937cbadd9bf93c6fe07766501a7c137605bb09e6cfa322b2eb09fd.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.template.json new file mode 100644 index 0000000000000..631819bed2136 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod4-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/manifest.json new file mode 100644 index 0000000000000..9c756ab77fd23 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod4/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackProd4Stack118F74ADB.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd4Stack118F74ADB.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd4Stack118F74ADB": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd4Stack118F74ADB.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7e0ecf5ec563ed47798cfb17d4c3ce0e6c710c075fc53bf8cd15d8fb9a210f78.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd4Stack118F74ADB.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod4-Stack1" + }, + "dependencies": [ + "PipelineStackProd4Stack118F74ADB.assets" + ], + "metadata": { + "/PipelineStack/Prod4/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Prod4/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Prod4/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod4/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod4/Stack1" + }, + "PipelineStackProd4Stack2E2CB4ED3.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd4Stack2E2CB4ED3.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd4Stack2E2CB4ED3": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd4Stack2E2CB4ED3.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a9cddd81a8937cbadd9bf93c6fe07766501a7c137605bb09e6cfa322b2eb09fd.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd4Stack2E2CB4ED3.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod4-Stack2" + }, + "dependencies": [ + "PipelineStackProd4Stack118F74ADB", + "PipelineStackProd4Stack2E2CB4ED3.assets" + ], + "metadata": { + "/PipelineStack/Prod4/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Prod4/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod4/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod4/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.assets.json new file mode 100644 index 0000000000000..c44f6ea2b183b --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "1e0089d5c027ddec49745fce045925aff9342fbffdf989e4ae5263fd87ee50f7": { + "source": { + "path": "PipelineStackProd5Stack1E7E4E4C6.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1e0089d5c027ddec49745fce045925aff9342fbffdf989e4ae5263fd87ee50f7.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.template.json new file mode 100644 index 0000000000000..658620fcb843a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Prod5-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.assets.json new file mode 100644 index 0000000000000..158c0083e7147 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "48a94145722a5a14816cb87dce62fadba53a03b2c18e0fdfb5107ffabd5d7cd8": { + "source": { + "path": "PipelineStackProd5Stack2C39BEE5B.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "48a94145722a5a14816cb87dce62fadba53a03b2c18e0fdfb5107ffabd5d7cd8.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.template.json new file mode 100644 index 0000000000000..67e0c24ee96fb --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod5-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/manifest.json new file mode 100644 index 0000000000000..fe561a6512340 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod5/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackProd5Stack1E7E4E4C6.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd5Stack1E7E4E4C6.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd5Stack1E7E4E4C6": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd5Stack1E7E4E4C6.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/1e0089d5c027ddec49745fce045925aff9342fbffdf989e4ae5263fd87ee50f7.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd5Stack1E7E4E4C6.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod5-Stack1" + }, + "dependencies": [ + "PipelineStackProd5Stack1E7E4E4C6.assets" + ], + "metadata": { + "/PipelineStack/Prod5/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Prod5/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Prod5/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod5/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod5/Stack1" + }, + "PipelineStackProd5Stack2C39BEE5B.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd5Stack2C39BEE5B.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd5Stack2C39BEE5B": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd5Stack2C39BEE5B.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/48a94145722a5a14816cb87dce62fadba53a03b2c18e0fdfb5107ffabd5d7cd8.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd5Stack2C39BEE5B.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod5-Stack2" + }, + "dependencies": [ + "PipelineStackProd5Stack1E7E4E4C6", + "PipelineStackProd5Stack2C39BEE5B.assets" + ], + "metadata": { + "/PipelineStack/Prod5/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Prod5/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod5/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod5/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.assets.json new file mode 100644 index 0000000000000..880e81b8852d1 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "26d311d19506235a52c5d093cf5a8360110af6a2b713beda66b33ba3ee5bd813": { + "source": { + "path": "PipelineStackProd6Stack1E7C34314.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "26d311d19506235a52c5d093cf5a8360110af6a2b713beda66b33ba3ee5bd813.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.template.json new file mode 100644 index 0000000000000..7ac93ccb63c33 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E": { + "Value": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Export": { + "Name": "Prod6-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.assets.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.assets.json new file mode 100644 index 0000000000000..193e0ebce2115 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "8f3e16ae3f29a4a50d4ef13026a3bc879e039d80e9fffdefe19d40349ec6bb30": { + "source": { + "path": "PipelineStackProd6Stack2BED1BBCE.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "8f3e16ae3f29a4a50d4ef13026a3bc879e039d80e9fffdefe19d40349ec6bb30.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.template.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.template.json new file mode 100644 index 0000000000000..dd780ed92f925 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.template.json @@ -0,0 +1,51 @@ +{ + "Resources": { + "OtherQueue60B686DC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod6-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/manifest.json new file mode 100644 index 0000000000000..cb703434ad45b --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/assembly-PipelineStack-Prod6/manifest.json @@ -0,0 +1,120 @@ +{ + "version": "29.0.0", + "artifacts": { + "PipelineStackProd6Stack1E7C34314.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd6Stack1E7C34314.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd6Stack1E7C34314": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd6Stack1E7C34314.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/26d311d19506235a52c5d093cf5a8360110af6a2b713beda66b33ba3ee5bd813.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd6Stack1E7C34314.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod6-Stack1" + }, + "dependencies": [ + "PipelineStackProd6Stack1E7C34314.assets" + ], + "metadata": { + "/PipelineStack/Prod6/Stack1/Queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Queue4A7E3555" + } + ], + "/PipelineStack/Prod6/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + } + ], + "/PipelineStack/Prod6/Stack1/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod6/Stack1/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod6/Stack1" + }, + "PipelineStackProd6Stack2BED1BBCE.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStackProd6Stack2BED1BBCE.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStackProd6Stack2BED1BBCE": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStackProd6Stack2BED1BBCE.template.json", + "validateOnSynth": true, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8f3e16ae3f29a4a50d4ef13026a3bc879e039d80e9fffdefe19d40349ec6bb30.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStackProd6Stack2BED1BBCE.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "Prod6-Stack2" + }, + "dependencies": [ + "PipelineStackProd6Stack1E7C34314", + "PipelineStackProd6Stack2BED1BBCE.assets" + ], + "metadata": { + "/PipelineStack/Prod6/Stack2/OtherQueue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OtherQueue60B686DC" + } + ], + "/PipelineStack/Prod6/Stack2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/Prod6/Stack2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack/Prod6/Stack2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/cdk.out b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/integ.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/integ.json new file mode 100644 index 0000000000000..9c049ebb503d9 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "29.0.0", + "testCases": { + "LambdaTest/DefaultTest": { + "stacks": [ + "PipelineStack" + ], + "assertionStack": "LambdaTest/DefaultTest/DeployAssert", + "assertionStackName": "LambdaTestDefaultTestDeployAssert1AF2B360" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/manifest.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/manifest.json new file mode 100644 index 0000000000000..ba995ae0a7667 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/manifest.json @@ -0,0 +1,250 @@ +{ + "version": "29.0.0", + "artifacts": { + "assembly-PipelineStack-Beta": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Beta", + "displayName": "PipelineStack/Beta" + } + }, + "assembly-PipelineStack-Prod1": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Prod1", + "displayName": "PipelineStack/Prod1" + } + }, + "assembly-PipelineStack-Prod2": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Prod2", + "displayName": "PipelineStack/Prod2" + } + }, + "assembly-PipelineStack-Prod3": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Prod3", + "displayName": "PipelineStack/Prod3" + } + }, + "assembly-PipelineStack-Prod4": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Prod4", + "displayName": "PipelineStack/Prod4" + } + }, + "assembly-PipelineStack-Prod5": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Prod5", + "displayName": "PipelineStack/Prod5" + } + }, + "assembly-PipelineStack-Prod6": { + "type": "cdk:cloud-assembly", + "properties": { + "directoryName": "assembly-PipelineStack-Prod6", + "displayName": "PipelineStack/Prod6" + } + }, + "PipelineStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "PipelineStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "PipelineStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "PipelineStack.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c1bda7e2c84e91a5658af0b194a4c8918dead52ad783e29acbc3701149e73f45.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "PipelineStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "PipelineStack.assets" + ], + "metadata": { + "/PipelineStack/Pipeline/Pipeline/ArtifactsBucketEncryptionKey/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineArtifactsBucketEncryptionKeyF5BF0670" + } + ], + "/PipelineStack/Pipeline/Pipeline/ArtifactsBucketEncryptionKeyAlias/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineArtifactsBucketEncryptionKeyAlias94A07392" + } + ], + "/PipelineStack/Pipeline/Pipeline/ArtifactsBucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineArtifactsBucketAEA9A052" + } + ], + "/PipelineStack/Pipeline/Pipeline/ArtifactsBucket/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineArtifactsBucketPolicyF53CCC52" + } + ], + "/PipelineStack/Pipeline/Pipeline/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineRoleB27FAA37" + } + ], + "/PipelineStack/Pipeline/Pipeline/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineRoleDefaultPolicy7BDC1ABB" + } + ], + "/PipelineStack/Pipeline/Pipeline/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Pipeline9850B417" + } + ], + "/PipelineStack/Pipeline/Pipeline/Source/tkglaser_cdk-pipelines-demo/WebhookResource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineSourcetkglasercdkpipelinesdemoWebhookResource54EE51BE" + } + ], + "/PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineBuildSynthCdkBuildProjectRole231EEA2A" + } + ], + "/PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineBuildSynthCdkBuildProjectRoleDefaultPolicyFB6C941C" + } + ], + "/PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + } + ], + "/PipelineStack/Pipeline/CodeBuildActionRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineCodeBuildActionRole226DB0CB" + } + ], + "/PipelineStack/Pipeline/CodeBuildActionRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineCodeBuildActionRoleDefaultPolicy1D62A6FE" + } + ], + "/PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineUpdatePipelineSelfMutationRole57E559E8" + } + ], + "/PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineUpdatePipelineSelfMutationRoleDefaultPolicyA225DA4E" + } + ], + "/PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PipelineUpdatePipelineSelfMutationDAA41400" + } + ], + "/PipelineStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/PipelineStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "PipelineStack" + }, + "LambdaTestDefaultTestDeployAssert1AF2B360.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "LambdaTestDefaultTestDeployAssert1AF2B360.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "LambdaTestDefaultTestDeployAssert1AF2B360": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "LambdaTestDefaultTestDeployAssert1AF2B360.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "LambdaTestDefaultTestDeployAssert1AF2B360.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "LambdaTestDefaultTestDeployAssert1AF2B360.assets" + ], + "metadata": { + "/LambdaTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/LambdaTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "LambdaTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/tree.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/tree.json new file mode 100644 index 0000000000000..9498fef8dfd27 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.js.snapshot/tree.json @@ -0,0 +1,4200 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "PipelineStack": { + "id": "PipelineStack", + "path": "PipelineStack", + "children": { + "Pipeline": { + "id": "Pipeline", + "path": "PipelineStack/Pipeline", + "children": { + "Pipeline": { + "id": "Pipeline", + "path": "PipelineStack/Pipeline/Pipeline", + "children": { + "ArtifactsBucketEncryptionKey": { + "id": "ArtifactsBucketEncryptionKey", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucketEncryptionKey", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucketEncryptionKey/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::KMS::Key", + "aws:cdk:cloudformation:props": { + "keyPolicy": { + "Statement": [ + { + "Action": "kms:*", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "enableKeyRotation": true + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-kms.CfnKey", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-kms.Key", + "version": "0.0.0" + } + }, + "ArtifactsBucketEncryptionKeyAlias": { + "id": "ArtifactsBucketEncryptionKeyAlias", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucketEncryptionKeyAlias", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucketEncryptionKeyAlias/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::KMS::Alias", + "aws:cdk:cloudformation:props": { + "aliasName": "alias/codepipeline-pipelinestack-pipeline-e95eedaa", + "targetKeyId": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-kms.CfnAlias", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-kms.Alias", + "version": "0.0.0" + } + }, + "ArtifactsBucket": { + "id": "ArtifactsBucket", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucket", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucket/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": { + "bucketEncryption": { + "serverSideEncryptionConfiguration": [ + { + "serverSideEncryptionByDefault": { + "sseAlgorithm": "aws:kms", + "kmsMasterKeyId": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + } + ] + }, + "publicAccessBlockConfiguration": { + "blockPublicAcls": true, + "blockPublicPolicy": true, + "ignorePublicAcls": true, + "restrictPublicBuckets": true + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucket", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucket/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/ArtifactsBucket/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", + "aws:cdk:cloudformation:props": { + "bucket": { + "Ref": "PipelineArtifactsBucketAEA9A052" + }, + "policyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.Bucket", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "PipelineStack/Pipeline/Pipeline/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "PipelineStack/Pipeline/Pipeline/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codepipeline.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "PipelineStack/Pipeline/Pipeline/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "s3:Abort*", + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey", + "kms:Encrypt", + "kms:GenerateDataKey*", + "kms:ReEncrypt*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + }, + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineCodeBuildActionRole226DB0CB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "PipelineRoleDefaultPolicy7BDC1ABB", + "roles": [ + { + "Ref": "PipelineRoleB27FAA37" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CodePipeline::Pipeline", + "aws:cdk:cloudformation:props": { + "roleArn": { + "Fn::GetAtt": [ + "PipelineRoleB27FAA37", + "Arn" + ] + }, + "stages": [ + { + "name": "Source", + "actions": [ + { + "name": "tkglaser_cdk-pipelines-demo", + "outputArtifacts": [ + { + "name": "tkglaser_cdk_pipelines_demo_Source" + } + ], + "actionTypeId": { + "category": "Source", + "version": "1", + "owner": "ThirdParty", + "provider": "GitHub" + }, + "configuration": { + "Owner": "tkglaser", + "Repo": "cdk-pipelines-demo", + "Branch": "main", + "OAuthToken": "{{resolve:secretsmanager:github-token:SecretString:::}}", + "PollForSourceChanges": false + }, + "runOrder": 1 + } + ] + }, + { + "name": "Build", + "actions": [ + { + "name": "Synth", + "inputArtifacts": [ + { + "name": "tkglaser_cdk_pipelines_demo_Source" + } + ], + "outputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Build", + "version": "1", + "owner": "AWS", + "provider": "CodeBuild" + }, + "configuration": { + "ProjectName": { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + }, + "EnvironmentVariables": "[{\"name\":\"_PROJECT_CONFIG_HASH\",\"type\":\"PLAINTEXT\",\"value\":\"00ebacfb32b1bde8d3638577308e7b7144dfa3b0a58a83bc6ff38a3b1f26951c\"}]" + }, + "runOrder": 1, + "roleArn": { + "Fn::GetAtt": [ + "PipelineCodeBuildActionRole226DB0CB", + "Arn" + ] + } + } + ] + }, + { + "name": "UpdatePipeline", + "actions": [ + { + "name": "SelfMutate", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Build", + "version": "1", + "owner": "AWS", + "provider": "CodeBuild" + }, + "configuration": { + "ProjectName": { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + }, + "EnvironmentVariables": "[{\"name\":\"_PROJECT_CONFIG_HASH\",\"type\":\"PLAINTEXT\",\"value\":\"c0779bd925c3a7f19be75a4973c668d10d00ce3552b882c7d2ba3fa3cee6d976\"}]" + }, + "runOrder": 1, + "roleArn": { + "Fn::GetAtt": [ + "PipelineCodeBuildActionRole226DB0CB", + "Arn" + ] + } + } + ] + }, + { + "name": "Beta", + "actions": [ + { + "name": "Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Beta-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Beta-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Beta-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Beta-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + } + ] + }, + { + "name": "Wave1", + "actions": [ + { + "name": "Prod1.Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod1-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod2.Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod2-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod1.Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod1-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod2.Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod2-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod1.Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod1-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod2.Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod2-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod1.Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod1-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod2.Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod2-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + } + ] + }, + { + "name": "Wave2", + "actions": [ + { + "name": "Prod3.Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod3-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod4.Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod4-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod5.Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod5-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod6.Stack1.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod6-Stack1", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod6/PipelineStackProd6Stack1E7C34314.template.json" + }, + "runOrder": 1, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod3.Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod3-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod4.Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod4-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod5.Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod5-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod6.Stack1.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod6-Stack1", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 2, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod3.Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod3-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod4.Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod4-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod5.Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod5-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod6.Stack2.Prepare", + "inputArtifacts": [ + { + "name": "Synth_Output" + } + ], + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod6-Stack2", + "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", + "RoleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-cfn-exec-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + }, + "ActionMode": "CHANGE_SET_REPLACE", + "ChangeSetName": "PipelineChange", + "TemplatePath": "Synth_Output::assembly-PipelineStack-Prod6/PipelineStackProd6Stack2BED1BBCE.template.json" + }, + "runOrder": 3, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod3.Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod3-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod4.Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod4-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod5.Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod5-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + }, + { + "name": "Prod6.Stack2.Deploy", + "actionTypeId": { + "category": "Deploy", + "version": "1", + "owner": "AWS", + "provider": "CloudFormation" + }, + "configuration": { + "StackName": "Prod6-Stack2", + "ActionMode": "CHANGE_SET_EXECUTE", + "ChangeSetName": "PipelineChange" + }, + "runOrder": 4, + "roleArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/cdk-hnb659fds-deploy-role-", + { + "Ref": "AWS::AccountId" + }, + "-", + { + "Ref": "AWS::Region" + } + ] + ] + } + } + ] + } + ], + "artifactStore": { + "type": "S3", + "location": { + "Ref": "PipelineArtifactsBucketAEA9A052" + }, + "encryptionKey": { + "type": "KMS", + "id": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + }, + "restartExecutionOnUpdate": true + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codepipeline.CfnPipeline", + "version": "0.0.0" + } + }, + "Source": { + "id": "Source", + "path": "PipelineStack/Pipeline/Pipeline/Source", + "children": { + "tkglaser_cdk-pipelines-demo": { + "id": "tkglaser_cdk-pipelines-demo", + "path": "PipelineStack/Pipeline/Pipeline/Source/tkglaser_cdk-pipelines-demo", + "children": { + "WebhookResource": { + "id": "WebhookResource", + "path": "PipelineStack/Pipeline/Pipeline/Source/tkglaser_cdk-pipelines-demo/WebhookResource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CodePipeline::Webhook", + "aws:cdk:cloudformation:props": { + "authentication": "GITHUB_HMAC", + "authenticationConfiguration": { + "secretToken": "{{resolve:secretsmanager:github-token:SecretString:::}}" + }, + "filters": [ + { + "jsonPath": "$.ref", + "matchEquals": "refs/heads/{Branch}" + } + ], + "targetAction": "tkglaser_cdk-pipelines-demo", + "targetPipeline": { + "Ref": "Pipeline9850B417" + }, + "targetPipelineVersion": 1, + "registerWithThirdParty": true + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codepipeline.CfnWebhook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Build": { + "id": "Build", + "path": "PipelineStack/Pipeline/Pipeline/Build", + "children": { + "Synth": { + "id": "Synth", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth", + "children": { + "CdkBuildProject": { + "id": "CdkBuildProject", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject", + "children": { + "Role": { + "id": "Role", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + }, + ":*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + } + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:BatchPutCodeCoverages", + "codebuild:BatchPutTestCases", + "codebuild:CreateReport", + "codebuild:CreateReportGroup", + "codebuild:UpdateReport" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "PipelineBuildSynthCdkBuildProject6BEFA8E6" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "s3:Abort*", + "s3:DeleteObject*", + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey", + "kms:Encrypt", + "kms:GenerateDataKey*", + "kms:ReEncrypt*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "PipelineBuildSynthCdkBuildProjectRoleDefaultPolicyFB6C941C", + "roles": [ + { + "Ref": "PipelineBuildSynthCdkBuildProjectRole231EEA2A" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/Pipeline/Build/Synth/CdkBuildProject/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CodeBuild::Project", + "aws:cdk:cloudformation:props": { + "artifacts": { + "type": "CODEPIPELINE" + }, + "environment": { + "type": "LINUX_CONTAINER", + "image": "aws/codebuild/standard:5.0", + "imagePullCredentialsType": "CODEBUILD", + "privilegedMode": false, + "computeType": "BUILD_GENERAL1_SMALL" + }, + "serviceRole": { + "Fn::GetAtt": [ + "PipelineBuildSynthCdkBuildProjectRole231EEA2A", + "Arn" + ] + }, + "source": { + "type": "CODEPIPELINE", + "buildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm ci\",\n \"npm run build\",\n \"npx cdk synth\"\n ]\n }\n },\n \"artifacts\": {\n \"base-directory\": \"cdk.out\",\n \"files\": \"**/*\"\n }\n}" + }, + "cache": { + "type": "NO_CACHE" + }, + "description": "Pipeline step PipelineStack/Pipeline/Build/Synth", + "encryptionKey": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codebuild.CfnProject", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codebuild.PipelineProject", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "UpdatePipeline": { + "id": "UpdatePipeline", + "path": "PipelineStack/Pipeline/Pipeline/UpdatePipeline", + "children": { + "SelfMutate": { + "id": "SelfMutate", + "path": "PipelineStack/Pipeline/Pipeline/UpdatePipeline/SelfMutate", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Beta": { + "id": "Beta", + "path": "PipelineStack/Pipeline/Pipeline/Beta", + "children": { + "Stack1.Prepare": { + "id": "Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Beta/Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Stack1.Deploy": { + "id": "Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Beta/Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Stack2.Prepare": { + "id": "Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Beta/Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Stack2.Deploy": { + "id": "Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Beta/Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "MutableRolearn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}": { + "id": "MutableRolearn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "path": "PipelineStack/Pipeline/Pipeline/MutableRolearn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}": { + "id": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "path": "PipelineStack/Pipeline/Pipeline/arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "children": { + "8389e75f-0810-4838-bf64-d6f85a95cf83": { + "id": "8389e75f-0810-4838-bf64-d6f85a95cf83", + "path": "PipelineStack/Pipeline/Pipeline/arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}/8389e75f-0810-4838-bf64-d6f85a95cf83", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "MutableRolearn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}": { + "id": "MutableRolearn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "path": "PipelineStack/Pipeline/Pipeline/MutableRolearn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}": { + "id": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "path": "PipelineStack/Pipeline/Pipeline/arn:${AWS::Partition}:iam::${AWS::AccountId}:role--cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Wave1": { + "id": "Wave1", + "path": "PipelineStack/Pipeline/Pipeline/Wave1", + "children": { + "Prod1.Stack1.Prepare": { + "id": "Prod1.Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod1.Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod2.Stack1.Prepare": { + "id": "Prod2.Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod2.Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod1.Stack1.Deploy": { + "id": "Prod1.Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod1.Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod2.Stack1.Deploy": { + "id": "Prod2.Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod2.Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod1.Stack2.Prepare": { + "id": "Prod1.Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod1.Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod2.Stack2.Prepare": { + "id": "Prod2.Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod2.Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod1.Stack2.Deploy": { + "id": "Prod1.Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod1.Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod2.Stack2.Deploy": { + "id": "Prod2.Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave1/Prod2.Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Wave2": { + "id": "Wave2", + "path": "PipelineStack/Pipeline/Pipeline/Wave2", + "children": { + "Prod3.Stack1.Prepare": { + "id": "Prod3.Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod3.Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod4.Stack1.Prepare": { + "id": "Prod4.Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod4.Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod5.Stack1.Prepare": { + "id": "Prod5.Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod5.Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod6.Stack1.Prepare": { + "id": "Prod6.Stack1.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod6.Stack1.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod3.Stack1.Deploy": { + "id": "Prod3.Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod3.Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod4.Stack1.Deploy": { + "id": "Prod4.Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod4.Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod5.Stack1.Deploy": { + "id": "Prod5.Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod5.Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod6.Stack1.Deploy": { + "id": "Prod6.Stack1.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod6.Stack1.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod3.Stack2.Prepare": { + "id": "Prod3.Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod3.Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod4.Stack2.Prepare": { + "id": "Prod4.Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod4.Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod5.Stack2.Prepare": { + "id": "Prod5.Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod5.Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod6.Stack2.Prepare": { + "id": "Prod6.Stack2.Prepare", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod6.Stack2.Prepare", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod3.Stack2.Deploy": { + "id": "Prod3.Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod3.Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod4.Stack2.Deploy": { + "id": "Prod4.Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod4.Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod5.Stack2.Deploy": { + "id": "Prod5.Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod5.Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "Prod6.Stack2.Deploy": { + "id": "Prod6.Stack2.Deploy", + "path": "PipelineStack/Pipeline/Pipeline/Wave2/Prod6.Stack2.Deploy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codepipeline.Pipeline", + "version": "0.0.0" + } + }, + "CodeBuildActionRole": { + "id": "CodeBuildActionRole", + "path": "PipelineStack/Pipeline/CodeBuildActionRole", + "children": { + "ImportCodeBuildActionRole": { + "id": "ImportCodeBuildActionRole", + "path": "PipelineStack/Pipeline/CodeBuildActionRole/ImportCodeBuildActionRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/CodeBuildActionRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Condition": { + "Bool": { + "aws:ViaAWSService": "codepipeline.amazonaws.com" + } + }, + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "PipelineStack/Pipeline/CodeBuildActionRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/CodeBuildActionRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "codebuild:BatchGetBuilds", + "codebuild:StartBuild", + "codebuild:StopBuild" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineBuildSynthCdkBuildProject6BEFA8E6", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "PipelineUpdatePipelineSelfMutationDAA41400", + "Arn" + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "PipelineCodeBuildActionRoleDefaultPolicy1D62A6FE", + "roles": [ + { + "Ref": "PipelineCodeBuildActionRole226DB0CB" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "UpdatePipeline": { + "id": "UpdatePipeline", + "path": "PipelineStack/Pipeline/UpdatePipeline", + "children": { + "SelfMutation": { + "id": "SelfMutation", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation", + "children": { + "Role": { + "id": "Role", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + }, + ":*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + } + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:BatchPutCodeCoverages", + "codebuild:BatchPutTestCases", + "codebuild:CreateReport", + "codebuild:CreateReportGroup", + "codebuild:UpdateReport" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "PipelineUpdatePipelineSelfMutationDAA41400" + }, + "-*" + ] + ] + } + }, + { + "Action": "sts:AssumeRole", + "Condition": { + "ForAnyValue:StringEquals": { + "iam:ResourceTag/aws-cdk:bootstrap-role": [ + "image-publishing", + "file-publishing", + "deploy" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:*:iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/*" + ] + ] + } + }, + { + "Action": [ + "cloudformation:DescribeStacks", + "s3:ListBucket" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "PipelineArtifactsBucketAEA9A052", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "kms:Decrypt", + "kms:DescribeKey", + "kms:Encrypt", + "kms:GenerateDataKey*", + "kms:ReEncrypt*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "PipelineUpdatePipelineSelfMutationRoleDefaultPolicyA225DA4E", + "roles": [ + { + "Ref": "PipelineUpdatePipelineSelfMutationRole57E559E8" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "PipelineStack/Pipeline/UpdatePipeline/SelfMutation/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CodeBuild::Project", + "aws:cdk:cloudformation:props": { + "artifacts": { + "type": "CODEPIPELINE" + }, + "environment": { + "type": "LINUX_CONTAINER", + "image": "aws/codebuild/standard:5.0", + "imagePullCredentialsType": "CODEBUILD", + "privilegedMode": false, + "computeType": "BUILD_GENERAL1_SMALL" + }, + "serviceRole": { + "Fn::GetAtt": [ + "PipelineUpdatePipelineSelfMutationRole57E559E8", + "Arn" + ] + }, + "source": { + "type": "CODEPIPELINE", + "buildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"npm install -g aws-cdk@1\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cdk -a . deploy PipelineStack --require-approval=never --verbose\"\n ]\n }\n }\n}" + }, + "cache": { + "type": "NO_CACHE" + }, + "description": "Pipeline step PipelineStack/Pipeline/UpdatePipeline/SelfMutate", + "encryptionKey": { + "Fn::GetAtt": [ + "PipelineArtifactsBucketEncryptionKeyF5BF0670", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codebuild.CfnProject", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-codebuild.PipelineProject", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/pipelines.CodePipeline", + "version": "0.0.0" + } + }, + "Beta": { + "id": "Beta", + "path": "PipelineStack/Beta", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Beta/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Beta/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Beta/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Beta/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Beta/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Beta/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Beta/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Beta/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Beta/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Beta/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Beta-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Beta/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Beta/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "Prod1": { + "id": "Prod1", + "path": "PipelineStack/Prod1", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Prod1/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Prod1/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod1/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Prod1/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Prod1/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod1/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod1/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Prod1/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Prod1/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod1/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod1-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod1/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod1/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "Prod2": { + "id": "Prod2", + "path": "PipelineStack/Prod2", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Prod2/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Prod2/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod2/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Prod2/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Prod2/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod2/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod2/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Prod2/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Prod2/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod2/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod2-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod2/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod2/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "Prod3": { + "id": "Prod3", + "path": "PipelineStack/Prod3", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Prod3/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Prod3/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod3/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Prod3/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Prod3/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod3/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod3/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Prod3/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Prod3/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod3/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod3-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod3/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod3/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "Prod4": { + "id": "Prod4", + "path": "PipelineStack/Prod4", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Prod4/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Prod4/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod4/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Prod4/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Prod4/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod4/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod4/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Prod4/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Prod4/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod4/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod4-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod4/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod4/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "Prod5": { + "id": "Prod5", + "path": "PipelineStack/Prod5", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Prod5/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Prod5/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod5/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Prod5/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Prod5/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod5/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod5/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Prod5/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Prod5/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod5/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod5-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod5/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod5/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "Prod6": { + "id": "Prod6", + "path": "PipelineStack/Prod6", + "children": { + "Stack1": { + "id": "Stack1", + "path": "PipelineStack/Prod6/Stack1", + "children": { + "Queue": { + "id": "Queue", + "path": "PipelineStack/Prod6/Stack1/Queue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod6/Stack1/Queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "PipelineStack/Prod6/Stack1/Exports", + "children": { + "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}": { + "id": "Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "path": "PipelineStack/Prod6/Stack1/Exports/Output{\"Fn::GetAtt\":[\"Queue4A7E3555\",\"Arn\"]}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod6/Stack1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod6/Stack1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Stack2": { + "id": "Stack2", + "path": "PipelineStack/Prod6/Stack2", + "children": { + "OtherQueue": { + "id": "OtherQueue", + "path": "PipelineStack/Prod6/Stack2/OtherQueue", + "children": { + "Resource": { + "id": "Resource", + "path": "PipelineStack/Prod6/Stack2/OtherQueue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::ImportValue": "Prod6-Stack1:ExportsOutputFnGetAttQueue4A7E3555Arn15A7202E" + }, + "maxReceiveCount": 5 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.CfnQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-sqs.Queue", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/Prod6/Stack2/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/Prod6/Stack2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stage", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "PipelineStack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "PipelineStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "LambdaTest": { + "id": "LambdaTest", + "path": "LambdaTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "LambdaTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "LambdaTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "LambdaTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "LambdaTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "LambdaTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.ts b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.ts new file mode 100644 index 0000000000000..de79adf2b5081 --- /dev/null +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-cross-account-keys.ts @@ -0,0 +1,64 @@ +import * as sqs from '@aws-cdk/aws-sqs'; +import { App, Stack, StackProps, Stage, StageProps } from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import { Construct } from 'constructs'; + +import * as pipelines from '../lib'; + +class PipelineStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const pipeline = new pipelines.CodePipeline(this, 'Pipeline', { + crossAccountKeys: true, + enableKeyRotation: true, + synth: new pipelines.ShellStep('Synth', { + input: pipelines.CodePipelineSource.gitHub('tkglaser/cdk-pipelines-demo', 'main'), + commands: [ + 'npm ci', + 'npm run build', + 'npx cdk synth', + ], + }), + }); + + pipeline.addStage(new AppStage(this, 'Beta')); + + const group = pipeline.addWave('Wave1'); + group.addStage(new AppStage(this, 'Prod1')); + group.addStage(new AppStage(this, 'Prod2')); + + const group2 = pipeline.addWave('Wave2'); + group2.addStage(new AppStage(this, 'Prod3')); + group2.addStage(new AppStage(this, 'Prod4')); + group2.addStage(new AppStage(this, 'Prod5')); + group2.addStage(new AppStage(this, 'Prod6')); + } +} + +class AppStage extends Stage { + constructor(scope: Construct, id: string, props?: StageProps) { + super(scope, id, props); + + const stack1 = new Stack(this, 'Stack1'); + const queue1 = new sqs.Queue(stack1, 'Queue'); + + const stack2 = new Stack(this, 'Stack2'); + new sqs.Queue(stack2, 'OtherQueue', { + deadLetterQueue: { + queue: queue1, + maxReceiveCount: 5, + }, + }); + } +} + +const app = new App(); + +const stack = new PipelineStack(app, 'PipelineStack'); + +new integ.IntegTest(app, 'LambdaTest', { + testCases: [stack], +}); + +app.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/testhelpers/test-app.ts b/packages/@aws-cdk/pipelines/test/testhelpers/test-app.ts index fca2cd26f04d4..da35f1b979f4e 100644 --- a/packages/@aws-cdk/pipelines/test/testhelpers/test-app.ts +++ b/packages/@aws-cdk/pipelines/test/testhelpers/test-app.ts @@ -75,14 +75,28 @@ export class AppWithOutput extends Stage { } } +export interface TwoStackAppProps extends StageProps { + /** + * Create a dependency between the two stacks + * + * @default true + */ + readonly withDependency?: boolean; +} + export class TwoStackApp extends Stage { - constructor(scope: Construct, id: string, props?: StageProps) { + public readonly stack1: Stack; + public readonly stack2: Stack; + + constructor(scope: Construct, id: string, props?: TwoStackAppProps) { super(scope, id, props); - const stack2 = new BucketStack(this, 'Stack2'); - const stack1 = new BucketStack(this, 'Stack1'); + this.stack2 = new BucketStack(this, 'Stack2'); + this.stack1 = new BucketStack(this, 'Stack1'); - stack2.addDependency(stack1); + if (props?.withDependency ?? true) { + this.stack2.addDependency(this.stack1); + } } } diff --git a/packages/@aws-cdk/region-info/build-tools/fact-tables.ts b/packages/@aws-cdk/region-info/build-tools/fact-tables.ts index 1eb700f733e1e..daac2ea673dd8 100644 --- a/packages/@aws-cdk/region-info/build-tools/fact-tables.ts +++ b/packages/@aws-cdk/region-info/build-tools/fact-tables.ts @@ -507,6 +507,44 @@ export const FIREHOSE_CIDR_BLOCKS: { [region: string]: string } = { }; const ADOT_LAMBDA_LAYER_JAVA_SDK_ARNS: { [version: string]: { [arch: string]: { [region: string]: string } } } = { + '1.21.0': { + x86_64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-21-0:1', + }, + arm64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-21-0:1', + }, + }, '1.19.0': { x86_64: { 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-19-0:1', @@ -550,6 +588,44 @@ const ADOT_LAMBDA_LAYER_JAVA_SDK_ARNS: { [version: string]: { [arch: string]: { const ADOT_LAMBDA_LAYER_JAVA_AUTO_INSTRUMENTATION_ARNS: { [version: string]: { [arch: string]: { [region: string]: string } }; } = { + '1.21.0': { + x86_64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-agent-amd64-ver-1-21-0:1', + }, + arm64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-agent-arm64-ver-1-21-0:1', + }, + }, '1.19.2': { x86_64: { 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-java-agent-amd64-ver-1-19-2:1', @@ -591,6 +667,44 @@ const ADOT_LAMBDA_LAYER_JAVA_AUTO_INSTRUMENTATION_ARNS: { }; const ADOT_LAMBDA_LAYER_JAVASCRIPT_SDK_ARNS: { [version: string]: { [arch: string]: { [region: string]: string } } } = { + '1.8.0': { + x86_64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-nodejs-amd64-ver-1-8-0:2', + }, + arm64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:2', + }, + }, '1.7.0': { x86_64: { 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-7-0:2', @@ -632,6 +746,44 @@ const ADOT_LAMBDA_LAYER_JAVASCRIPT_SDK_ARNS: { [version: string]: { [arch: strin }; const ADOT_LAMBDA_LAYER_PYTHON_SDK_ARNS: { [version: string]: { [arch: string]: { [region: string]: string } } } = { + '1.15.0': { + x86_64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-15-0:2', + }, + arm64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-arm64-ver-1-15-0:2', + }, + }, '1.13.0': { x86_64: { 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-python-amd64-ver-1-13-0:1', @@ -673,6 +825,44 @@ const ADOT_LAMBDA_LAYER_PYTHON_SDK_ARNS: { [version: string]: { [arch: string]: }; const ADOT_LAMBDA_LAYER_GENERIC_ARNS: { [version: string]: { [arch: string]: { [region: string]: string } } } = { + '0.68.0': { + x86_64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-collector-amd64-ver-0-68-0:1', + }, + arm64: { + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'us-west-1': 'arn:aws:lambda:us-west-1:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-collector-arm64-ver-0-68-0:1', + }, + }, '0.62.1': { x86_64: { 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-collector-amd64-ver-0-62-1:1', diff --git a/packages/@aws-cdk/triggers/README.md b/packages/@aws-cdk/triggers/README.md index d859fe1430f34..2c86e946c1941 100644 --- a/packages/@aws-cdk/triggers/README.md +++ b/packages/@aws-cdk/triggers/README.md @@ -39,33 +39,6 @@ new triggers.TriggerFunction(stack, 'MyTrigger', { In the above example, the AWS Lambda function defined in `myLambdaFunction` will be invoked when the stack is deployed. -It is also possible to trigger a predefined Lambda function by using the `Trigger` construct: - -```ts -import * as lambda from '@aws-cdk/aws-lambda'; -import * as triggers from '@aws-cdk/triggers'; -import { Stack } from '@aws-cdk/core'; - -declare const stack: Stack; - -const func = new lambda.Function(stack, 'MyFunction', { - handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, - code: lambda.Code.fromInline('foo'), -}); - -new triggers.Trigger(stack, 'MyTrigger', { - handler: func, - timeout: Duration.minutes(10), - invocationType: triggers.InvocationType.EVENT, -}); -``` - -Addition properties can be used to fine-tune the behaviour of the trigger. -The `timeout` property can be used to determine how long the invocation of the function should take. -The `invocationType` property can be used to change the invocation type of the function. -This might be useful in scenarios where a fire-and-forget strategy for invoking the function is sufficient. - ## Trigger Failures If the trigger handler fails (e.g. an exception is raised), the CloudFormation diff --git a/packages/@aws-cdk/triggers/lib/lambda/index.ts b/packages/@aws-cdk/triggers/lib/lambda/index.ts index 6f3bd38bcc42e..8fb4db66a3cc3 100644 --- a/packages/@aws-cdk/triggers/lib/lambda/index.ts +++ b/packages/@aws-cdk/triggers/lib/lambda/index.ts @@ -3,16 +3,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies import * as AWS from 'aws-sdk'; -export type InvokeFunction = (functionName: string, invocationType: string, timeout: number) => Promise; +export type InvokeFunction = (functionName: string) => Promise; -export const invoke: InvokeFunction = async (functionName, invocationType, timeout) => { - const lambda = new AWS.Lambda({ - httpOptions: { - timeout, - }, - }); - - const invokeRequest = { FunctionName: functionName, InvocationType: invocationType }; +export const invoke: InvokeFunction = async (functionName) => { + const lambda = new AWS.Lambda(); + const invokeRequest = { FunctionName: functionName }; console.log({ invokeRequest }); // IAM policy changes can take some time to fully propagate @@ -56,10 +51,7 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent throw new Error('The "HandlerArn" property is required'); } - const invocationType = event.ResourceProperties.InvocationType; - const timeout = event.ResourceProperties.Timeout; - - const invokeResponse = await invoke(handlerArn, invocationType, timeout); + const invokeResponse = await invoke(handlerArn); if (invokeResponse.StatusCode !== 200) { throw new Error(`Trigger handler failed with status code ${invokeResponse.StatusCode}`); @@ -76,9 +68,7 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent */ function parseError(payload: string | undefined): string { console.log(`Error payload: ${payload}`); - if (!payload) { - return 'unknown handler error'; - } + if (!payload) { return 'unknown handler error'; } try { const error = JSON.parse(payload); const concat = [error.errorMessage, error.trace].filter(x => x).join('\n'); diff --git a/packages/@aws-cdk/triggers/lib/trigger.ts b/packages/@aws-cdk/triggers/lib/trigger.ts index 2a74a0a6fd874..6febb482966cf 100644 --- a/packages/@aws-cdk/triggers/lib/trigger.ts +++ b/packages/@aws-cdk/triggers/lib/trigger.ts @@ -2,7 +2,6 @@ import { join } from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import { CustomResource, CustomResourceProvider, CustomResourceProviderRuntime } from '@aws-cdk/core'; import { Construct, IConstruct, Node } from 'constructs'; -import { Duration } from '../../core'; /** * Interface for triggers. @@ -62,28 +61,6 @@ export interface TriggerOptions { readonly executeOnHandlerChange?: boolean; } -/** - * The invocation type to apply to a trigger. This determines whether the trigger function should await the result of the to be triggered function or not. - */ -export enum InvocationType { - /** - * Invoke the function synchronously. Keep the connection open until the function returns a response or times out. - * The API response includes the function response and additional data. - */ - EVENT = 'Event', - - /** - * Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). - * The API response only includes a status code. - */ - REQUEST_RESPONSE = 'RequestResponse', - - /** - * Validate parameter values and verify that the user or role has permission to invoke the function. - */ - DRY_RUN = 'DryRun' -} - /** * Props for `Trigger`. */ @@ -92,20 +69,6 @@ export interface TriggerProps extends TriggerOptions { * The AWS Lambda function of the handler to execute. */ readonly handler: lambda.Function; - - /** - * The invocation type to invoke the Lambda function with. - * - * @default RequestResponse - */ - readonly invocationType?: InvocationType; - - /** - * The timeout of the invocation call of the Lambda function to be triggered. - * - * @default Duration.minutes(2) - */ - readonly timeout?: Duration; } /** @@ -132,8 +95,6 @@ export class Trigger extends Construct implements ITrigger { serviceToken: provider.serviceToken, properties: { HandlerArn: handlerArn, - InvocationType: props.invocationType ?? 'RequestResponse', - Timeout: props.timeout?.toMilliseconds() ?? Duration.minutes(2).toMilliseconds(), }, }); diff --git a/packages/@aws-cdk/triggers/package.json b/packages/@aws-cdk/triggers/package.json index e3d732a28e934..f755e28bc546c 100644 --- a/packages/@aws-cdk/triggers/package.json +++ b/packages/@aws-cdk/triggers/package.json @@ -76,6 +76,7 @@ "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "aws-sdk": "^2.1211.0", "@aws-cdk/pkglint": "0.0.0", diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.assets.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.assets.json index 8df847aec81d7..773d8e4b077df 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.assets.json +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { "ae344ba0df770ab1ea166e5b55e0ff5681c951c0a34d8e724e430b88957c50d4": { "source": { diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.template.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.template.json index 31625a36f0bee..fde860ed9ad4b 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.template.json +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/MyStack.template.json @@ -3,13 +3,13 @@ "Topic198E71B3E": { "Type": "AWS::SNS::Topic", "DependsOn": [ - "MyTriggerFunctionTrigger5424E7A7" + "MyFunctionTriggerDB129D7B" ] }, "Topic269377B75": { "Type": "AWS::SNS::Topic" }, - "MyTriggerFunctionServiceRole1BB78C29": { + "MyFunctionServiceRole3C357FF2": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -40,7 +40,7 @@ ] } }, - "MyTriggerFunction056842F6": { + "MyFunction3BAA72D1": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -48,18 +48,18 @@ }, "Role": { "Fn::GetAtt": [ - "MyTriggerFunctionServiceRole1BB78C29", + "MyFunctionServiceRole3C357FF2", "Arn" ] }, "Handler": "index.handler", - "Runtime": "nodejs16.x" + "Runtime": "nodejs14.x" }, "DependsOn": [ - "MyTriggerFunctionServiceRole1BB78C29" + "MyFunctionServiceRole3C357FF2" ] }, - "MyTriggerFunctionTrigger5424E7A7": { + "MyFunctionTriggerDB129D7B": { "Type": "Custom::Trigger", "Properties": { "ServiceToken": { @@ -69,10 +69,8 @@ ] }, "HandlerArn": { - "Ref": "MyTriggerFunctionCurrentVersion61957CE160cd5b4c06c4d00191dc10a647ea0777" - }, - "InvocationType": "RequestResponse", - "Timeout": 120000 + "Ref": "MyFunctionCurrentVersion197490AF2cb2bc11080c1ef11d3b49c1f1603957" + } }, "DependsOn": [ "Topic269377B75" @@ -80,11 +78,11 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "MyTriggerFunctionCurrentVersion61957CE160cd5b4c06c4d00191dc10a647ea0777": { + "MyFunctionCurrentVersion197490AF2cb2bc11080c1ef11d3b49c1f1603957": { "Type": "AWS::Lambda::Version", "Properties": { "FunctionName": { - "Ref": "MyTriggerFunction056842F6" + "Ref": "MyFunction3BAA72D1" } } }, @@ -126,29 +124,7 @@ [ { "Fn::GetAtt": [ - "MyTriggerFunction056842F6", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - }, - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": [ - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "MyLambdaFunction67CCA873", + "MyFunction3BAA72D1", "Arn" ] }, @@ -210,87 +186,6 @@ "AWSCDKTriggerCustomResourceProviderCustomResourceProviderRoleE18FAF0A" ] }, - "MyLambdaFunctionServiceRole313A4D46": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "MyLambdaFunction67CCA873": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "ZipFile": "exports.handler = function() { await setTimeout(3*60*1000, \"hi\"); };" - }, - "Role": { - "Fn::GetAtt": [ - "MyLambdaFunctionServiceRole313A4D46", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "nodejs16.x", - "Timeout": 900 - }, - "DependsOn": [ - "MyLambdaFunctionServiceRole313A4D46" - ] - }, - "MyLambdaFunctionCurrentVersion4FAB80ECdc4d4e257bb2b44c9c4b9231f0d16f4c": { - "Type": "AWS::Lambda::Version", - "Properties": { - "FunctionName": { - "Ref": "MyLambdaFunction67CCA873" - } - } - }, - "MyTrigger": { - "Type": "Custom::Trigger", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWSCDKTriggerCustomResourceProviderCustomResourceProviderHandler97BECD91", - "Arn" - ] - }, - "HandlerArn": { - "Ref": "MyLambdaFunctionCurrentVersion4FAB80ECdc4d4e257bb2b44c9c4b9231f0d16f4c" - }, - "InvocationType": "Event", - "Timeout": 60000 - }, - "DependsOn": [ - "Topic198E71B3E", - "Topic269377B75" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, "MySecondFunctionServiceRole5B930841": { "Type": "AWS::IAM::Role", "Properties": { @@ -352,9 +247,7 @@ }, "HandlerArn": { "Ref": "MySecondFunctionCurrentVersion7D497B5D173a4bb1f758991022ea97d651403362" - }, - "InvocationType": "RequestResponse", - "Timeout": 120000 + } }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/TriggerTestDefaultTestDeployAssert61636546.assets.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/TriggerTestDefaultTestDeployAssert61636546.assets.json new file mode 100644 index 0000000000000..88392139295c3 --- /dev/null +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/TriggerTestDefaultTestDeployAssert61636546.assets.json @@ -0,0 +1,19 @@ +{ + "version": "29.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "TriggerTestDefaultTestDeployAssert61636546.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/TriggerTestDefaultTestDeployAssert61636546.template.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/TriggerTestDefaultTestDeployAssert61636546.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/TriggerTestDefaultTestDeployAssert61636546.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/asset.ae344ba0df770ab1ea166e5b55e0ff5681c951c0a34d8e724e430b88957c50d4/index.js b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/asset.ae344ba0df770ab1ea166e5b55e0ff5681c951c0a34d8e724e430b88957c50d4/index.js deleted file mode 100644 index ce730c11860f7..0000000000000 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/asset.ae344ba0df770ab1ea166e5b55e0ff5681c951c0a34d8e724e430b88957c50d4/index.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = exports.invoke = void 0; -// eslint-disable-next-line import/no-extraneous-dependencies -const AWS = require("aws-sdk"); -exports.invoke = async (functionName) => { - const lambda = new AWS.Lambda(); - const invokeRequest = { FunctionName: functionName }; - console.log({ invokeRequest }); - // IAM policy changes can take some time to fully propagate - // Therefore, retry for up to one minute - let retryCount = 0; - const delay = 5000; - let invokeResponse; - while (true) { - try { - invokeResponse = await lambda.invoke(invokeRequest).promise(); - break; - } - catch (error) { - if (error instanceof Error && error.code === 'AccessDeniedException' && retryCount < 12) { - retryCount++; - await new Promise((resolve) => { - setTimeout(resolve, delay); - }); - continue; - } - throw error; - } - } - console.log({ invokeResponse }); - return invokeResponse; -}; -async function handler(event) { - console.log({ ...event, ResponseURL: '...' }); - if (event.RequestType === 'Delete') { - console.log('not calling trigger on DELETE'); - return; - } - const handlerArn = event.ResourceProperties.HandlerArn; - if (!handlerArn) { - throw new Error('The "HandlerArn" property is required'); - } - const invokeResponse = await exports.invoke(handlerArn); - if (invokeResponse.StatusCode !== 200) { - throw new Error(`Trigger handler failed with status code ${invokeResponse.StatusCode}`); - } - // if the lambda function throws an error, parse the error message and fail - if (invokeResponse.FunctionError) { - throw new Error(parseError(invokeResponse.Payload?.toString())); - } -} -exports.handler = handler; -/** - * Parse the error message from the lambda function. - */ -function parseError(payload) { - console.log(`Error payload: ${payload}`); - if (!payload) { - return 'unknown handler error'; - } - try { - const error = JSON.parse(payload); - const concat = [error.errorMessage, error.trace].filter(x => x).join('\n'); - return concat.length > 0 ? concat : payload; - } - catch (e) { - // fall back to just returning the payload - return payload; - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsK0JBQStCOzs7QUFFL0IsNkRBQTZEO0FBQzdELCtCQUErQjtBQUlsQixRQUFBLE1BQU0sR0FBbUIsS0FBSyxFQUFFLFlBQVksRUFBRSxFQUFFO0lBQzNELE1BQU0sTUFBTSxHQUFHLElBQUksR0FBRyxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQ2hDLE1BQU0sYUFBYSxHQUFHLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSxDQUFDO0lBQ3JELE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxhQUFhLEVBQUUsQ0FBQyxDQUFDO0lBRS9CLDJEQUEyRDtJQUMzRCx3Q0FBd0M7SUFFeEMsSUFBSSxVQUFVLEdBQUcsQ0FBQyxDQUFDO0lBQ25CLE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQztJQUVuQixJQUFJLGNBQWMsQ0FBQztJQUNuQixPQUFPLElBQUksRUFBRTtRQUNYLElBQUk7WUFDRixjQUFjLEdBQUcsTUFBTSxNQUFNLENBQUMsTUFBTSxDQUFDLGFBQWEsQ0FBQyxDQUFDLE9BQU8sRUFBRSxDQUFDO1lBQzlELE1BQU07U0FDUDtRQUFDLE9BQU8sS0FBSyxFQUFFO1lBQ2QsSUFBSSxLQUFLLFlBQVksS0FBSyxJQUFLLEtBQXNCLENBQUMsSUFBSSxLQUFLLHVCQUF1QixJQUFJLFVBQVUsR0FBRyxFQUFFLEVBQUU7Z0JBQ3pHLFVBQVUsRUFBRSxDQUFDO2dCQUNiLE1BQU0sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsRUFBRTtvQkFDNUIsVUFBVSxDQUFDLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztnQkFDN0IsQ0FBQyxDQUFDLENBQUM7Z0JBQ0gsU0FBUzthQUNWO1lBRUQsTUFBTSxLQUFLLENBQUM7U0FDYjtLQUNGO0lBRUQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLGNBQWMsRUFBRSxDQUFDLENBQUM7SUFDaEMsT0FBTyxjQUFjLENBQUM7QUFDeEIsQ0FBQyxDQUFDO0FBRUssS0FBSyxVQUFVLE9BQU8sQ0FBQyxLQUFrRDtJQUM5RSxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxLQUFLLEVBQUUsV0FBVyxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUM7SUFFOUMsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUNsQyxPQUFPLENBQUMsR0FBRyxDQUFDLCtCQUErQixDQUFDLENBQUM7UUFDN0MsT0FBTztLQUNSO0lBRUQsTUFBTSxVQUFVLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLFVBQVUsQ0FBQztJQUN2RCxJQUFJLENBQUMsVUFBVSxFQUFFO1FBQ2YsTUFBTSxJQUFJLEtBQUssQ0FBQyx1Q0FBdUMsQ0FBQyxDQUFDO0tBQzFEO0lBRUQsTUFBTSxjQUFjLEdBQUcsTUFBTSxjQUFNLENBQUMsVUFBVSxDQUFDLENBQUM7SUFFaEQsSUFBSSxjQUFjLENBQUMsVUFBVSxLQUFLLEdBQUcsRUFBRTtRQUNyQyxNQUFNLElBQUksS0FBSyxDQUFDLDJDQUEyQyxjQUFjLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQztLQUN6RjtJQUVELDJFQUEyRTtJQUMzRSxJQUFJLGNBQWMsQ0FBQyxhQUFhLEVBQUU7UUFDaEMsTUFBTSxJQUFJLEtBQUssQ0FBQyxVQUFVLENBQUMsY0FBYyxDQUFDLE9BQU8sRUFBRSxRQUFRLEVBQUUsQ0FBQyxDQUFDLENBQUM7S0FDakU7QUFDSCxDQUFDO0FBdkJELDBCQXVCQztBQUVEOztHQUVHO0FBQ0gsU0FBUyxVQUFVLENBQUMsT0FBMkI7SUFDN0MsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsT0FBTyxFQUFFLENBQUMsQ0FBQztJQUN6QyxJQUFJLENBQUMsT0FBTyxFQUFFO1FBQUUsT0FBTyx1QkFBdUIsQ0FBQztLQUFFO0lBQ2pELElBQUk7UUFDRixNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ2xDLE1BQU0sTUFBTSxHQUFHLENBQUMsS0FBSyxDQUFDLFlBQVksRUFBRSxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQzNFLE9BQU8sTUFBTSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDO0tBQzdDO0lBQUMsT0FBTyxDQUFDLEVBQUU7UUFDViwwQ0FBMEM7UUFDMUMsT0FBTyxPQUFPLENBQUM7S0FDaEI7QUFDSCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgaW1wb3J0L25vLWV4dHJhbmVvdXMtZGVwZW5kZW5jaWVzXG5pbXBvcnQgKiBhcyBBV1MgZnJvbSAnYXdzLXNkayc7XG5cbmV4cG9ydCB0eXBlIEludm9rZUZ1bmN0aW9uID0gKGZ1bmN0aW9uTmFtZTogc3RyaW5nKSA9PiBQcm9taXNlPEFXUy5MYW1iZGEuSW52b2NhdGlvblJlc3BvbnNlPjtcblxuZXhwb3J0IGNvbnN0IGludm9rZTogSW52b2tlRnVuY3Rpb24gPSBhc3luYyAoZnVuY3Rpb25OYW1lKSA9PiB7XG4gIGNvbnN0IGxhbWJkYSA9IG5ldyBBV1MuTGFtYmRhKCk7XG4gIGNvbnN0IGludm9rZVJlcXVlc3QgPSB7IEZ1bmN0aW9uTmFtZTogZnVuY3Rpb25OYW1lIH07XG4gIGNvbnNvbGUubG9nKHsgaW52b2tlUmVxdWVzdCB9KTtcblxuICAvLyBJQU0gcG9saWN5IGNoYW5nZXMgY2FuIHRha2Ugc29tZSB0aW1lIHRvIGZ1bGx5IHByb3BhZ2F0ZVxuICAvLyBUaGVyZWZvcmUsIHJldHJ5IGZvciB1cCB0byBvbmUgbWludXRlXG5cbiAgbGV0IHJldHJ5Q291bnQgPSAwO1xuICBjb25zdCBkZWxheSA9IDUwMDA7XG5cbiAgbGV0IGludm9rZVJlc3BvbnNlO1xuICB3aGlsZSAodHJ1ZSkge1xuICAgIHRyeSB7XG4gICAgICBpbnZva2VSZXNwb25zZSA9IGF3YWl0IGxhbWJkYS5pbnZva2UoaW52b2tlUmVxdWVzdCkucHJvbWlzZSgpO1xuICAgICAgYnJlYWs7XG4gICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgIGlmIChlcnJvciBpbnN0YW5jZW9mIEVycm9yICYmIChlcnJvciBhcyBBV1MuQVdTRXJyb3IpLmNvZGUgPT09ICdBY2Nlc3NEZW5pZWRFeGNlcHRpb24nICYmIHJldHJ5Q291bnQgPCAxMikge1xuICAgICAgICByZXRyeUNvdW50Kys7XG4gICAgICAgIGF3YWl0IG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7XG4gICAgICAgICAgc2V0VGltZW91dChyZXNvbHZlLCBkZWxheSk7XG4gICAgICAgIH0pO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgdGhyb3cgZXJyb3I7XG4gICAgfVxuICB9XG5cbiAgY29uc29sZS5sb2coeyBpbnZva2VSZXNwb25zZSB9KTtcbiAgcmV0dXJuIGludm9rZVJlc3BvbnNlO1xufTtcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGhhbmRsZXIoZXZlbnQ6IEFXU0xhbWJkYS5DbG91ZEZvcm1hdGlvbkN1c3RvbVJlc291cmNlRXZlbnQpIHtcbiAgY29uc29sZS5sb2coeyAuLi5ldmVudCwgUmVzcG9uc2VVUkw6ICcuLi4nIH0pO1xuXG4gIGlmIChldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ0RlbGV0ZScpIHtcbiAgICBjb25zb2xlLmxvZygnbm90IGNhbGxpbmcgdHJpZ2dlciBvbiBERUxFVEUnKTtcbiAgICByZXR1cm47XG4gIH1cblxuICBjb25zdCBoYW5kbGVyQXJuID0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkhhbmRsZXJBcm47XG4gIGlmICghaGFuZGxlckFybikge1xuICAgIHRocm93IG5ldyBFcnJvcignVGhlIFwiSGFuZGxlckFyblwiIHByb3BlcnR5IGlzIHJlcXVpcmVkJyk7XG4gIH1cblxuICBjb25zdCBpbnZva2VSZXNwb25zZSA9IGF3YWl0IGludm9rZShoYW5kbGVyQXJuKTtcblxuICBpZiAoaW52b2tlUmVzcG9uc2UuU3RhdHVzQ29kZSAhPT0gMjAwKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKGBUcmlnZ2VyIGhhbmRsZXIgZmFpbGVkIHdpdGggc3RhdHVzIGNvZGUgJHtpbnZva2VSZXNwb25zZS5TdGF0dXNDb2RlfWApO1xuICB9XG5cbiAgLy8gaWYgdGhlIGxhbWJkYSBmdW5jdGlvbiB0aHJvd3MgYW4gZXJyb3IsIHBhcnNlIHRoZSBlcnJvciBtZXNzYWdlIGFuZCBmYWlsXG4gIGlmIChpbnZva2VSZXNwb25zZS5GdW5jdGlvbkVycm9yKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKHBhcnNlRXJyb3IoaW52b2tlUmVzcG9uc2UuUGF5bG9hZD8udG9TdHJpbmcoKSkpO1xuICB9XG59XG5cbi8qKlxuICogUGFyc2UgdGhlIGVycm9yIG1lc3NhZ2UgZnJvbSB0aGUgbGFtYmRhIGZ1bmN0aW9uLlxuICovXG5mdW5jdGlvbiBwYXJzZUVycm9yKHBheWxvYWQ6IHN0cmluZyB8IHVuZGVmaW5lZCk6IHN0cmluZyB7XG4gIGNvbnNvbGUubG9nKGBFcnJvciBwYXlsb2FkOiAke3BheWxvYWR9YCk7XG4gIGlmICghcGF5bG9hZCkgeyByZXR1cm4gJ3Vua25vd24gaGFuZGxlciBlcnJvcic7IH1cbiAgdHJ5IHtcbiAgICBjb25zdCBlcnJvciA9IEpTT04ucGFyc2UocGF5bG9hZCk7XG4gICAgY29uc3QgY29uY2F0ID0gW2Vycm9yLmVycm9yTWVzc2FnZSwgZXJyb3IudHJhY2VdLmZpbHRlcih4ID0+IHgpLmpvaW4oJ1xcbicpO1xuICAgIHJldHVybiBjb25jYXQubGVuZ3RoID4gMCA/IGNvbmNhdCA6IHBheWxvYWQ7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICAvLyBmYWxsIGJhY2sgdG8ganVzdCByZXR1cm5pbmcgdGhlIHBheWxvYWRcbiAgICByZXR1cm4gcGF5bG9hZDtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/cdk.out b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/cdk.out index 8ecc185e9dbee..d8b441d447f8a 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/cdk.out +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/integ.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/integ.json index b4504318819ec..c3f252d62f24a 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/integ.json +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/integ.json @@ -1,14 +1,13 @@ { - "version": "21.0.0", + "version": "29.0.0", "testCases": { - "integ.triggers": { + "TriggerTest/DefaultTest": { "stacks": [ "MyStack" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "stackUpdateWorkflow": false, + "assertionStack": "TriggerTest/DefaultTest/DeployAssert", + "assertionStackName": "TriggerTestDefaultTestDeployAssert61636546" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/manifest.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/manifest.json index 3d5b9b4d8ad8c..af20c114f2b3a 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/manifest.json +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "MyStack.assets": { "type": "cdk:asset-manifest", "properties": { @@ -125,6 +119,59 @@ ] }, "displayName": "MyStack" + }, + "TriggerTestDefaultTestDeployAssert61636546.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "TriggerTestDefaultTestDeployAssert61636546.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "TriggerTestDefaultTestDeployAssert61636546": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "TriggerTestDefaultTestDeployAssert61636546.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "TriggerTestDefaultTestDeployAssert61636546.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "TriggerTestDefaultTestDeployAssert61636546.assets" + ], + "metadata": { + "/TriggerTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/TriggerTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "TriggerTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/tree.json b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/tree.json index ce611702798b3..fe95d9122da51 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/tree.json +++ b/packages/@aws-cdk/triggers/test/integ.triggers.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.140" - } - }, "MyStack": { "id": "MyStack", "path": "MyStack", @@ -68,6 +60,14 @@ "id": "ServiceRole", "path": "MyStack/MyFunction/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "MyStack/MyFunction/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "MyStack/MyFunction/ServiceRole/Resource", @@ -239,6 +239,14 @@ "id": "ServiceRole", "path": "MyStack/MySecondFunction/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "MyStack/MySecondFunction/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "MyStack/MySecondFunction/ServiceRole/Resource", @@ -367,12 +375,90 @@ "fqn": "@aws-cdk/triggers.TriggerFunction", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "MyStack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "MyStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "TriggerTest": { + "id": "TriggerTest", + "path": "TriggerTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "TriggerTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "TriggerTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.216" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "TriggerTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "TriggerTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "TriggerTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.216" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/triggers/test/integ.triggers.ts b/packages/@aws-cdk/triggers/test/integ.triggers.ts index de5023461ed2e..e59101eaf53b4 100644 --- a/packages/@aws-cdk/triggers/test/integ.triggers.ts +++ b/packages/@aws-cdk/triggers/test/integ.triggers.ts @@ -1,8 +1,8 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; -import { App, Duration, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; import * as triggers from '../lib'; -import { InvocationType } from '../lib'; const app = new App(); const stack = new Stack(app, 'MyStack'); @@ -10,28 +10,13 @@ const stack = new Stack(app, 'MyStack'); const topic1 = new sns.Topic(stack, 'Topic1'); const topic2 = new sns.Topic(stack, 'Topic2'); -const triggerFunction = new triggers.TriggerFunction(stack, 'MyTriggerFunction', { - runtime: lambda.Runtime.NODEJS_16_X, +const trigger = new triggers.TriggerFunction(stack, 'MyFunction', { + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function() { console.log("hi"); };'), executeBefore: [topic1], }); -const func = new lambda.Function(stack, 'MyLambdaFunction', { - runtime: lambda.Runtime.NODEJS_16_X, - handler: 'index.handler', - timeout: Duration.minutes(15), - code: lambda.Code.fromInline('exports.handler = function() { await setTimeout(3*60*1000, "hi"); };'), -}); - -const trigger = new triggers.Trigger(stack, 'MyTrigger', { - handler: func, - invocationType: InvocationType.EVENT, - timeout: Duration.minutes(1), - executeAfter: [topic1], -}); - -triggerFunction.executeAfter(topic2); trigger.executeAfter(topic2); new triggers.TriggerFunction(stack, 'MySecondFunction', { @@ -40,4 +25,8 @@ new triggers.TriggerFunction(stack, 'MySecondFunction', { code: lambda.Code.fromInline('exports.handler = function() { console.log("hello"); };'), }); +new integ.IntegTest(app, 'TriggerTest', { + testCases: [stack], +}); + app.synth(); diff --git a/packages/@aws-cdk/triggers/test/trigger-handler.test.ts b/packages/@aws-cdk/triggers/test/trigger-handler.test.ts index 09a4d77a657b5..18eea6a881ceb 100644 --- a/packages/@aws-cdk/triggers/test/trigger-handler.test.ts +++ b/packages/@aws-cdk/triggers/test/trigger-handler.test.ts @@ -29,8 +29,6 @@ const mockRequest = { ResourceProperties: { ServiceToken: 'arn:aws:lambda:us-east-1:123456789012:function:MyFunction', HandlerArn: handlerArn, - Timeout: 600, - InvocationType: 'Event', }, RequestId: 'MyRequestId', ResourceType: 'Custom::Trigger', @@ -41,14 +39,14 @@ test('Create', async () => { await lambda.handler({ RequestType: 'Create', ...mockRequest }); expect(invokeMock).toBeCalledTimes(1); - expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn, InvocationType: 'Event' }); + expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn }); }); test('Update', async () => { await lambda.handler({ RequestType: 'Update', PhysicalResourceId: 'PRID', OldResourceProperties: {}, ...mockRequest }); expect(invokeMock).toBeCalledTimes(1); - expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn, InvocationType: 'Event' }); + expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn }); }); test('Delete - handler not called', async () => { @@ -66,7 +64,7 @@ test('non-200 status code throws an error', async () => { .toMatchObject({ message: 'Trigger handler failed with status code 500' }); expect(invokeMock).toBeCalledTimes(1); - expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn, InvocationType: 'Event' }); + expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn }); }); test('retry with access denied exception', async () => { @@ -83,7 +81,7 @@ test('retry with access denied exception', async () => { await response; expect(invokeMock).toBeCalledTimes(2); - expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn, InvocationType: 'Event' }); + expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn }); }); test('throws an error for other exceptions', async () => { @@ -96,7 +94,7 @@ test('throws an error for other exceptions', async () => { .toThrow(); expect(invokeMock).toBeCalledTimes(1); - expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn, InvocationType: 'Event' }); + expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn }); }); describe('function error', () => { @@ -113,7 +111,7 @@ describe('function error', () => { .toMatchObject({ message: expectedError }); expect(invokeMock).toBeCalledTimes(1); - expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn, InvocationType: 'Event' }); + expect(invokeMock).toBeCalledWith({ FunctionName: handlerArn }); }; }; diff --git a/packages/@aws-cdk/triggers/test/triggers.test.ts b/packages/@aws-cdk/triggers/test/triggers.test.ts index 8c3b4d05a29e9..cc4edb610bade 100644 --- a/packages/@aws-cdk/triggers/test/triggers.test.ts +++ b/packages/@aws-cdk/triggers/test/triggers.test.ts @@ -1,11 +1,10 @@ import { Template } from '@aws-cdk/assertions'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; -import { Duration, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; import * as triggers from '../lib'; -import { InvocationType } from '../lib'; -test('minimal trigger function', () => { +test('minimal', () => { // GIVEN const stack = new Stack(); @@ -90,51 +89,3 @@ test('multiple functions', () => { const triggerIamRole = roles.AWSCDKTriggerCustomResourceProviderCustomResourceProviderRoleE18FAF0A; expect(triggerIamRole.Properties.Policies[0].PolicyDocument.Statement.length).toBe(2); }); - -test('minimal trigger', () => { - // GIVEN - const stack = new Stack(); - const func = new lambda.Function(stack, 'MyFunction', { - handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, - code: lambda.Code.fromInline('foo'), - }); - - // WHEN - new triggers.Trigger(stack, 'MyTrigger', { - handler: func, - }); - - // THEN - const template = Template.fromStack(stack); - template.hasResourceProperties('AWS::Lambda::Function', {}); - template.hasResourceProperties('Custom::Trigger', { - HandlerArn: { Ref: 'MyFunctionCurrentVersion197490AF2e4e06d52af2bb609d8c23243d665966' }, - }); -}); - -test('trigger with optional properties', () => { - // GIVEN - const stack = new Stack(); - const func = new lambda.Function(stack, 'MyFunction', { - handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, - code: lambda.Code.fromInline('foo'), - }); - - // WHEN - new triggers.Trigger(stack, 'MyTrigger', { - handler: func, - timeout: Duration.minutes(10), - invocationType: InvocationType.EVENT, - }); - - // THEN - const template = Template.fromStack(stack); - template.hasResourceProperties('AWS::Lambda::Function', {}); - template.hasResourceProperties('Custom::Trigger', { - HandlerArn: { Ref: 'MyFunctionCurrentVersion197490AF2e4e06d52af2bb609d8c23243d665966' }, - Timeout: 600000, - InvocationType: 'Event', - }); -}); diff --git a/packages/aws-cdk-lib/.gitignore b/packages/aws-cdk-lib/.gitignore index efd95a4895576..a667f73ca1665 100644 --- a/packages/aws-cdk-lib/.gitignore +++ b/packages/aws-cdk-lib/.gitignore @@ -6,6 +6,9 @@ !NOTICE !README.md !scripts/ +!scripts/*.ts +!scripts/*.sh +scripts/*.d.ts .LAST_BUILD *.snk diff --git a/packages/aws-cdk-lib/.npmignore b/packages/aws-cdk-lib/.npmignore index 44a8a9aac9fbe..059501e441fd2 100644 --- a/packages/aws-cdk-lib/.npmignore +++ b/packages/aws-cdk-lib/.npmignore @@ -14,6 +14,7 @@ coverage # Build gear build-tools dist +scripts .LAST_BUILD .LAST_PACKAGE @@ -23,6 +24,7 @@ tsconfig.json !.jsii !.jsii.gz .eslintrc.js + # exclude cdk artifacts **/cdk.out junit.xml diff --git a/packages/aws-cdk-lib/README.md b/packages/aws-cdk-lib/README.md index c9a97272cf271..36e22c04f3117 100644 --- a/packages/aws-cdk-lib/README.md +++ b/packages/aws-cdk-lib/README.md @@ -900,6 +900,48 @@ resourceB.addDependency(resourceA); [cfn-resource-attributes]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-product-attribute-reference.html +#### CreationPolicy + +Some resources support a [CreationPolicy][creation-policy] to be specified as a CfnOption. + +The creation policy is invoked only when AWS CloudFormation creates the associated resource. Currently, the only AWS CloudFormation resources that support creation policies are `CfnAutoScalingGroup`, `CfnInstance`, `CfnWaitCondition` and `CfnFleet`. + +The `CfnFleet` resource from the `aws-appstream` module supports specifying `startFleet` as +a property of the creationPolicy on the resource options. Setting it to true will make AWS CloudFormation wait until the fleet is started before continuing with the creation of +resources that depend on the fleet resource. + +```ts +const fleet = new CfnFleet(stack, 'Fleet', { + instanceType: 'stream.standard.small', + name: 'Fleet', + computeCapacity: { + desiredInstances: 1, + }, + imageName: 'AppStream-AmazonLinux2-09-21-2022', +}); +fleet.cfnOptions.creationPolicy = { + startFleet: true, +}; +``` + +The properties passed to the level 2 constructs `AutoScalingGroup` and `Instance` from the +`aws-ec2` module abstract what is passed into the `CfnOption` properties `resourceSignal` and +`autoScalingCreationPolicy`, but when using level 1 constructs you can specify these yourself. + +The CfnWaitCondition resource from the `aws-cloudformation` module suppports the `resourceSignal`. +The format of the timeout is `PT#H#M#S`. In the example below AWS Cloudformation will wait for +3 success signals to occur within 15 minutes before the status of the resource will be set to +`CREATE_COMPLETE`. + +```ts +resource.cfnOptions.resourceSignal = { + count: 3, + timeout: 'PR15M', +} +``` + +[creation-policy]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html + ### Intrinsic Functions and Condition Expressions CloudFormation supports [intrinsic functions][cfn-intrinsics]. These functions diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 056302b473589..3aef4d4eef1bb 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -111,7 +111,7 @@ "ignore": "^5.2.4", "jsonschema": "^1.4.1", "minimatch": "^3.1.2", - "punycode": "^2.1.1", + "punycode": "^2.2.0", "semver": "^7.3.8", "yaml": "1.10.2", "@aws-cdk/asset-awscli-v1": "^2.2.49", @@ -252,6 +252,7 @@ "@aws-cdk/aws-ivs": "0.0.0", "@aws-cdk/aws-kafkaconnect": "0.0.0", "@aws-cdk/aws-kendra": "0.0.0", + "@aws-cdk/aws-kendraranking": "0.0.0", "@aws-cdk/aws-kinesis": "0.0.0", "@aws-cdk/aws-kinesisanalytics": "0.0.0", "@aws-cdk/aws-kinesisanalytics-flink": "0.0.0", @@ -379,7 +380,7 @@ "@types/fs-extra": "^8.1.2", "@types/node": "^14.18.36", "constructs": "^10.0.0", - "esbuild": "^0.16.13", + "esbuild": "^0.16.16", "fs-extra": "^9.1.0", "ts-node": "^9.1.1", "typescript": "~3.8.3" @@ -405,7 +406,10 @@ "excludeExperimentalModules": true }, "exports": { - ".": "./index.js", + ".": { + "import": "./index.js", + "require": "./lazy-index.js" + }, "./package.json": "./package.json", "./.jsii": "./.jsii", "./.warnings.jsii.js": "./.warnings.jsii.js", @@ -479,6 +483,7 @@ "./aws-dlm": "./aws-dlm/index.js", "./aws-dms": "./aws-dms/index.js", "./aws-docdb": "./aws-docdb/index.js", + "./aws-docdbelastic": "./aws-docdbelastic/index.js", "./aws-dynamodb": "./aws-dynamodb/index.js", "./aws-ec2": "./aws-ec2/index.js", "./aws-ecr": "./aws-ecr/index.js", @@ -511,6 +516,7 @@ "./aws-globalaccelerator": "./aws-globalaccelerator/index.js", "./aws-globalaccelerator-endpoints": "./aws-globalaccelerator-endpoints/index.js", "./aws-glue": "./aws-glue/index.js", + "./aws-grafana": "./aws-grafana/index.js", "./aws-greengrass": "./aws-greengrass/index.js", "./aws-greengrassv2": "./aws-greengrassv2/index.js", "./aws-groundstation": "./aws-groundstation/index.js", @@ -535,6 +541,7 @@ "./aws-ivs": "./aws-ivs/index.js", "./aws-kafkaconnect": "./aws-kafkaconnect/index.js", "./aws-kendra": "./aws-kendra/index.js", + "./aws-kendraranking": "./aws-kendraranking/index.js", "./aws-kinesis": "./aws-kinesis/index.js", "./aws-kinesisanalytics": "./aws-kinesisanalytics/index.js", "./aws-kinesisanalyticsv2": "./aws-kinesisanalyticsv2/index.js", @@ -571,13 +578,17 @@ "./aws-networkfirewall": "./aws-networkfirewall/index.js", "./aws-networkmanager": "./aws-networkmanager/index.js", "./aws-nimblestudio": "./aws-nimblestudio/index.js", + "./aws-oam": "./aws-oam/index.js", + "./aws-opensearchserverless": "./aws-opensearchserverless/index.js", "./aws-opensearchservice": "./aws-opensearchservice/index.js", "./aws-opsworks": "./aws-opsworks/index.js", "./aws-opsworkscm": "./aws-opsworkscm/index.js", + "./aws-organizations": "./aws-organizations/index.js", "./aws-panorama": "./aws-panorama/index.js", "./aws-personalize": "./aws-personalize/index.js", "./aws-pinpoint": "./aws-pinpoint/index.js", "./aws-pinpointemail": "./aws-pinpointemail/index.js", + "./aws-pipes": "./aws-pipes/index.js", "./aws-qldb": "./aws-qldb/index.js", "./aws-quicksight": "./aws-quicksight/index.js", "./aws-ram": "./aws-ram/index.js", @@ -587,6 +598,7 @@ "./aws-refactorspaces": "./aws-refactorspaces/index.js", "./aws-rekognition": "./aws-rekognition/index.js", "./aws-resiliencehub": "./aws-resiliencehub/index.js", + "./aws-resourceexplorer2": "./aws-resourceexplorer2/index.js", "./aws-resourcegroups": "./aws-resourcegroups/index.js", "./aws-robomaker": "./aws-robomaker/index.js", "./aws-rolesanywhere": "./aws-rolesanywhere/index.js", @@ -605,6 +617,7 @@ "./aws-s3outposts": "./aws-s3outposts/index.js", "./aws-sagemaker": "./aws-sagemaker/index.js", "./aws-sam": "./aws-sam/index.js", + "./aws-scheduler": "./aws-scheduler/index.js", "./aws-sdb": "./aws-sdb/index.js", "./aws-secretsmanager": "./aws-secretsmanager/index.js", "./aws-securityhub": "./aws-securityhub/index.js", diff --git a/packages/aws-cdk-lib/scripts/minify-sources.sh b/packages/aws-cdk-lib/scripts/minify-sources.sh index a728bc11430f5..9b0fd1b480bd0 100644 --- a/packages/aws-cdk-lib/scripts/minify-sources.sh +++ b/packages/aws-cdk-lib/scripts/minify-sources.sh @@ -17,7 +17,6 @@ scriptdir=$(cd $(dirname $0) && pwd) cd ${scriptdir}/.. find . -name '*.js' ! -name '.eslintrc.js' ! -path '*node_modules*' | xargs npx esbuild \ - --sourcemap \ --platform=node \ --format=cjs \ --minify-whitespace \ diff --git a/packages/aws-cdk/.npmignore b/packages/aws-cdk/.npmignore index 7c198b16e73f8..2a474fe68b670 100644 --- a/packages/aws-cdk/.npmignore +++ b/packages/aws-cdk/.npmignore @@ -11,9 +11,6 @@ dist .LAST_BUILD *.snk -!test/integ/cli/**/*.js -!test/integ/run-wrappers/dist - *.tsbuildinfo jest.config.js @@ -24,10 +21,7 @@ tsconfig.json !lib/init-templates/**/tsconfig.json !lib/init-templates/**/jest.config.js -!test/integ/cli/jest.config.js -!test/integ/uberpackage/jest.config.js -!test/integ/cli-regression-patches/**/* -!test/integ/cli/sam_cdk_integ_app/**/*.ts +!test/integ/**/* .DS_Store diff --git a/packages/aws-cdk/THIRD_PARTY_LICENSES b/packages/aws-cdk/THIRD_PARTY_LICENSES index e007b3b3013db..fbcf5fe07f1b5 100644 --- a/packages/aws-cdk/THIRD_PARTY_LICENSES +++ b/packages/aws-cdk/THIRD_PARTY_LICENSES @@ -1,6 +1,6 @@ The aws-cdk package includes the following third-party software/licensing: -** @jsii/check-node@1.72.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.72.0 | Apache-2.0 +** @jsii/check-node@1.73.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.73.0 | Apache-2.0 jsii Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -268,7 +268,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1287.0 - https://www.npmjs.com/package/aws-sdk/v/2.1287.0 | Apache-2.0 +** aws-sdk@2.1292.0 - https://www.npmjs.com/package/aws-sdk/v/2.1292.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/aws-cdk/lib/api/aws-auth/aws-sdk-inifile.ts b/packages/aws-cdk/lib/api/aws-auth/aws-sdk-inifile.ts index 330ea62665c55..0ff4d3980c0c1 100644 --- a/packages/aws-cdk/lib/api/aws-auth/aws-sdk-inifile.ts +++ b/packages/aws-cdk/lib/api/aws-auth/aws-sdk-inifile.ts @@ -7,24 +7,13 @@ import * as AWS from 'aws-sdk'; * There are a number of issues in the upstream version of SharedIniFileCredentials * that need fixing: * - * 1. The upstream aws-sdk contains an incorrect instantiation of an `AWS.STS` - * client, which *should* have taken the region from the requested profile - * but doesn't. It will use the region from the default profile, which - * may not exist, defaulting to `us-east-1` (since we switched to - * AWS_STS_REGIONAL_ENDPOINTS=regional, that default is not even allowed anymore - * and the absence of a default region will lead to an error). + * 1. The upstream aws-sdk does not support the 'credential_source' option. Meaning credentials + * for assume-role cannot be fetched using EC2/ESC metadata. * - * 2. The simple fix is to get the region from the `config` file. profiles - * are made up of a combination of `credentials` and `config`, and the region is - * generally in `config` with the rest in `credentials`. However, a bug in - * `getProfilesFromSharedConfig` overwrites ALL `config` data with `credentials` - * data, so we also need to do extra work to fish the `region` out of the config. - * - * 3. The 'credential_source' option is not supported. Meaning credentials - * for assume-role cannot be fetched using EC2/ESC metadata. - * - * See https://github.com/aws/aws-sdk-js/issues/3418 for all the gory details. - * See https://github.com/aws/aws-sdk-js/issues/1916 for some more glory details. + * 2. The upstream aws-sdk does not support SSO profiles as the source of RoleProfiles, + * because it will always use the `SharedIniFileCredentials` provider to load + * source credentials, but in order to support SSO profiles you must use a + * separate class (`SsoCredentials). */ export class PatchedSharedIniFileCredentials extends AWS.SharedIniFileCredentials { declare private profile: string; @@ -60,21 +49,29 @@ export class PatchedSharedIniFileCredentials extends AWS.SharedIniFileCredential var sourceProfile = roleProfile.source_profile; var credentialSource = roleProfile.credential_source; - const credentialError = (AWS as any).util.error( - new Error(`When using 'role_arn' in profile ('${this.profile}'), you must also configure exactly one of 'source_profile' or 'credential_source'`), - { code: 'SharedIniFileCredentialsProviderFailure' }, - ); - - if (sourceProfile && credentialSource) { - throw credentialError; - } - - if (!sourceProfile && !credentialSource) { - throw credentialError; + if (!!sourceProfile === !!credentialSource) { + throw (AWS as any).util.error( + new Error(`When using 'role_arn' in profile ('${this.profile}'), you must also configure exactly one of 'source_profile' or 'credential_source'`), + { code: 'SharedIniFileCredentialsProviderFailure' }, + ); } - const profiles = loadProfilesProper(this.filename); - const region = profiles[this.profile]?.region ?? profiles.default?.region ?? 'us-east-1'; + // Confirmed this against AWS CLI behavior -- the region must be in the assumED profile, + // otherwise `us-east-1`. From the upstream comment in `aws-sdk-js`: + // -------- comment from aws-sdk-js ------------------- + // Experimentation shows that the AWS CLI (tested at version 1.18.136) + // ignores the following potential sources of a region for the purposes of + // this AssumeRole call: + // + // - The [default] profile + // - The AWS_REGION environment variable + // + // Ignoring the [default] profile for the purposes of AssumeRole is arguably + // a bug in the CLI since it does use the [default] region for service + // calls... but right now we're matching behavior of the other tool. + // ------------------------------------------------- + + const region = roleProfile?.region ?? 'us-east-1'; const stsCreds = sourceProfile ? this.sourceProfileCredentials(sourceProfile, creds) : this.credentialSourceCredentials(credentialSource); @@ -121,7 +118,6 @@ export class PatchedSharedIniFileCredentials extends AWS.SharedIniFileCredential } private sourceProfileCredentials(sourceProfile: string, profiles: Record>) { - var sourceProfileExistanceTest = profiles[sourceProfile]; if (typeof sourceProfileExistanceTest !== 'object') { @@ -132,11 +128,23 @@ export class PatchedSharedIniFileCredentials extends AWS.SharedIniFileCredential ); } - if (sourceProfileExistanceTest.sso_start_url) { + // We need to do a manual check here if the source profile (providing the + // credentials for the AssumeRole) is an SSO profile. That's because + // `SharedIniFileCredentials` itself doesn't support providing credentials from + // arbitrary profiles, only for StaticCredentials and AssumeRole type + // profiles; if it's an SSO profile you need to instantiate a special + // Credential Provider for that. + // + // --- + // + // An SSO profile can be configured in 2 ways (put all the info in the profile + // section, or put half of it in an `[sso-session]` block), but in both cases + // the primary profile block must have the `sso_account_id` key + if (sourceProfileExistanceTest.sso_account_id) { return new AWS.SsoCredentials({ profile: sourceProfile }); } - return new AWS.SharedIniFileCredentials( + return new PatchedSharedIniFileCredentials( (AWS as any).util.merge(this.options || {}, { profile: sourceProfile, preferStaticCredentials: true, @@ -148,7 +156,6 @@ export class PatchedSharedIniFileCredentials extends AWS.SharedIniFileCredential // the aws-sdk for js does not support 'credential_source' (https://github.com/aws/aws-sdk-js/issues/1916) // so unfortunately we need to implement this ourselves. private credentialSourceCredentials(sourceCredential: string) { - // see https://docs.aws.amazon.com/credref/latest/refdocs/setting-global-credential_source.html switch (sourceCredential) { case 'Environment': { @@ -166,36 +173,4 @@ export class PatchedSharedIniFileCredentials extends AWS.SharedIniFileCredential } } -} - -/** - * A function to load profiles from disk that MERGES credentials and config instead of overwriting - * - * @see https://github.com/aws/aws-sdk-js/blob/5ae5a7d7d24d1000dbc089cc15f8ed2c7b06c542/lib/util.js#L956 - */ -function loadProfilesProper(filename: string) { - const util = (AWS as any).util; // Does exists even though there aren't any typings for it - const iniLoader = util.iniLoader; - const profiles: Record> = {}; - let profilesFromConfig: Record> = {}; - if (process.env[util.configOptInEnv]) { - profilesFromConfig = iniLoader.loadFrom({ - isConfig: true, - filename: process.env[util.sharedConfigFileEnv], - }); - } - var profilesFromCreds: Record> = iniLoader.loadFrom({ - filename: filename || - (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]), - }); - for (const [name, profile] of Object.entries(profilesFromConfig)) { - profiles[name] = profile; - } - for (const [name, profile] of Object.entries(profilesFromCreds)) { - profiles[name] = { - ...profiles[name], - ...profile, - }; - } - return profiles; -} +} \ No newline at end of file diff --git a/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml b/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml index 5cdefe4324fd6..807a58bd0e563 100644 --- a/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml +++ b/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml @@ -587,7 +587,7 @@ Resources: Type: String Name: Fn::Sub: '/cdk-bootstrap/${Qualifier}/version' - Value: '14' + Value: '15' Outputs: BucketName: Description: The name of the S3 bucket owned by the CDK toolkit stack diff --git a/packages/aws-cdk/lib/api/cxapp/cloud-executable.ts b/packages/aws-cdk/lib/api/cxapp/cloud-executable.ts index 31ceac08d298b..9d8a84494bda6 100644 --- a/packages/aws-cdk/lib/api/cxapp/cloud-executable.ts +++ b/packages/aws-cdk/lib/api/cxapp/cloud-executable.ts @@ -11,7 +11,7 @@ import { CloudAssembly } from './cloud-assembly'; /** * @returns output directory */ -type Synthesizer = (aws: SdkProvider, config: Configuration) => Promise; +export type Synthesizer = (aws: SdkProvider, config: Configuration) => Promise; /** * The Cloud Assembly schema version where the framework started to generate analytics itself diff --git a/packages/aws-cdk/lib/api/cxapp/exec.ts b/packages/aws-cdk/lib/api/cxapp/exec.ts index d4bb217135d59..b01b42cef30e3 100644 --- a/packages/aws-cdk/lib/api/cxapp/exec.ts +++ b/packages/aws-cdk/lib/api/cxapp/exec.ts @@ -11,43 +11,17 @@ import { loadTree, some } from '../../tree'; import { splitBySize } from '../../util/objects'; import { versionNumber } from '../../version'; import { SdkProvider } from '../aws-auth'; +import { RWLock, ILock } from '../util/rwlock'; -/** Invokes the cloud executable and returns JSON output */ -export async function execProgram(aws: SdkProvider, config: Configuration): Promise { - const env: { [key: string]: string } = { }; - - const context = config.context.all; - await populateDefaultEnvironmentIfNeeded(aws, env); - - const debugMode: boolean = config.settings.get(['debug']) ?? true; - if (debugMode) { - env.CDK_DEBUG = 'true'; - } - - const pathMetadata: boolean = config.settings.get(['pathMetadata']) ?? true; - if (pathMetadata) { - context[cxapi.PATH_METADATA_ENABLE_CONTEXT] = true; - } - - const assetMetadata: boolean = config.settings.get(['assetMetadata']) ?? true; - if (assetMetadata) { - context[cxapi.ASSET_RESOURCE_METADATA_ENABLED_CONTEXT] = true; - } - - const versionReporting: boolean = config.settings.get(['versionReporting']) ?? true; - if (versionReporting) { context[cxapi.ANALYTICS_REPORTING_ENABLED_CONTEXT] = true; } - // We need to keep on doing this for framework version from before this flag was deprecated. - if (!versionReporting) { context['aws:cdk:disable-version-reporting'] = true; } - - const stagingEnabled = config.settings.get(['staging']) ?? true; - if (!stagingEnabled) { - context[cxapi.DISABLE_ASSET_STAGING_CONTEXT] = true; - } - - const bundlingStacks = config.settings.get(['bundlingStacks']) ?? ['**']; - context[cxapi.BUNDLING_STACKS] = bundlingStacks; +export interface ExecProgramResult { + readonly assembly: cxapi.CloudAssembly; + readonly lock: ILock; +} - debug('context:', context); +/** Invokes the cloud executable and returns JSON output */ +export async function execProgram(aws: SdkProvider, config: Configuration): Promise { + const env = await prepareDefaultEnvironment(aws); + const context = await prepareContext(config, env); const build = config.settings.get(['build']); if (build) { @@ -62,7 +36,11 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom // bypass "synth" if app points to a cloud assembly if (await fs.pathExists(app) && (await fs.stat(app)).isDirectory()) { debug('--app points to a cloud assembly, so we bypass synth'); - return createAssembly(app); + + // Acquire a read lock on this directory + const lock = await new RWLock(app).acquireRead(); + + return { assembly: createAssembly(app), lock }; } const commandLine = await guessExecutable(appToArray(app)); @@ -80,6 +58,9 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom debug('outdir:', outdir); env[cxapi.OUTDIR_ENV] = outdir; + // Acquire a read lock on the output directory + const writerLock = await new RWLock(outdir).acquireWrite(); + // Send version information env[cxapi.CLI_ASM_VERSION_ENV] = cxschema.Manifest.version(); env[cxapi.CLI_VERSION_ENV] = versionNumber(); @@ -107,20 +88,7 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom contextOverflowCleanup(contextOverflowLocation, assembly); - return assembly; - - function createAssembly(appDir: string) { - try { - return new cxapi.CloudAssembly(appDir); - } catch (error) { - if (error.message.includes(cxschema.VERSION_MISMATCH)) { - // this means the CLI version is too old. - // we instruct the user to upgrade. - throw new Error(`This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version.\n(${error.message})`); - } - throw error; - } - } + return { assembly, lock: await writerLock.convertToReaderLock() }; async function exec(commandAndArgs: string) { return new Promise((ok, fail) => { @@ -157,6 +125,22 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom } } +/** + * Creates an assembly with error handling + */ +export function createAssembly(appDir: string) { + try { + return new cxapi.CloudAssembly(appDir); + } catch (error) { + if (error.message.includes(cxschema.VERSION_MISMATCH)) { + // this means the CLI version is too old. + // we instruct the user to upgrade. + throw new Error(`This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version.\n(${error.message})`); + } + throw error; + } +} + /** * If we don't have region/account defined in context, we fall back to the default SDK behavior * where region is retrieved from ~/.aws/config and account is based on default credentials provider @@ -169,7 +153,9 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom * * @param context The context key/value bash. */ -async function populateDefaultEnvironmentIfNeeded(aws: SdkProvider, env: { [key: string]: string | undefined}) { +export async function prepareDefaultEnvironment(aws: SdkProvider): Promise<{ [key: string]: string }> { + const env: { [key: string]: string } = { }; + env[cxapi.DEFAULT_REGION_ENV] = aws.defaultRegion; debug(`Setting "${cxapi.DEFAULT_REGION_ENV}" environment variable to`, env[cxapi.DEFAULT_REGION_ENV]); @@ -178,6 +164,49 @@ async function populateDefaultEnvironmentIfNeeded(aws: SdkProvider, env: { [key: env[cxapi.DEFAULT_ACCOUNT_ENV] = accountId; debug(`Setting "${cxapi.DEFAULT_ACCOUNT_ENV}" environment variable to`, env[cxapi.DEFAULT_ACCOUNT_ENV]); } + + return env; +} + +/** + * Settings related to synthesis are read from context. + * The merging of various configuration sources like cli args or cdk.json has already happened. + * We now need to set the final values to the context. + */ +export async function prepareContext(config: Configuration, env: { [key: string]: string | undefined}) { + const context = config.context.all; + + const debugMode: boolean = config.settings.get(['debug']) ?? true; + if (debugMode) { + env.CDK_DEBUG = 'true'; + } + + const pathMetadata: boolean = config.settings.get(['pathMetadata']) ?? true; + if (pathMetadata) { + context[cxapi.PATH_METADATA_ENABLE_CONTEXT] = true; + } + + const assetMetadata: boolean = config.settings.get(['assetMetadata']) ?? true; + if (assetMetadata) { + context[cxapi.ASSET_RESOURCE_METADATA_ENABLED_CONTEXT] = true; + } + + const versionReporting: boolean = config.settings.get(['versionReporting']) ?? true; + if (versionReporting) { context[cxapi.ANALYTICS_REPORTING_ENABLED_CONTEXT] = true; } + // We need to keep on doing this for framework version from before this flag was deprecated. + if (!versionReporting) { context['aws:cdk:disable-version-reporting'] = true; } + + const stagingEnabled = config.settings.get(['staging']) ?? true; + if (!stagingEnabled) { + context[cxapi.DISABLE_ASSET_STAGING_CONTEXT] = true; + } + + const bundlingStacks = config.settings.get(['bundlingStacks']) ?? ['**']; + context[cxapi.BUNDLING_STACKS] = bundlingStacks; + + debug('context:', context); + + return context; } /** diff --git a/packages/aws-cdk/lib/api/index.ts b/packages/aws-cdk/lib/api/index.ts index 5747b4c8d570f..5671f05837205 100644 --- a/packages/aws-cdk/lib/api/index.ts +++ b/packages/aws-cdk/lib/api/index.ts @@ -1,5 +1,3 @@ -import 'source-map-support/register'; - export * from './aws-auth/credentials'; export * from './bootstrap'; export * from './deploy-stack'; diff --git a/packages/aws-cdk/lib/api/util/rwlock.ts b/packages/aws-cdk/lib/api/util/rwlock.ts new file mode 100644 index 0000000000000..6667bd17afe06 --- /dev/null +++ b/packages/aws-cdk/lib/api/util/rwlock.ts @@ -0,0 +1,184 @@ +import { promises as fs } from 'fs'; +import * as path from 'path'; + +/** + * A single-writer/multi-reader lock on a directory + * + * It uses marker files with PIDs in them as a locking marker; the PIDs will be + * checked for liveness, so that if the process exits without cleaning up the + * files the lock is implicitly released. + * + * This class is not 100% race safe, but in practice it should be a lot + * better than the 0 protection we have today. + */ +export class RWLock { + private readonly pidString: string; + private readonly writerFile: string; + private readonly readerFile: string; + + constructor(public readonly directory: string) { + this.pidString = `${process.pid}`; + + this.writerFile = path.join(this.directory, 'synth.lock'); + this.readerFile = path.join(this.directory, `read.${this.pidString}.lock`); + } + + /** + * Acquire a writer lock. + * + * No other readers or writers must exist for the given directory. + */ + public async acquireWrite(): Promise { + await this.assertNoOtherWriters(); + + const readers = await this.currentReaders(); + if (readers.length > 0) { + throw new Error(`Other CLIs (PID=${readers}) are currently reading from ${this.directory}. Invoke the CLI in sequence, or use '--output' to synth into different directories.`); + } + + await writeFileAtomic(this.writerFile, this.pidString); + + return { + release: async () => { + await deleteFile(this.writerFile); + }, + convertToReaderLock: async () => { + // Acquire the read lock before releasing the write lock. Slightly less + // chance of racing! + const ret = await this.doAcquireRead(); + await deleteFile(this.writerFile); + return ret; + }, + }; + } + + /** + * Acquire a read lock + * + * Will fail if there are any writers. + */ + public async acquireRead(): Promise { + await this.assertNoOtherWriters(); + return this.doAcquireRead(); + } + + /** + * Do the actual acquiring of a read lock. + */ + private async doAcquireRead(): Promise { + await writeFileAtomic(this.readerFile, this.pidString); + return { + release: async () => { + await deleteFile(this.readerFile); + }, + }; + } + + private async assertNoOtherWriters() { + const writer = await this.currentWriter(); + if (writer) { + throw new Error(`Another CLI (PID=${writer}) is currently synthing to ${this.directory}. Invoke the CLI in sequence, or use '--output' to synth into different directories.`); + } + } + + /** + * Check the current writer (if any) + */ + private async currentWriter(): Promise { + const contents = await readFileIfExists(this.writerFile); + if (!contents) { return undefined; } + + const pid = parseInt(contents, 10); + if (!processExists(pid)) { + // Do cleanup of a stray file now + await deleteFile(this.writerFile); + return undefined; + } + + return pid; + } + + /** + * Check the current readers (if any) + */ + private async currentReaders(): Promise { + const re = /^read\.([^.]+)\.lock$/; + const ret = new Array(); + + let children; + try { + children = await fs.readdir(this.directory, { encoding: 'utf-8' }); + } catch (e) { + // Can't be locked if the directory doesn't exist + if (e.code === 'ENOENT') { return []; } + throw e; + } + + for (const fname of children) { + const m = fname.match(re); + if (m) { + const pid = parseInt(m[1], 10); + if (processExists(pid)) { + ret.push(pid); + } else { + // Do cleanup of a stray file now + await deleteFile(path.join(this.directory, fname)); + } + } + } + return ret; + } +} + +/** + * An acquired lock + */ +export interface ILock { + release(): Promise; +} + +/** + * An acquired writer lock + */ +export interface IWriterLock extends ILock { + /** + * Convert the writer lock to a reader lock + */ + convertToReaderLock(): Promise; +} + +async function readFileIfExists(filename: string): Promise { + try { + return await fs.readFile(filename, { encoding: 'utf-8' }); + } catch (e) { + if (e.code === 'ENOENT') { return undefined; } + throw e; + } +} + +async function writeFileAtomic(filename: string, contents: string): Promise { + await fs.mkdir(path.dirname(filename), { recursive: true }); + const tmpFile = `${filename}.${process.pid}`; + await fs.writeFile(tmpFile, contents, { encoding: 'utf-8' }); + await fs.rename(tmpFile, filename); +} + +async function deleteFile(filename: string) { + try { + await fs.unlink(filename); + } catch (e) { + if (e.code === 'ENOENT') { + return; + } + throw e; + } +} + +function processExists(pid: number) { + try { + process.kill(pid, 0); + return true; + } catch (e) { + return false; + } +} \ No newline at end of file diff --git a/packages/aws-cdk/lib/cli.ts b/packages/aws-cdk/lib/cli.ts index 32dfb3e0dc32f..a7a89913e70aa 100644 --- a/packages/aws-cdk/lib/cli.ts +++ b/packages/aws-cdk/lib/cli.ts @@ -1,14 +1,14 @@ -import 'source-map-support/register'; import * as cxapi from '@aws-cdk/cx-api'; import '@jsii/check-node/run'; import * as chalk from 'chalk'; +import { install as enableSourceMapSupport } from 'source-map-support'; import type { Argv } from 'yargs'; import { SdkProvider } from '../lib/api/aws-auth'; import { BootstrapSource, Bootstrapper } from '../lib/api/bootstrap'; import { CloudFormationDeployments } from '../lib/api/cloudformation-deployments'; import { StackSelector } from '../lib/api/cxapp/cloud-assembly'; -import { CloudExecutable } from '../lib/api/cxapp/cloud-executable'; +import { CloudExecutable, Synthesizer } from '../lib/api/cxapp/cloud-executable'; import { execProgram } from '../lib/api/cxapp/exec'; import { PluginHost } from '../lib/api/plugin'; import { ToolkitInfo } from '../lib/api/toolkit-info'; @@ -24,8 +24,9 @@ import { displayNotices, refreshNotices } from '../lib/notices'; import { Command, Configuration, Settings } from '../lib/settings'; import * as version from '../lib/version'; import { DeploymentMethod } from './api'; -import { enableTracing } from './util/tracing'; +import { ILock } from './api/util/rwlock'; import { checkForPlatformWarnings } from './platform-warnings'; +import { enableTracing } from './util/tracing'; // https://github.com/yargs/yargs/issues/1929 // https://github.com/evanw/esbuild/issues/1492 @@ -35,7 +36,7 @@ const yargs = require('yargs'); /* eslint-disable max-len */ /* eslint-disable @typescript-eslint/no-shadow */ // yargs -async function parseCommandLineArguments() { +async function parseCommandLineArguments(args: string[]) { // Use the following configuration for array arguments: // // { type: 'array', default: [], nargs: 1, requiresArg: true } @@ -78,7 +79,7 @@ async function parseCommandLineArguments() { .option('path-metadata', { type: 'boolean', desc: 'Include "aws:cdk:path" CloudFormation metadata for each resource (enabled by default)', default: true }) .option('asset-metadata', { type: 'boolean', desc: 'Include "aws:asset:*" CloudFormation metadata for resources that uses assets (enabled by default)', default: true }) .option('role-arn', { type: 'string', alias: 'r', desc: 'ARN of Role to use when invoking CloudFormation', default: undefined, requiresArg: true }) - .option('staging', { type: 'boolean', desc: 'Copy assets to the output directory (use --no-staging to disable, needed for local debugging the source files with SAM CLI)', default: true }) + .option('staging', { type: 'boolean', desc: 'Copy assets to the output directory (use --no-staging to disable the copy of assets which allows local debugging via the SAM CLI to reference the original source files)', default: true }) .option('output', { type: 'string', alias: 'o', desc: 'Emits the synthesized cloud assembly into a directory (default: cdk.out)', requiresArg: true }) .option('notices', { type: 'boolean', desc: 'Show relevant notices' }) .option('no-color', { type: 'boolean', desc: 'Removes colors and other style from console output', default: false }) @@ -274,7 +275,7 @@ async function parseCommandLineArguments() { 'If your app has a single stack, there is no need to specify the stack name', 'If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.', ].join('\n\n')) - .argv; + .parse(args); } if (!process.stdout.isTTY) { @@ -282,8 +283,13 @@ if (!process.stdout.isTTY) { process.env.FORCE_COLOR = '0'; } -async function initCommandLine() { - const argv = await parseCommandLineArguments(); +export async function exec(args: string[], synthesizer?: Synthesizer): Promise { + const argv = await parseCommandLineArguments(args); + + if (argv.debug) { + enableSourceMapSupport(); + } + if (argv.verbose) { setLogLevel(argv.verbose); @@ -329,10 +335,19 @@ async function initCommandLine() { const cloudFormation = new CloudFormationDeployments({ sdkProvider }); + let outDirLock: ILock | undefined; const cloudExecutable = new CloudExecutable({ configuration, sdkProvider, - synthesizer: execProgram, + synthesizer: synthesizer ?? (async (aws, config) => { + // Invoke 'execProgram', and copy the lock for the directory in the global + // variable here. It will be released when the CLI exits. Locks are not re-entrant + // so release it if we have to synthesize more than once (because of context lookups). + await outDirLock?.release(); + const { assembly, lock } = await execProgram(aws, config); + outDirLock = lock; + return assembly; + }), }); /** Function to load plug-ins, using configurations additively. */ @@ -373,6 +388,10 @@ async function initCommandLine() { try { return await main(cmd, argv); } finally { + // If we locked the 'cdk.out' directory, release it here. + await outDirLock?.release(); + + // Do PSAs here await version.displayVersionMessage(); if (shouldDisplayNotices()) { @@ -686,8 +705,8 @@ function yargsNegativeAlias { if (typeof value === 'number') { process.exitCode = value; diff --git a/packages/aws-cdk/lib/index.ts b/packages/aws-cdk/lib/index.ts index 57502a1035caf..a76f253b80ca6 100644 --- a/packages/aws-cdk/lib/index.ts +++ b/packages/aws-cdk/lib/index.ts @@ -1,2 +1,2 @@ export * from './api'; -export { cli } from './cli'; +export { cli, exec } from './cli'; diff --git a/packages/aws-cdk/lib/init.ts b/packages/aws-cdk/lib/init.ts index 822178308437f..548a6f3d2604c 100644 --- a/packages/aws-cdk/lib/init.ts +++ b/packages/aws-cdk/lib/init.ts @@ -197,13 +197,17 @@ interface ProjectInfo { export async function availableInitTemplates(): Promise { return new Promise(async resolve => { - const templatesDir = path.join(rootDir(), 'lib', 'init-templates'); - const templateNames = await listDirectory(templatesDir); - const templates = new Array(); - for (const templateName of templateNames) { - templates.push(await InitTemplate.fromName(templatesDir, templateName)); + try { + const templatesDir = path.join(rootDir(), 'lib', 'init-templates'); + const templateNames = await listDirectory(templatesDir); + const templates = new Array(); + for (const templateName of templateNames) { + templates.push(await InitTemplate.fromName(templatesDir, templateName)); + } + resolve(templates); + } catch { + resolve([]); } - resolve(templates); }); } export async function availableInitLanguages(): Promise { diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 50ddf96ceff00..2ffe78205e747 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -49,7 +49,9 @@ "test": "bin/cdk --version", "entryPoints": [ "lib/index.js" - ] + ], + "sourcemap": "linked", + "minifyWhitespace": true } }, "author": { @@ -71,6 +73,7 @@ "@types/promptly": "^3.0.2", "@types/semver": "^7.3.13", "@types/sinon": "^9.0.11", + "@types/source-map-support": "^0.5.6", "@types/table": "^6.0.0", "@types/uuid": "^8.3.4", "@types/wrap-ansi": "^3.0.0", @@ -82,7 +85,7 @@ "constructs": "^10.0.0", "make-runnable": "^1.4.1", "mockery": "^2.1.0", - "nock": "^13.2.9", + "nock": "^13.3.0", "@aws-cdk/pkglint": "0.0.0", "sinon": "^9.2.4", "ts-jest": "^27.1.5", @@ -96,7 +99,7 @@ "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "@jsii/check-node": "1.72.0", + "@jsii/check-node": "1.73.0", "archiver": "^5.3.1", "aws-sdk": "^2.1211.0", "camelcase": "^6.3.0", diff --git a/packages/aws-cdk/test/api/exec.test.ts b/packages/aws-cdk/test/api/exec.test.ts index b9c5637acce1a..e52b4485da2cd 100644 --- a/packages/aws-cdk/test/api/exec.test.ts +++ b/packages/aws-cdk/test/api/exec.test.ts @@ -90,7 +90,8 @@ test('cli does not throw when manifest version = schema version', async () => { config.settings.set(['app'], 'cdk.out'); - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }, TEN_SECOND_TIMEOUT); @@ -107,7 +108,8 @@ test('cli does not throw when manifest version < schema version', async () => { // greater that the version created in the manifest, which is what we are testing for. const mockVersionNumber = ImportMock.mockFunction(cxschema.Manifest, 'version', semver.inc(currentSchemaVersion, 'major')); try { - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); } finally { mockVersionNumber.restore(); } @@ -128,9 +130,11 @@ test('bypasses synth when app points to a cloud assembly', async () => { writeOutputAssembly(); // WHEN - const cloudAssembly = await execProgram(sdkProvider, config); + const { assembly: cloudAssembly, lock } = await execProgram(sdkProvider, config); expect(cloudAssembly.artifacts).toEqual([]); expect(cloudAssembly.directory).toEqual('cdk.out'); + + await lock.release(); }); test('the application set in --app is executed', async () => { @@ -142,7 +146,8 @@ test('the application set in --app is executed', async () => { }); // WHEN - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }); test('the application set in --app is executed as-is if it contains a filename that does not exist', async () => { @@ -154,7 +159,8 @@ test('the application set in --app is executed as-is if it contains a filename t }); // WHEN - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }); test('the application set in --app is executed with arguments', async () => { @@ -166,7 +172,8 @@ test('the application set in --app is executed with arguments', async () => { }); // WHEN - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }); test('application set in --app as `*.js` always uses handler on windows', async () => { @@ -179,7 +186,8 @@ test('application set in --app as `*.js` always uses handler on windows', async }); // WHEN - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }); test('application set in --app is `*.js` and executable', async () => { @@ -191,7 +199,8 @@ test('application set in --app is `*.js` and executable', async () => { }); // WHEN - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }); test('cli throws when the `build` script fails', async () => { @@ -220,7 +229,8 @@ test('cli does not throw when the `build` script succeeds', async () => { }); // WHEN - await execProgram(sdkProvider, config); + const { lock } = await execProgram(sdkProvider, config); + await lock.release(); }, TEN_SECOND_TIMEOUT); diff --git a/packages/aws-cdk/test/api/logs/logs-monitor.test.ts b/packages/aws-cdk/test/api/logs/logs-monitor.test.ts index eed3cf2683540..7f5e54a89b300 100644 --- a/packages/aws-cdk/test/api/logs/logs-monitor.test.ts +++ b/packages/aws-cdk/test/api/logs/logs-monitor.test.ts @@ -1,6 +1,6 @@ import { blue, yellow } from 'chalk'; import { CloudWatchLogEventMonitor } from '../../../lib/api/logs/logs-monitor'; -import { sleep } from '../../integ/helpers/aws'; +import { sleep } from '../../util'; import { MockSdk } from '../../util/mock-sdk'; let sdk: MockSdk; diff --git a/packages/aws-cdk/test/integ/cli-regression-patches/README.md b/packages/aws-cdk/test/integ/cli-regression-patches/README.md deleted file mode 100644 index c930255e85809..0000000000000 --- a/packages/aws-cdk/test/integ/cli-regression-patches/README.md +++ /dev/null @@ -1,54 +0,0 @@ -Regression Test Patches -======================== - -The regression test suite will use the test suite of an OLD version -of the CLI when testing a NEW version of the CLI, to make sure the -old tests still pass. - -Sometimes though, the old tests won't pass. This can happen when we -introduce breaking changes to the framework or CLI (for something serious, -such as security reasons), or maybe because we had a bug in an old -version that happened to pass, but now the test needs to be updated -in order to pass a bugfix. - -## Mechanism - -The files in this directory will be copied over the test directory -so that you can exclude tests from running, or patch up test running -scripts. - -Files will be copied like so: - -``` -aws-cdk/test/integ/cli-regression-patches/vX.Y.Z/* - -# will be copied into - -aws-cdk/test/integ/cli -``` - -For example, to skip a certain integration test during regression -testing, create the following file: - -``` -cli-regression-patches/vX.Y.Z/skip-tests.txt -``` - -If you need to replace source files, it's probably best to stick -compiled `.js` files in here. `.ts` source files wouldn't compile -because they'd be missing `imports`. - -## Versioning - -The patch sets are versioned, so that they will only be applied for -a certain version of the tests and will automatically age out when -we proceed past that release. - -The version in the directory name needs to be named after the -version that contains the *tests* we're running, that need to be -patched. - -So for example, if we are running regression tests for release -candidate `1.45.0`, we would use the tests from released version -`1.44.0`, and so you would call the patch directory `v1.44.0`. - diff --git a/packages/aws-cdk/test/integ/cli/jest.config.js b/packages/aws-cdk/test/integ/cli/jest.config.js deleted file mode 100644 index 1e3fe3d13f96b..0000000000000 --- a/packages/aws-cdk/test/integ/cli/jest.config.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - moduleFileExtensions: [ - "js", - ], - testMatch: [ - "**/*.integtest.js", - ], - testEnvironment: "node", - bail: 1, - verbose: true, - reporters: [ - "default", - [ "jest-junit", { suiteName: "jest tests", outputDirectory: "coverage" } ] - ] -}; diff --git a/packages/aws-cdk/test/integ/cli/test.sh b/packages/aws-cdk/test/integ/cli/test.sh index bf0ec0a7c5c68..1d33ee1502bbd 100755 --- a/packages/aws-cdk/test/integ/cli/test.sh +++ b/packages/aws-cdk/test/integ/cli/test.sh @@ -1,12 +1,6 @@ #!/bin/bash -set -euo pipefail -scriptdir=$(cd $(dirname $0) && pwd) +set -eu +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' -echo 'CLI Integration Tests' -echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' - -cd $scriptdir - -source ../common/jest-test.bash -invokeJest "$@" +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION cli-integ-tests diff --git a/packages/aws-cdk/test/integ/common/jest-test.bash b/packages/aws-cdk/test/integ/common/jest-test.bash deleted file mode 100755 index 7a96a9f845155..0000000000000 --- a/packages/aws-cdk/test/integ/common/jest-test.bash +++ /dev/null @@ -1,18 +0,0 @@ -function invokeJest() { - # Install these dependencies that the tests (written in Jest) need. - # Only if we're not running from the repo, because if we are the - # dependencies have already been installed by the containing 'aws-cdk' package's - # package.json. - if ! npx --no-install jest --version; then - echo 'Looks like we need to install jest first. Hold on.' >& 2 - npm install --prefix .. jest@^27 jest-junit@^14 aws-sdk@^2 axios@^0.27.2 - fi - - # This must --runInBand because parallelism is arranged for inside the tests - # themselves and they must run in the same process in order to coordinate to - # make sure no 2 tests use the same region at the same time. - # - # Jest is run in a weird way because npx started (NPM 8?) to change directory - # into 'package.json' root, which we don't want here. - $(npx which jest) --runInBand --verbose "$@" -} diff --git a/packages/aws-cdk/test/integ/github-helpers.ts b/packages/aws-cdk/test/integ/github-helpers.ts deleted file mode 100644 index d5a9b6cb41df7..0000000000000 --- a/packages/aws-cdk/test/integ/github-helpers.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Octokit } from '@octokit/rest'; -import * as semver from 'semver'; - -module.exports.fetchPreviousVersion = async function(base: string) { - const token = process.env.GITHUB_TOKEN; - if (!token) { - throw new Error('GITHUB_TOKEN must be set'); - } - - const github = new Octokit({ auth: token }); - const releases = await github.repos.listReleases({ - owner: 'aws', - repo: 'aws-cdk', - }); - - // this returns a list in descending order, newest releases first - // opts for same major version where possible, falling back otherwise - // to previous major versions. - let previousMVRelease = undefined; - for (const release of releases.data) { - const version = release.name?.replace('v', ''); - if (version && semver.lt(version, base)) { - if (semver.major(version) === semver.major(base)) { - return version; - } else if (!previousMVRelease) { - previousMVRelease = version; - } - } - } - if (previousMVRelease) { return previousMVRelease; } - - throw new Error(`Unable to find previous version of ${base}`); -}; - -// eslint-disable-next-line @typescript-eslint/no-require-imports -require('make-runnable/custom')({ - printOutputFrame: false, -}); diff --git a/packages/aws-cdk/test/integ/helpers/resource-pool.test.ts b/packages/aws-cdk/test/integ/helpers/resource-pool.test.ts deleted file mode 100644 index edae1a1ed170a..0000000000000 --- a/packages/aws-cdk/test/integ/helpers/resource-pool.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { ResourcePool } from './resource-pool'; - -test('take and dispose', async () => { - const pool = new ResourcePool(['a']); - - const take1 = pool.take(); - const take2 = pool.take(); - - let released = false; - - const lease1 = await take1; - // awaiting 'take2' would now block but we add an async - // handler to it to flip a boolean to see when it gets activated. - void(take2.then(() => released = true)); - - expect(lease1.value).toEqual('a'); - await waitTick(); - expect(released).toEqual(false); - - lease1.dispose(); - await waitTick(); // This works because setImmediate is scheduled in LIFO order - expect(released).toEqual(true); -}); - -test('double dispose throws', async () => { - const pool = new ResourcePool(['a']); - const lease = await pool.take(); - - lease.dispose(); - expect(() => lease.dispose()).toThrow(); -}); - -test('more consumers than values', async () => { - const pool = new ResourcePool(['a', 'b']); - - const values = await Promise.all([ - pool.using(x => x), - pool.using(x => x), - pool.using(x => x), - ]); - - expect(values).toEqual(['a', 'b', 'a']); -}); - -function waitTick() { - return new Promise(setImmediate); -} \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/helpers/resource-pool.ts b/packages/aws-cdk/test/integ/helpers/resource-pool.ts deleted file mode 100644 index 444a0bc193edd..0000000000000 --- a/packages/aws-cdk/test/integ/helpers/resource-pool.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * A class that holds a pool of resources and gives them out and returns them on-demand - * - * The resources will be given out front to back, when they are returned - * the most recently returned version will be given out again (for best - * cache coherency). - * - * If there are multiple consumers waiting for a resource, consumers are serviced - * in FIFO order for most fairness. - */ -export class ResourcePool { - private readonly resources: A[]; - private readonly waiters: Array<(x: A) => void> = []; - - constructor(resources: A[]) { - if (resources.length === 0) { - throw new Error('Must have at least one resource in the pool'); - } - this.resources = [...resources]; - } - - /** - * Take one value from the resource pool - * - * If no such value is currently available, wait until it is. - */ - public take(): Promise> { - const next = this.resources.shift(); - if (next !== undefined) { - return Promise.resolve(this.makeLease(next)); - } else { - return new Promise(ok => { - this.waiters.push((resource) => ok(this.makeLease(resource))); - }); - } - } - - /** - * Execute a block using a single resource from the pool - */ - public async using(block: (x: A) => B | Promise): Promise { - const lease = await this.take(); - try { - return await block(lease.value); - } finally { - lease.dispose(); - } - } - - private makeLease(value: A): ILease { - let disposed = false; - return { - value, - dispose: () => { - if (disposed) { - throw new Error('Calling dispose() on an already-disposed lease.'); - } - disposed = true; - this.returnValue(value); - }, - }; - } - - /** - * When a value is returned: - * - * - If someone's waiting for it, give it to them - * - Otherwise put it back into the pool - */ - private returnValue(value: A) { - const nextWaiter = this.waiters.shift(); - if (nextWaiter !== undefined) { - // Execute in the next tick, otherwise the call stack is going to get very - // confusing. - setImmediate(() => nextWaiter(value)); - } else { - this.resources.unshift(value); - } - } -} - -/** - * A single value taken from the pool - */ -export interface ILease { - /** - * The value obtained by the lease - */ - readonly value: A; - - /** - * Return the leased value to the pool - */ - dispose(): void; -} \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/init/common.bash b/packages/aws-cdk/test/integ/init/common.bash deleted file mode 100644 index f41f02b5215e8..0000000000000 --- a/packages/aws-cdk/test/integ/init/common.bash +++ /dev/null @@ -1,25 +0,0 @@ -set -eu -init_test_dir="${init_test_dir:=/tmp/cdk-init-test}" - -function setup() { - rm -rf $init_test_dir - mkdir -p $init_test_dir - cd $init_test_dir -} - -function log() { - echo >&2 "| $@" -} - -function header() { - log - log "============================================================================================" - log $@ - log "============================================================================================" -} - -function assert_no_hook_files() { - compgen "\*.hook.\*" || return 0 - echo "'cdk init' left hook files in the template directory!" >&2 - exit 1 -} diff --git a/packages/aws-cdk/test/integ/init/test-all.sh b/packages/aws-cdk/test/integ/init/test-all.sh deleted file mode 100755 index f191d37bf4296..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-all.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eu -scriptdir=$(cd $(dirname $0) && pwd) -$scriptdir/test-csharp.sh -$scriptdir/test-fsharp.sh -$scriptdir/test-java.sh -$scriptdir/test-javascript.sh -$scriptdir/test-python.sh -$scriptdir/test-typescript.sh -$scriptdir/test-go.sh - -echo "SUCCESS" diff --git a/packages/aws-cdk/test/integ/init/test-csharp-app.sh b/packages/aws-cdk/test/integ/init/test-csharp-app.sh index 19bd5c91e4ef9..c32d86b7ffbd8 100755 --- a/packages/aws-cdk/test/integ/init/test-csharp-app.sh +++ b/packages/aws-cdk/test/integ/init/test-csharp-app.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Naming shim for backwards compatibility with legacy -# tests and canaries. set -eu -scriptdir=$(cd $(dirname $0) && pwd) -exec $scriptdir/test-csharp.sh +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. + +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-csharp diff --git a/packages/aws-cdk/test/integ/init/test-csharp.sh b/packages/aws-cdk/test/integ/init/test-csharp.sh deleted file mode 100755 index ea82e3b63f38c..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-csharp.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -e -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash - -header C# - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying C# template $template" - - setup - - cdk init -l csharp $template - cdk synth -done diff --git a/packages/aws-cdk/test/integ/init/test-fsharp.sh b/packages/aws-cdk/test/integ/init/test-fsharp.sh index f8ad463703672..7ea578e300c8d 100755 --- a/packages/aws-cdk/test/integ/init/test-fsharp.sh +++ b/packages/aws-cdk/test/integ/init/test-fsharp.sh @@ -1,26 +1,6 @@ #!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -e -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash +set -eu +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -header F# - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying F# template $template" - - setup - - cdk init -l fsharp $template - cdk synth -done +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-fsharp diff --git a/packages/aws-cdk/test/integ/init/test-generate-only.sh b/packages/aws-cdk/test/integ/init/test-generate-only.sh deleted file mode 100755 index f09ab29fcf537..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-generate-only.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -e -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash - -header "--generate-only" - -#------------------------------------------------------------------ - -echo "Trying --generate-only" - -setup - -cdk init -l javascript --generate-only - -if [ -d .git ] -then - fail "git shouldn't have been initialized" -fi diff --git a/packages/aws-cdk/test/integ/init/test-go.sh b/packages/aws-cdk/test/integ/init/test-go.sh deleted file mode 100755 index 58959855073f0..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-go.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -eu -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash -dist_root=$(cd ${DIST_ROOT:-.} && pwd) - -header Go - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying Go template $template" - - setup - - cdk init -l go $template - go mod edit -replace github.com/aws/aws-cdk-go/awscdk=$dist_root/go/awscdk - go mod tidy - go test - cdk synth -done diff --git a/packages/aws-cdk/test/integ/init/test-java.sh b/packages/aws-cdk/test/integ/init/test-java.sh index d2c95984fb178..404256230b64f 100755 --- a/packages/aws-cdk/test/integ/init/test-java.sh +++ b/packages/aws-cdk/test/integ/init/test-java.sh @@ -1,27 +1,6 @@ #!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -e -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash +set -eu +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -header Java - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying Java template $template" - - setup - - cdk init -l java $template - mvn package - cdk synth -done +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-java diff --git a/packages/aws-cdk/test/integ/init/test-javascript.sh b/packages/aws-cdk/test/integ/init/test-javascript.sh index 511403e19efcd..8a544ff669ace 100755 --- a/packages/aws-cdk/test/integ/init/test-javascript.sh +++ b/packages/aws-cdk/test/integ/init/test-javascript.sh @@ -1,27 +1,6 @@ #!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -e -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash +set -eu +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -header Javascript - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying Javascript template $template" - - setup - - cdk init -l javascript $template - npm run test - cdk synth -done +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-javascript diff --git a/packages/aws-cdk/test/integ/init/test-python-app.sh b/packages/aws-cdk/test/integ/init/test-python-app.sh index 3f130fcb24aaa..a6cb2be1f3af8 100755 --- a/packages/aws-cdk/test/integ/init/test-python-app.sh +++ b/packages/aws-cdk/test/integ/init/test-python-app.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Naming shim for backwards compatibility with legacy -# tests and canaries. set -eu -scriptdir=$(cd $(dirname $0) && pwd) -exec $scriptdir/test-python.sh +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. + +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-python diff --git a/packages/aws-cdk/test/integ/init/test-python-stackname.sh b/packages/aws-cdk/test/integ/init/test-python-stackname.sh deleted file mode 100755 index 415c9bdb25cf2..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-python-stackname.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Naming shim for backwards compatibility with legacy -# tests and canaries. -set -eu -scriptdir=$(cd $(dirname $0) && pwd) -init_test_dir=/tmp/cdkInitTest -source $scriptdir/test-python.sh diff --git a/packages/aws-cdk/test/integ/init/test-python.sh b/packages/aws-cdk/test/integ/init/test-python.sh deleted file mode 100755 index d40d94d4534ca..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-python.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -eu -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash - -header Python - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying Python template $template" - - setup - - cdk init -l python $template - - source .venv/bin/activate - type -p pip - pip install -r requirements.txt - ./.venv/bin/pip install -r requirements-dev.txt - pytest - - cdk synth -done diff --git a/packages/aws-cdk/test/integ/init/test-typescript-app.sh b/packages/aws-cdk/test/integ/init/test-typescript-app.sh index 7db05ee7e5dad..68ff7bc6f5b2c 100755 --- a/packages/aws-cdk/test/integ/init/test-typescript-app.sh +++ b/packages/aws-cdk/test/integ/init/test-typescript-app.sh @@ -1,7 +1,6 @@ #!/bin/bash -# Naming shim for backwards compatibility with legacy -# tests and canaries. set -eu -scriptdir=$(cd $(dirname $0) && pwd) -# Run both app templates -exec $scriptdir/test-typescript.sh app sample-app +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. + +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-typescript-app diff --git a/packages/aws-cdk/test/integ/init/test-typescript-lib.sh b/packages/aws-cdk/test/integ/init/test-typescript-lib.sh index 514f6bf9fb800..7bae427df1e66 100755 --- a/packages/aws-cdk/test/integ/init/test-typescript-lib.sh +++ b/packages/aws-cdk/test/integ/init/test-typescript-lib.sh @@ -1,7 +1,6 @@ #!/bin/bash -# Naming shim for backwards compatibility with legacy -# tests and canaries. set -eu -scriptdir=$(cd $(dirname $0) && pwd) -# Run only lib template -exec $scriptdir/test-typescript.sh lib +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. + +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-typescript-lib diff --git a/packages/aws-cdk/test/integ/init/test-typescript-versions.sh b/packages/aws-cdk/test/integ/init/test-typescript-versions.sh index da5793661a97e..33b52b062070b 100755 --- a/packages/aws-cdk/test/integ/init/test-typescript-versions.sh +++ b/packages/aws-cdk/test/integ/init/test-typescript-versions.sh @@ -3,34 +3,7 @@ # setup #------------------------------------------------------------------ set -eu -scriptdir=$(cd $(dirname $0) && pwd) -integdir=$(dirname $scriptdir) -source ${scriptdir}/common.bash -header TypeScript Versions - -#------------------------------------------------------------------ - -MIN_SUPPORTED_TS_VERSION=${1:-"3.9"} -SUPPORTED_TS_VERSIONS=$(node ${integdir}/typescript-versions.js ${MIN_SUPPORTED_TS_VERSION}) - -for version in $SUPPORTED_TS_VERSIONS; do - header TypeScript v$version - - setup - - set -x - node --version - npm --version - - cdk init -l typescript sample-app --generate-only - sed '/\"devDependencies\"/,/}/ d; /^$/d' package.json > package.json.new && rm package.json && mv package.json.new package.json - npm install --save-dev typescript@$version - npm install # Older versions of npm require this to be a separate step from the one above - npm prune && npm ls - rm test/* - npm run build - cdk synth - - set +x -done +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ', +# and in fact has been integrated into the regular TypeScript tests. +exit 0 \ No newline at end of file diff --git a/packages/aws-cdk/test/integ/init/test-typescript.sh b/packages/aws-cdk/test/integ/init/test-typescript.sh deleted file mode 100755 index 14fa77d4463dd..0000000000000 --- a/packages/aws-cdk/test/integ/init/test-typescript.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------ -# setup -#------------------------------------------------------------------ -set -eu -scriptdir=$(cd $(dirname $0) && pwd) -source ${scriptdir}/common.bash - -header TypeScript - -#------------------------------------------------------------------ - -if [[ "${1:-}" == "" ]]; then - templates="app sample-app lib" -else - templates="$@" -fi - -for template in $templates; do - echo "Trying TypeScript template $template" - - setup - - cdk init -l typescript $template - npm prune && npm ls # this will fail if we have unmet peer dependencies - npm run build - npm run test - - # Can't run `cdk synth` on libraries - if [[ $template != "lib" ]]; then - cdk synth - fi -done diff --git a/packages/aws-cdk/test/integ/run-against-dist b/packages/aws-cdk/test/integ/run-against-dist index c7ade80dbb1f3..5fb4abea341eb 100755 --- a/packages/aws-cdk/test/integ/run-against-dist +++ b/packages/aws-cdk/test/integ/run-against-dist @@ -1,48 +1,19 @@ #!/bin/bash -# Run a given test against the packages found in the CDK distribution. -# -# - Set up verdaccio and publish all NPM tarballs found in the given directory to it. -# - Install the CLI from that Verdaccio fixture somewhere and put it -# on the PATH. -# - Prepare the various package managers to take their packages from dist/ as well. -# -# Parameter: DIST_ROOT, if different than the current directory. set -eu -scriptdir=$(cd $(dirname $0) && pwd) -source $scriptdir/run-against-dist.bash +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -# If DIST_ROOT is not given, guess at a sane location. -if [[ "${DIST_ROOT:-}" == "" && -f $scriptdir/../../../dist/build.json ]]; then - DIST_ROOT=$scriptdir/../../../dist -fi +export VERSION=$(node -pe "require('./build.json').version") -dist_root=$(cd ${DIST_ROOT:-.} && pwd) +# The package MUST be 'npm install'ed from the package repository (`npm install --production` +# will not work because that will resolve devDependencies even though it will not install them), +# but it may not live in a 'node_modules' directory because Jest 27 does not support that. Do contortions. +export INTEG_TOOLS=cli_integ +rm -rf $INTEG_TOOLS && mkdir $INTEG_TOOLS +npm install --prefix $INTEG_TOOLS --no-save ./js/aws-cdk-testing-cli-integ-*.tgz +mv $($INTEG_TOOLS/node_modules/.bin/test-root)/* $INTEG_TOOLS -if [[ ! -f $dist_root/build.json ]]; then - echo "$dist_root does not seem to be a built CDK distribution (change directory or use DIST_ROOT)" >&2 - exit 1 -fi +# Do a breakpoint for testing +codebuild-breakpoint -export CANDIDATE_VERSION=$(node -p "require('${dist_root}/build.json').version") - -# FRAMEWORK_VERSION is the version that will be 'npm install'ed by the tests -if [[ "${FRAMEWORK_VERSION:-}" = "" ]]; then - export FRAMEWORK_VERSION=${CANDIDATE_VERSION} -fi -export TEST_RUNNER=dist - -serve_npm_packages -install_cli - -prepare_java_packages -prepare_nuget_packages -prepare_python_packages - -# Install additional tool wrappers before running the target script -export PATH="$scriptdir/run-wrappers/dist:$PATH" -hash -r - -# Run target script -# NOTE: no 'exec' because we need to shutdown verdaccio only AFTER we've -# run the subscript. -"$@" +CONCURRENCY=5 exec ${INTEG_TOOLS}/bin/stage-distribution run . "$@" diff --git a/packages/aws-cdk/test/integ/run-against-dist.bash b/packages/aws-cdk/test/integ/run-against-dist.bash deleted file mode 100644 index 84162031f5068..0000000000000 --- a/packages/aws-cdk/test/integ/run-against-dist.bash +++ /dev/null @@ -1,147 +0,0 @@ -# Helper functions to go with 'run-against-dist' -# NPM Workspace. Will have CDK CLI and verdaccio installed into it. -npmws=/tmp/cdk-rundist -rm -rf $npmws -mkdir -p $npmws - -set -x - -# This script must create 1 or 2 traps, and the 'trap' command will replace -# the previous trap, so get some 'dynamic traps' mechanism in place -TRAPS=() - -function run_traps() { - for cmd in "${TRAPS[@]}"; do - echo "cleanup: $cmd" >&2 - eval "$cmd" - done -} - -trap run_traps EXIT - -function log() { - echo >&2 "| $@" -} - -function header() { - log - log "============================================================================================" - log $@ - log "============================================================================================" -} - -function serve_npm_packages() { - if [ -n "${SERVE_NPM_TARBALLS_PID:-}" ]; then - log >&2 "Verdaccio is already running" - return 1 - fi - - #------------------------------------------------------------------------------ - # Start a mock npm repository from the given tarballs - #------------------------------------------------------------------------------ - header "Starting local NPM Repository (Serving version ${CANDIDATE_VERSION})" - - tarballs_glob="$dist_root/js/*.tgz" - - if [[ -f package.json ]]; then - echo "Do not run this script in a directory with a package.json! It will most likely break!" >&2 - # Cowardly not running 'exit 1' because I'm not sure I won't mess up the build/canaries by doing so - fi - - # When using '--daemon', 'npm install' first so the files are permanent, or - # 'npx' will remove them too soon. - npm install serve-npm-tarballs - eval $(npx serve-npm-tarballs --glob "${tarballs_glob}" --daemon) - TRAPS+=("kill $SERVE_NPM_TARBALLS_PID") -} - -function install_cli() { - echo "Installing CLI aws-cdk@${CANDIDATE_VERSION}" - (cd ${npmws} && npm install --prefix $npmws aws-cdk@${CANDIDATE_VERSION}) - export PATH=$npmws/node_modules/.bin:$PATH -} - -function prepare_java_packages() { - log "Preparing Maven packages..." - - # copy the maven staging repo to the maven local repo and set as M2 home - # this ensures that the canary builds against the build artifacts, not maven central - if [ ! -d $dist_root/java ]; then - echo "Maven packages missing at $dist_root/java" >&2 - exit 1 - fi - - # Rename all maven-metadata.xml* files to maven-metadata-local.xml* - # This is necessary for Maven to find them correctly after we've rsync'ed - # them into place: - # https://github.com/sonatype/sonatype-aether/blob/master/aether-impl/src/main/java/org/sonatype/aether/impl/internal/SimpleLocalRepositoryManager.java#L114 - for f in $(find $dist_root/java -name maven-metadata.xml\*); do - mv "$f" "$(echo "$f" | sed s/metadata\.xml/metadata-local.xml/)" - done - - export MAVEN_CONFIG=${MAVEN_CONFIG:-$HOME/.m2} - rsync -a $dist_root/java/ ${MAVEN_CONFIG}/repository -} - -function prepare_nuget_packages() { - # For NuGet, we wrap the "dotnet" CLI command to use local packages. - log "Writing new NuGet configuration..." - - local NUGET_SOURCE=$dist_root/dotnet - - if [ ! -d "$NUGET_SOURCE" ]; then - echo "NuGet packages missing at $NUGET_SOURCE" >&2 - exit 1 - fi - - mkdir -p $HOME/.nuget/NuGet - if [ -f $HOME/.nuget/NuGet/NuGet.Config ]; then - echo "⚠️ Saving previous NuGet.Config to $HOME/.nuget/NuGet/NuGet.Config.bak" - mv $HOME/.nuget/NuGet/NuGet.Config $HOME/.nuget/NuGet/NuGet.Config.bak - fi - - TRAPS+=('clean_up_nuget_config') - - cat > $HOME/.nuget/NuGet/NuGet.Config < - - - - - - -EOF -} - -function clean_up_nuget_config() { - log "Restoring NuGet configuration" - if [ -f $HOME/.nuget/NuGet/NuGet.Config.bak ]; then - log "-> Restoring $HOME/.nuget/NuGet/NuGet.Config from $HOME/.nuget/NuGet/NuGet.Config.bak" - mv -f $HOME/.nuget/NuGet/NuGet.Config.bak $HOME/.nuget/NuGet/NuGet.Config - else - log "-> Removing $HOME/.nuget/NuGet/NuGet.Config" - rm -f $HOME/.nuget/NuGet/NuGet.Config - fi -} - -# pip_install REQUIREMENTS_FILE -function prepare_python_packages() { - log "Hijacking 'pip install' command..." - - # We can't use a $PATH hijack, because we'll be creating a venv - # later which will re-hijack ours with a 'pip' binary. Use a function instead, - # the real logic will reside in "pip_" - - export PYTHON_WHEELS=$dist_root/python - - if [ ! -d "$PYTHON_WHEELS" ]; then - echo "Python build artifacts missing at $PYTHON_WHEELS" >&2 - exit 1 - fi - - export -f pip -} - -function pip() { - pip_ "$@" -} diff --git a/packages/aws-cdk/test/integ/run-against-release b/packages/aws-cdk/test/integ/run-against-release index 5bfcbbfae7e4f..3602333135990 100755 --- a/packages/aws-cdk/test/integ/run-against-release +++ b/packages/aws-cdk/test/integ/run-against-release @@ -1,37 +1,18 @@ #!/bin/bash -# Run a given test against the publicly released packages -# -# - Install the latest CLI somewhere and put it on the PATH. -# - Run the script set -eu -scriptdir=$(cd $(dirname $0) && pwd) -CLI_INSTALLER="${CLI_INSTALLER:=npm}" +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly in the future. -if [ ${CLI_INSTALLER} = "npm" ]; then - install_command="install" -elif [ ${CLI_INSTALLER} = "yarn" ]; then - install_command="add" -else - echo "CLI_INSTALLER can only be set to either npm or yarn (got ${CLI_INSTALLER})" - exit 1 -fi +# The package MUST be 'npm install'ed from the package repository (`npm install --production` +# will not work because that will resolve devDependencies even though it will not install them), +# but it may not live in a 'node_modules' directory because Jest 27 does not support that. Do contortions. +export INTEG_TOOLS=cli_integ +rm -rf $INTEG_TOOLS && mkdir $INTEG_TOOLS +npm install --prefix $INTEG_TOOLS --no-save @aws-cdk-testing/cli-integ@${RELEASE_TAG:-latest} +mv $($INTEG_TOOLS/node_modules/.bin/test-root)/* $INTEG_TOOLS -# NPM Workspace. Will have CDK CLI installed into it. -npmws=/tmp/cdk-runrelease -rm -rf $npmws -mkdir -p $npmws +# Find the latest CLI version in this tag +npm view aws-cdk@${RELEASE_TAG:-latest} --json > release.json +export VERSION=$(node -pe "require('./release.json').version") -# Install the CLI and put it on the PATH -(cd $npmws && ${CLI_INSTALLER} ${install_command} aws-cdk@${RELEASE_TAG:-latest}) - -# FRAMEWORK_VERSION is the version that will be 'npm install'ed by the tests -if [[ "${FRAMEWORK_VERSION:-}" = "" ]]; then - cli_version=$(cd $npmws && node -p "require('aws-cdk/package.json').version") - export FRAMEWORK_VERSION=${cli_version} -fi - -export PATH=$npmws/node_modules/.bin:$PATH -export TEST_RUNNER=release - -# Run the inner script exec "$@" diff --git a/packages/aws-cdk/test/integ/run-against-repo b/packages/aws-cdk/test/integ/run-against-repo deleted file mode 100755 index 420850f2cd951..0000000000000 --- a/packages/aws-cdk/test/integ/run-against-repo +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Script to run a given test against the monorepo. -# -# Set up paths so that `cdk` binary is on the path, and make it -# so that `npm install` symlinks from the monorepo package directories. -set -eu - -cli_dir=$(cd $(dirname $0)/../.. && pwd) -repo_root=$(cd $cli_dir/../.. && pwd) - -if [[ ! -f $repo_root/package.json ]]; then - echo "$repo_root does not seem to be the root of the aws-cdk repository." >&2 - exit 1 -fi - -export REPO_ROOT="$repo_root" -export ORIGINAL_NPM="$(type -p npm)" -export TEST_RUNNER=repo - -export PATH="$cli_dir/bin:$cli_dir/test/integ/run-wrappers/repo:$PATH" -hash -r -exec "$@" diff --git a/packages/aws-cdk/test/integ/run-wrappers/dist/pip_ b/packages/aws-cdk/test/integ/run-wrappers/dist/pip_ deleted file mode 100755 index ce580ea30a5f7..0000000000000 --- a/packages/aws-cdk/test/integ/run-wrappers/dist/pip_ +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -eu -if [[ "${1:-}" == "install" ]]; then - # We will receive `pip install -r requirements.txt` and need to - # install the packages from the local dist. We previously just - # installed everything under $PYTHON_WHEELS ($PYTHON_WHEELS/*.whl). - # However, there is a bug that arises on v2 when we install everything, - # including both `aws-cdk-lib` and `cx-api`, because the latter is also - # packaged in the former and causes conflicts. This can lead to errors like: - # "Unknown type: aws-cdk-lib.cx_api.CloudAssembly" - # Since we only need aws-cdk-lib anyway (for now), just install it alone. - exec pip install ${PYTHON_WHEELS}/aws_cdk_lib*.whl -fi - -exec pip "$@" diff --git a/packages/aws-cdk/test/integ/run-wrappers/repo/dotnet b/packages/aws-cdk/test/integ/run-wrappers/repo/dotnet deleted file mode 100755 index 7ab610a0e7afd..0000000000000 --- a/packages/aws-cdk/test/integ/run-wrappers/repo/dotnet +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "$0: cannot build this kind of project against the repo. Only pure NPM projects are supported. Use 'run-against-dist' instead." >&2 -exit 1 diff --git a/packages/aws-cdk/test/integ/run-wrappers/repo/mvn b/packages/aws-cdk/test/integ/run-wrappers/repo/mvn deleted file mode 100755 index 7ab610a0e7afd..0000000000000 --- a/packages/aws-cdk/test/integ/run-wrappers/repo/mvn +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "$0: cannot build this kind of project against the repo. Only pure NPM projects are supported. Use 'run-against-dist' instead." >&2 -exit 1 diff --git a/packages/aws-cdk/test/integ/run-wrappers/repo/pip_ b/packages/aws-cdk/test/integ/run-wrappers/repo/pip_ deleted file mode 100755 index 9553f9cefe2d9..0000000000000 --- a/packages/aws-cdk/test/integ/run-wrappers/repo/pip_ +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "$0: cannot build this kind of project against the repo. Only pure NPM projects are supported. Use 'run-against-dist' instead." >&2 -exit 1 - diff --git a/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh b/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh index ff50aa5f69a2b..c735580c9fd58 100755 --- a/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh +++ b/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh @@ -1,11 +1,12 @@ #!/bin/bash -# -# Run our integration tests in regression mode against the -# candidate version of the framework, which is the one we just packed. -# -set -euo pipefail -integdir=$(cd $(dirname $0) && pwd) +set -eu +set -x +# This is a backwards compatibilty script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -source ${integdir}/test-cli-regression.bash +# Contract: '@aws-cdk-testing/cli-integ' package is installed in ${INTEG_TOOLS} +previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN --prior-to $VERSION) +echo "Previous version is: $previous" -run_regression_against_framework_version CANDIDATE_VERSION +# Old tests, new CLI, new framework +exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION cli-integ-tests diff --git a/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh b/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh index 8b670eb7b793d..8c828fb2138ce 100755 --- a/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh +++ b/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh @@ -1,11 +1,11 @@ #!/bin/bash -# -# Run our integration tests in regression mode against the -# previous version of the framework, relative to the version being packed now. -# -set -euo pipefail -integdir=$(cd $(dirname $0) && pwd) +set -eu +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -source ${integdir}/test-cli-regression.bash +# Contract: '@aws-cdk-testing/cli-integ' package is installed in ${INTEG_TOOLS} +previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN --prior-to $VERSION) +echo "Previous version is: $previous" -run_regression_against_framework_version PREVIOUS_VERSION +# Old tests, new CLI, old framework +exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION --framework-version=$previous cli-integ-tests diff --git a/packages/aws-cdk/test/integ/typescript-versions.ts b/packages/aws-cdk/test/integ/typescript-versions.ts deleted file mode 100644 index cf86653b99793..0000000000000 --- a/packages/aws-cdk/test/integ/typescript-versions.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { spawnSync } from 'child_process'; - -const minSupportedVersion = process.argv.slice(2, 3); - -const { stdout } = spawnSync('npm', ['--silent', 'view', `typescript@>=${minSupportedVersion}`, 'version', '--json']); - -const versions: string[] = JSON.parse(stdout); -const minorVersions = Array.from(new Set(versions.map(v => v.split('.').slice(0, 2).join('.')))); - -process.stdout.write(minorVersions.join(' ')); diff --git a/packages/aws-cdk/test/integ/uberpackage/jest.config.js b/packages/aws-cdk/test/integ/uberpackage/jest.config.js deleted file mode 100644 index 1e3fe3d13f96b..0000000000000 --- a/packages/aws-cdk/test/integ/uberpackage/jest.config.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - moduleFileExtensions: [ - "js", - ], - testMatch: [ - "**/*.integtest.js", - ], - testEnvironment: "node", - bail: 1, - verbose: true, - reporters: [ - "default", - [ "jest-junit", { suiteName: "jest tests", outputDirectory: "coverage" } ] - ] -}; diff --git a/packages/aws-cdk/test/integ/uberpackage/test.sh b/packages/aws-cdk/test/integ/uberpackage/test.sh index 41761b349580e..005ad2ffe1544 100755 --- a/packages/aws-cdk/test/integ/uberpackage/test.sh +++ b/packages/aws-cdk/test/integ/uberpackage/test.sh @@ -1,14 +1,6 @@ #!/bin/bash +set -eu +# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ' +# and should be called from there directly. -set -euo pipefail - -scriptdir=$(cd $(dirname $0) && pwd) - -echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' -echo 'UberCDK Integration Tests' -echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' - -cd $scriptdir - -source ../common/jest-test.bash -invokeJest "$@" +exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION uberpackage diff --git a/packages/aws-cdk/test/rwlock.test.ts b/packages/aws-cdk/test/rwlock.test.ts new file mode 100644 index 0000000000000..d241eaaf96844 --- /dev/null +++ b/packages/aws-cdk/test/rwlock.test.ts @@ -0,0 +1,52 @@ +import * as os from 'os'; +import * as path from 'path'; +import { RWLock } from '../lib/api/util/rwlock'; + +function testDir() { + return path.join(os.tmpdir(), 'rwlock-tests'); +} + +test('writer lock excludes other locks', async () => { + // GIVEN + const lock = new RWLock(testDir()); + const w = await lock.acquireWrite(); + + // WHEN + try { + await expect(lock.acquireWrite()).rejects.toThrow(/currently synthing/); + await expect(lock.acquireRead()).rejects.toThrow(/currently synthing/); + } finally { + await w.release(); + } +}); + +test('reader lock allows other readers but not writers', async () => { + // GIVEN + const lock = new RWLock(testDir()); + const r = await lock.acquireRead(); + + // WHEN + try { + await expect(lock.acquireWrite()).rejects.toThrow(/currently reading/); + + const r2 = await lock.acquireRead(); + await r2.release(); + } finally { + await r.release(); + } +}); + +test('can convert writer to reader lock', async () => { + // GIVEN + const lock = new RWLock(testDir()); + const w = await lock.acquireWrite(); + + // WHEN + const r = await w.convertToReaderLock(); + try { + const r2 = await lock.acquireRead(); + await r2.release(); + } finally { + await r.release(); + } +}); \ No newline at end of file diff --git a/packages/aws-cdk/test/util.ts b/packages/aws-cdk/test/util.ts index 751c1c1ad6bba..97d7e519e9be2 100644 --- a/packages/aws-cdk/test/util.ts +++ b/packages/aws-cdk/test/util.ts @@ -239,3 +239,7 @@ export function withMocked(obj: A, key: function isPromise(object: any): object is Promise { return Promise.resolve(object) === object; } + +export async function sleep(ms: number) { + return new Promise(ok => setTimeout(ok, ms)); +} diff --git a/packages/aws-cdk/test/util/stack-monitor.test.ts b/packages/aws-cdk/test/util/stack-monitor.test.ts index 7e2644b481b9f..12bc5ac80007e 100644 --- a/packages/aws-cdk/test/util/stack-monitor.test.ts +++ b/packages/aws-cdk/test/util/stack-monitor.test.ts @@ -1,5 +1,5 @@ import { StackActivityMonitor, IActivityPrinter, StackActivity } from '../../lib/api/util/cloudformation/stack-activity-monitor'; -import { sleep } from '../integ/helpers/aws'; +import { sleep } from '../util'; import { MockSdk } from './mock-sdk'; let sdk: MockSdk; diff --git a/packages/awslint/lib/rules/durations.ts b/packages/awslint/lib/rules/durations.ts index 111f3d8648666..ff32390faf615 100644 --- a/packages/awslint/lib/rules/durations.ts +++ b/packages/awslint/lib/rules/durations.ts @@ -3,6 +3,7 @@ import { Linter } from '../linter'; const DURATION_FQN = '@aws-cdk/core.Duration'; const DURATION_SUFFIX = /(Days|Milli(?:(?:S|s)econd)?s?|Sec(?:ond)?s?)$/; +const EXCLUDE_ANNOTATION_DURATION_PROP_TYPE = '[disable-awslint:duration-prop-type]'; export const durationsLinter = new Linter(assm => { const result = new Array(); @@ -12,7 +13,8 @@ export const durationsLinter = new Linter(assm => { if (type.fqn.startsWith(generatedClassesPrefix)) { continue; } if (!type.isClassType() && !type.isDataType() && !type.isInterfaceType()) { continue; } for (const property of type.allProperties) { - if (isDurationProperty(property)) { + if (isDurationProperty(property) + && !property.docs.toString().includes(EXCLUDE_ANNOTATION_DURATION_PROP_TYPE)) { result.push(property); } } diff --git a/packages/awslint/package.json b/packages/awslint/package.json index a526d1db56716..59f8d4f5724c1 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -18,11 +18,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "1.72.0", + "@jsii/spec": "1.73.0", "camelcase": "^6.3.0", "chalk": "^4", "fs-extra": "^9.1.0", - "jsii-reflect": "1.72.0", + "jsii-reflect": "1.73.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-assets/lib/private/archive.ts b/packages/cdk-assets/lib/private/archive.ts index a3922d4d59dba..b54de7590f67b 100644 --- a/packages/cdk-assets/lib/private/archive.ts +++ b/packages/cdk-assets/lib/private/archive.ts @@ -1,3 +1,4 @@ +import { randomUUID } from 'crypto'; import { createWriteStream, promises as fs } from 'fs'; import * as path from 'path'; import * as glob from 'glob'; @@ -11,7 +12,7 @@ type Logger = (x: string) => void; export async function zipDirectory(directory: string, outputFile: string, logger: Logger): Promise { // We write to a temporary file and rename at the last moment. This is so that if we are // interrupted during this process, we don't leave a half-finished file in the target location. - const temporaryOutputFile = `${outputFile}._tmp`; + const temporaryOutputFile = `${outputFile}.${randomUUID()}._tmp`; await writeZipFile(directory, temporaryOutputFile); await moveIntoPlace(temporaryOutputFile, outputFile, logger); } @@ -96,4 +97,4 @@ async function pathExists(x: string) { } throw e; } -} \ No newline at end of file +} diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 859409ad946c8..7c237f58d46fd 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -30,7 +30,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "1.72.0", + "codemaker": "1.73.0", "yaml": "1.10.2" }, "devDependencies": { diff --git a/tools/@aws-cdk/cdk-build-tools/package.json b/tools/@aws-cdk/cdk-build-tools/package.json index 80bde56c853c5..70b7bf4d13eb1 100644 --- a/tools/@aws-cdk/cdk-build-tools/package.json +++ b/tools/@aws-cdk/cdk-build-tools/package.json @@ -57,10 +57,10 @@ "fs-extra": "^9.1.0", "jest": "^27.5.1", "jest-junit": "^13.2.0", - "jsii": "1.72.0", - "jsii-pacmak": "1.72.0", - "jsii-reflect": "1.72.0", - "markdownlint-cli": "^0.32.2", + "jsii": "1.73.0", + "jsii-pacmak": "1.73.0", + "jsii-reflect": "1.73.0", + "markdownlint-cli": "^0.33.0", "nyc": "^15.1.0", "semver": "^7.3.8", "ts-jest": "^27.1.5", diff --git a/tools/@aws-cdk/cdk-release/lib/lifecycles/bump.ts b/tools/@aws-cdk/cdk-release/lib/lifecycles/bump.ts index 0a6417cb080d6..055c6bdee3cb9 100644 --- a/tools/@aws-cdk/cdk-release/lib/lifecycles/bump.ts +++ b/tools/@aws-cdk/cdk-release/lib/lifecycles/bump.ts @@ -28,7 +28,7 @@ export async function bump(args: BumpOptions, currentVersion: Versions): Promise const newVersion: Versions = { stableVersion: newStableVersion, - alphaVersion: bumpAlphaReleaseVersion(currentVersion, releaseType), + alphaVersion: bumpAlphaReleaseVersion(currentVersion, newStableVersion, releaseType), }; notify(args, @@ -108,19 +108,43 @@ function getTypePriority(type: string): number { /** * https://github.com/aws/aws-cdk/issues/15581 * We version any alpha modules in one of two ways, depending on the main/stable release. - * If the main release is itself a prerelease (e.g., 2.0.0-rc.17), - * we will increment the current alpha release. + * + * If the main release is itself a prerelease (e.g., 2.0.0-rc.17): + * - if the current alpha version has the same major.minor.patch version as the current stable, + * we probably have a long-running RC candidate that we are actually releasing. Increment the + * current alpha release. + * - if not, then we are probably coming up with a testing RC version for the pipeline. We must + * come up with an alpha version that can never be released publicly, because our version numbers + * must never be the same as any publicly released package. Use '2.0.0-alpha.999' for those. + * * If the main release is not a prerelease, we use the main release version, but with an alpha tag. + * + * This logic is mirrored in the integ tests. */ -function bumpAlphaReleaseVersion(currentVersion: Versions, releaseType: semver.ReleaseType): string | undefined { - if (!currentVersion.alphaVersion) { return undefined; } +function bumpAlphaReleaseVersion(previousVersions: Versions, currentStable: string, releaseType: semver.ReleaseType): string | undefined { + if (!previousVersions.alphaVersion) { return undefined; } + + let newAlphaVersion; + if (releaseType.startsWith('pre')) { + // Prerelease, either long-running or just a unique one to test + const stableV = semver.parse(currentStable); + const alphaV = semver.parse(previousVersions.alphaVersion); + if (!stableV || !alphaV) { + throw new Error(`Could not parse either ${currentStable} or ${previousVersions.alphaVersion} as a version`); + } - const newAlphaVersion = releaseType.startsWith('pre') - ? semver.inc(currentVersion.alphaVersion, releaseType, 'alpha') - : semver.inc(currentVersion.stableVersion, 'pre' + releaseType as semver.ReleaseType, 'alpha'); + if (stableV?.compareMain(alphaV) === 0) { + newAlphaVersion = semver.inc(previousVersions.alphaVersion, releaseType, 'alpha'); + } else { + newAlphaVersion = semver.inc(previousVersions.stableVersion, releaseType as semver.ReleaseType, 'alpha')?.replace(/0$/, '999'); + } + } else { + // Stable release, add `-alpha.0` to the end of the stable release version + newAlphaVersion = semver.inc(previousVersions.stableVersion, 'pre' + releaseType as semver.ReleaseType, 'alpha'); + } if (!newAlphaVersion) { - throw new Error('Could not increment alpha version: ' + currentVersion.alphaVersion); + throw new Error('Could not increment alpha version: ' + previousVersions.alphaVersion); } return newAlphaVersion; } diff --git a/tools/@aws-cdk/cdk-release/test/bump.test.ts b/tools/@aws-cdk/cdk-release/test/bump.test.ts index df0d08eaae828..234b8d0c6fdfd 100644 --- a/tools/@aws-cdk/cdk-release/test/bump.test.ts +++ b/tools/@aws-cdk/cdk-release/test/bump.test.ts @@ -45,7 +45,7 @@ describe('stable versions', () => { describe('alpha versions', () => { - test('for prerelease, bumps existing alpha counter as a prerelease', async () => { + test('long-running prerelease: bumps existing alpha counter as a prerelease', async () => { const currentVersion = { stableVersion: '1.2.0-rc.4', alphaVersion: '1.2.0-alpha.0' }; const bumpedVersion = await bump({ releaseAs: 'minor', versionFile: 'version.json', prerelease: 'rc' }, currentVersion); @@ -55,8 +55,18 @@ describe('alpha versions', () => { }); }); - test('for normal releases, bumps alpha as a prerelease of stable release', async () => { - const currentVersion = { stableVersion: '1.2.0', alphaVersion: '1.1.0-alpha.0' }; + test('one-off prerelease: alpha is a prerelease of stable release with crazy alpha tag', async () => { + const currentVersion = { stableVersion: '1.2.0', alphaVersion: '1.2.0-alpha.0' }; + const bumpedVersion = await bump({ releaseAs: 'minor', versionFile: 'version.json', prerelease: 'rc' }, currentVersion); + + expect(bumpedVersion).toEqual({ + stableVersion: '1.3.0-rc.0', + alphaVersion: '1.3.0-alpha.999', + }); + }); + + test('normal release: alpha is a prerelease of stable release with realistic alpha tag', async () => { + const currentVersion = { stableVersion: '1.2.0', alphaVersion: '1.2.0-alpha.0' }; const bumpedVersion = await bump({ releaseAs: 'minor', versionFile: 'version.json' }, currentVersion); expect(bumpedVersion).toEqual({ diff --git a/tools/@aws-cdk/cfn2ts/package.json b/tools/@aws-cdk/cfn2ts/package.json index 6f366ced37d15..4e8a562d3018f 100644 --- a/tools/@aws-cdk/cfn2ts/package.json +++ b/tools/@aws-cdk/cfn2ts/package.json @@ -32,7 +32,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "1.72.0", + "codemaker": "1.73.0", "fast-json-patch": "^3.1.1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/tools/@aws-cdk/individual-pkg-gen/transform-packages.ts b/tools/@aws-cdk/individual-pkg-gen/transform-packages.ts index e553c21ab3229..fcaa82a94bda6 100644 --- a/tools/@aws-cdk/individual-pkg-gen/transform-packages.ts +++ b/tools/@aws-cdk/individual-pkg-gen/transform-packages.ts @@ -259,6 +259,11 @@ function transformPackageJsonDependencies(packageJson: any, pkg: any, alphaPacka const devDependencies: { [dep: string]: string; } = {}; for (const v1DevDependency of Object.keys(packageJson.devDependencies || {})) { switch (v1DevDependency) { + // @core corresponds to aws-cdk-lib + // this is needed for packages that only have a dev dependency on @core + case '@aws-cdk/core': + devDependencies['aws-cdk-lib'] = pkg.version; + break; case '@aws-cdk/assert-internal': case '@aws-cdk/assert': devDependencies['@aws-cdk/assert'] = packageJson.devDependencies[v1DevDependency]; diff --git a/tools/@aws-cdk/node-bundle/package.json b/tools/@aws-cdk/node-bundle/package.json index 7bbda2db06274..b59c0cf36be17 100644 --- a/tools/@aws-cdk/node-bundle/package.json +++ b/tools/@aws-cdk/node-bundle/package.json @@ -40,13 +40,13 @@ "jest-junit": "^13", "json-schema": "^0.4.0", "npm-check-updates": "^12", - "projen": "^0.66.0", + "projen": "^0.66.11", "standard-version": "^9", "ts-jest": "^27", "typescript": "^4.5.5" }, "dependencies": { - "esbuild": "^0.16.13", + "esbuild": "^0.16.16", "fs-extra": "^10.1.0", "license-checker": "^25.0.1", "madge": "^5.0.1", diff --git a/tools/@aws-cdk/node-bundle/src/api/bundle.ts b/tools/@aws-cdk/node-bundle/src/api/bundle.ts index 302422075f0ef..6de0e8a2b44d7 100644 --- a/tools/@aws-cdk/node-bundle/src/api/bundle.ts +++ b/tools/@aws-cdk/node-bundle/src/api/bundle.ts @@ -73,6 +73,44 @@ export interface BundleProps { * @default - no check. */ readonly test?: string; + + /** + * Include a sourcemap in the bundle. + * + * @default "inline" + */ + readonly sourcemap?: 'linked' | 'inline' | 'external' | 'both'; + + /** + * Minifies the bundled code. + * + * @default false + */ + readonly minify?: boolean; + + /** + * Removes whitespace from the code. + * This is enabled by default when `minify` is used. + * + * @default false + */ + readonly minifyWhitespace?: boolean; + + /** + * Renames local variables to be shorter. + * This is enabled by default when `minify` is used. + * + * @default false + */ + readonly minifyIdentifiers?: boolean; + + /** + * Rewrites syntax to a more compact format. + * This is enabled by default when `minify` is used. + * + * @default false + */ + readonly minifySyntax?: boolean; } /** @@ -148,6 +186,11 @@ export class Bundle { private readonly allowedLicenses: string[]; private readonly dontAttribute?: string; private readonly test?: string; + private readonly sourcemap?: 'linked' | 'inline' | 'external' | 'both'; + private readonly minify?: boolean; + private readonly minifyWhitespace?: boolean; + private readonly minifyIdentifiers?: boolean; + private readonly minifySyntax?: boolean; private _bundle?: esbuild.BuildResult; private _dependencies?: Package[]; @@ -165,6 +208,11 @@ export class Bundle { this.allowedLicenses = props.allowedLicenses ?? DEFAULT_ALLOWED_LICENSES; this.dontAttribute = props.dontAttribute; this.entryPoints = {}; + this.sourcemap = props.sourcemap; + this.minify = props.minify; + this.minifyWhitespace = props.minifyWhitespace; + this.minifyIdentifiers = props.minifyIdentifiers; + this.minifySyntax = props.minifySyntax; const entryPoints = props.entryPoints ?? (this.manifest.main ? [this.manifest.main] : []); @@ -307,7 +355,7 @@ export class Bundle { } const inputs = Object.keys(this.bundle.metafile!.inputs); const packages = new Set(Array.from(inputs).map(i => this.closestPackagePath(path.join(this.packageDir, i)))); - this._dependencies = Array.from(packages).map(p => this.createPackage(p)).filter(d => d.name !== this.manifest.name); + this._dependencies = Array.from(packages).map(p => this.createPackage(p)).filter(d => d.name !== undefined && d.name !== this.manifest.name); return this._dependencies; } @@ -394,8 +442,12 @@ export class Bundle { bundle: true, target: 'node14', platform: 'node', - sourcemap: 'inline', + sourcemap: this.sourcemap ?? 'inline', metafile: true, + minify: this.minify, + minifyWhitespace: this.minifyWhitespace, + minifyIdentifiers: this.minifyIdentifiers, + minifySyntax: this.minifySyntax, treeShaking: true, absWorkingDir: this.packageDir, external: [...(this.externals.dependencies ?? []), ...(this.externals.optionalDependencies ?? [])], diff --git a/tools/@aws-cdk/pkglint/lib/rules.ts b/tools/@aws-cdk/pkglint/lib/rules.ts index 9f257954fcabc..0351e1e4a7a47 100644 --- a/tools/@aws-cdk/pkglint/lib/rules.ts +++ b/tools/@aws-cdk/pkglint/lib/rules.ts @@ -1676,6 +1676,7 @@ export class UbergenPackageVisibility extends ValidationRule { 'cdk', 'cdk-assets', '@aws-cdk/integ-runner', + '@aws-cdk-testing/cli-integ', ]; public validate(pkg: PackageJson): void { diff --git a/tools/@aws-cdk/prlint/lint.ts b/tools/@aws-cdk/prlint/lint.ts index aaf1c8f0389c1..53e1d877f8fb9 100644 --- a/tools/@aws-cdk/prlint/lint.ts +++ b/tools/@aws-cdk/prlint/lint.ts @@ -306,6 +306,9 @@ export class PullRequestLinter { validationCollector.validateRuleSet({ testRuleSet: [ { test: validateTitlePrefix } ] }); + validationCollector.validateRuleSet({ + testRuleSet: [ { test: validateTitleScope } ] + }) validationCollector.validateRuleSet({ exemption: shouldExemptBreakingChange, @@ -446,6 +449,29 @@ function hasLabel(pr: GitHubPr, labelName: string): boolean { return result; }; +/** + * Check that the PR title uses the typical convention for package names. + * + * For example, "fix(s3)" is preferred over "fix(aws-s3)". + */ +function validateTitleScope(pr: GitHubPr): TestResult { + const result = new TestResult(); + // Specific commit types are handled by `validateTitlePrefix`. This just checks whether + // the scope includes an `aws-` prefix or not. + // Group 1: Scope with parens - "(aws-)" + // Group 2: Scope name - "aws-" + // Group 3: Preferred scope name - "" + const titleRe = /^\w+(\((aws-([\w_-]+))\))?: /; + const m = titleRe.exec(pr.title); + if (m) { + result.assessFailure( + !!(m[2] && m[3]), + `The title of the pull request should omit 'aws-' from the name of modified packages. Use '${m[3]}' instead of '${m[2]}'.`, + ); + } + return result; +} + function assertStability(pr: GitHubPr, _files: GitHubFile[]): TestResult { const title = pr.title; const body = pr.body; diff --git a/tools/@aws-cdk/prlint/test/lint.test.ts b/tools/@aws-cdk/prlint/test/lint.test.ts index ca417917af878..d498f857d54a0 100644 --- a/tools/@aws-cdk/prlint/test/lint.test.ts +++ b/tools/@aws-cdk/prlint/test/lint.test.ts @@ -58,6 +58,63 @@ describe('breaking changes format', () => { }); }); +describe('commit message format', () => { + test('valid scope', async () => { + const issue = { + number: 1, + title: 'chore(s3): some title', + body: '', + labels: [], + }; + const prLinter = configureMock(issue, undefined); + expect(await prLinter.validate()).resolves; + }); + + test('invalid scope with aws- prefix', async () => { + const issue = { + number: 1, + title: 'fix(aws-s3): some title', + body: '', + labels: [{ name: 'pr-linter/exempt-test' }, { name: 'pr-linter/exempt-integ-test' }], + }; + const prLinter = configureMock(issue, undefined); + await expect(prLinter.validate()).rejects.toThrow(/The title of the pull request should omit 'aws-' from the name of modified packages. Use 's3' instead of 'aws-s3'./); + }); + + test('valid scope with aws- in summary and body', async () => { + const issue = { + number: 1, + title: 'docs(s3): something aws-s3', + body: 'something aws-s3', + labels: [], + }; + const prLinter = configureMock(issue, undefined); + expect(await prLinter.validate()).resolves; + }); + + test('valid with missing scope', async () => { + const issue = { + number: 1, + title: 'docs: something aws-s3', + body: '', + labels: [], + }; + const prLinter = configureMock(issue, undefined); + expect(await prLinter.validate()).resolves; + }); + + test.each(['core', 'prlint', 'awslint'])('valid scope for packages that dont use aws- prefix', async (scope) => { + const issue = { + number: 1, + title: `chore(${scope}): some title`, + body: '', + labels: [] + }; + const prLinter = configureMock(issue, undefined); + expect(await prLinter.validate()).resolves; + }) +}); + describe('ban breaking changes in stable modules', () => { test('breaking change in stable module', async () => { const issue = { diff --git a/tools/@aws-cdk/ubergen/bin/ubergen.ts b/tools/@aws-cdk/ubergen/bin/ubergen.ts index fbd29c2b98298..70c34d0a1e583 100644 --- a/tools/@aws-cdk/ubergen/bin/ubergen.ts +++ b/tools/@aws-cdk/ubergen/bin/ubergen.ts @@ -47,6 +47,11 @@ interface LibraryReference { readonly shortName: string; } +type Export = string | { + readonly import?: string; + readonly require?: string; +}; + interface PackageJson { readonly main?: string; readonly description?: string; @@ -103,7 +108,7 @@ interface PackageJson { */ readonly exports?: Record; }; - exports?: Record; + exports?: Record; } /** @@ -269,7 +274,10 @@ async function prepareSourceFiles(libraries: readonly LibraryReference[], packag // Control 'exports' field of the 'package.json'. This will control what kind of 'import' statements are // allowed for this package: we only want to allow the exact import statements that we want to support. packageJson.exports = { - '.': './index.js', + '.': { + import: './index.js', + require: './lazy-index.js', + }, // We need to expose 'package.json' and '.jsii' because 'jsii' and 'jsii-reflect' load them using // require(). (-_-). Can be removed after https://github.com/aws/jsii/pull/3205 gets merged. @@ -280,7 +288,17 @@ async function prepareSourceFiles(libraries: readonly LibraryReference[], packag './.warnings.jsii.js': './.warnings.jsii.js', }; + // We use the index.ts to compile type definitions. + // + // We build two indexes: one for eager loading (used by ESM modules), and one + // for lazy loading (used by CJS modules). The lazy loading will result in faster + // loading times, because we don't have to load and parse all submodules right away, + // but is not compatible with ESM's loading algorithm. + // + // This improves AWS CDK app performance by ~400ms. const indexStatements = new Array(); + const lazyExports = new Array(); + for (const library of libraries) { const libDir = path.join(libRoot, library.shortName); const copied = await transformPackage(library, packageJson, libDir, libraries); @@ -290,13 +308,21 @@ async function prepareSourceFiles(libraries: readonly LibraryReference[], packag } if (library.shortName === 'core') { indexStatements.push(`export * from './${library.shortName}';`); + lazyExports.unshift(`export * from './${library.shortName}';`); } else { - indexStatements.push(`export * as ${library.shortName.replace(/-/g, '_')} from './${library.shortName}';`); + const exportName = library.shortName.replace(/-/g, '_'); + + indexStatements.push(`export * as ${exportName} from './${library.shortName}';`); + lazyExports.push(`Object.defineProperty(exports, '${exportName}', { get: function () { return require('./${library.shortName}'); } });`); } copySubmoduleExports(packageJson.exports, library, library.shortName); } + // make the exports.ts file pass linting + lazyExports.unshift('/* eslint-disable @typescript-eslint/no-require-imports */'); + await fs.writeFile(path.join(libRoot, 'index.ts'), indexStatements.join('\n'), { encoding: 'utf8' }); + await fs.writeFile(path.join(libRoot, 'lazy-index.ts'), lazyExports.join('\n'), { encoding: 'utf8' }); console.log('\t🍺 Success!'); } @@ -307,13 +333,21 @@ async function prepareSourceFiles(libraries: readonly LibraryReference[], packag * Replace the original 'main' export with an export of the new '/index.ts` file we've written * in 'transformPackage'. */ -function copySubmoduleExports(targetExports: Record, library: LibraryReference, subdirectory: string) { +function copySubmoduleExports(targetExports: Record, library: LibraryReference, subdirectory: string) { const visibleName = library.shortName; // Do both REAL "exports" section, as well as virtual, ubergen-only "exports" section for (const exportSet of [library.packageJson.exports, library.packageJson.ubergen?.exports]) { for (const [relPath, relSource] of Object.entries(exportSet ?? {})) { - targetExports[`./${unixPath(path.join(visibleName, relPath))}`] = `./${unixPath(path.join(subdirectory, relSource))}`; + targetExports[`./${unixPath(path.join(visibleName, relPath))}`] = resolveExport(relSource); + } + } + + function resolveExport(exp: A): A { + if (typeof exp === 'string') { + return `./${unixPath(path.join(subdirectory, exp))}` as any; + } else { + return Object.fromEntries(Object.entries(exp).map(([k, v]) => [k, v ? resolveExport(v) : undefined])) as any; } } diff --git a/version.v2.json b/version.v2.json index be1e689fdd99c..b57fee392c9f3 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.59.0", - "alphaVersion": "2.59.0-alpha.0" + "version": "2.62.1", + "alphaVersion": "2.62.1-alpha.0" } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ac9b8471893a3..33eb7ae6bfacb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -75,24 +75,24 @@ integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.8.0": - version "7.20.7" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f" - integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw== + version "7.20.12" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" + integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" "@babel/generator" "^7.20.7" "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.11" "@babel/helpers" "^7.20.7" "@babel/parser" "^7.20.7" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.7" + "@babel/traverse" "^7.20.12" "@babel/types" "^7.20.7" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.1" + json5 "^2.2.2" semver "^6.3.0" "@babel/generator@^7.20.7", "@babel/generator@^7.7.2": @@ -142,7 +142,7 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.20.7": +"@babel/helper-module-transforms@^7.20.11": version "7.20.11" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== @@ -313,10 +313,10 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": - version "7.20.10" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.10.tgz#2bf98239597fcec12f842756f186a9dde6d09230" - integrity sha512-oSf1juCgymrSez8NI4A2sr4+uB/mFd9MXplYGPEBnfAuWmmyeVcHa6xLPiaRBcXkcb/28bgxmQLTVwFKE1yfsg== +"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": + version "7.20.12" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.12.tgz#7f0f787b3a67ca4475adef1f56cb94f6abd4a4b5" + integrity sha512-MsIbFN0u+raeja38qboyF8TIT7K0BFzz/Yd/77ta4MsUsmP2RAnidIlwq7d5HFQrH/OZJecGV6B71C4zAgpoSQ== dependencies: "@babel/code-frame" "^7.18.6" "@babel/generator" "^7.20.7" @@ -348,6 +348,11 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -355,115 +360,115 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@esbuild/android-arm64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.13.tgz#1fc9bfbff0bac558008b2ad7242db1c8024d8cfd" - integrity sha512-r4xetsd1ez1NF9/9R2f9Q6AlxqiZLwUqo7ICOcvEVwopVkXUcspIjEbJk0EVTgT6Cp5+ymzGPT6YNV0ievx4yA== - -"@esbuild/android-arm@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.13.tgz#df3317286eed68c727daf39c2d585625f9c2f170" - integrity sha512-JmtqThupn9Yf+FzANE+GG73ASUkssnPwOsndUElhp23685QzRK+MO1UompOlBaXV9D5FTuYcPnw7p4mCq2YbZQ== - -"@esbuild/android-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.13.tgz#c34826c4bdc57c60cbfb8d5bbd2306a89225626a" - integrity sha512-hKt1bFht/Vtp0xJ0ZVzFMnPy1y1ycmM3KNnp3zsyZfQmw7nhs2WLO4vxdR5YG+6RsHKCb2zbZ3VwlC0Tij0qyA== - -"@esbuild/darwin-arm64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.13.tgz#0b80c8580c262ccfb1203053201cf19c6f7b4cdb" - integrity sha512-ogrVuNi2URocrr3Ps20f075EMm9V7IeenOi9FRj4qdbT6mQlwLuP4l90PW2iBrKERx0oRkcZprEUNsz/3xd7ww== - -"@esbuild/darwin-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.13.tgz#f1a6c9ea67d4eaaf4944e1cbceb800eabc6e7e74" - integrity sha512-Agajik9SBGiKD7FPXE+ExW6x3MgA/dUdpZnXa9y1tyfE4lKQx+eQiknSdrBnWPeqa9wL0AOvkhghmYhpVkyqkA== - -"@esbuild/freebsd-arm64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.13.tgz#d1a45ac5c4a1be566c4eefbadbe5a967288ad338" - integrity sha512-KxMO3/XihBcHM+xQUM6nQZO1SgQuOsd1DCnKF1a4SIf/i5VD45vrqN3k8ePgFrEbMi7m5JeGmvNqwJXinF0a4Q== - -"@esbuild/freebsd-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.13.tgz#ec64a31cabb08343bb4520a221324b40509dffc8" - integrity sha512-Ez15oqV1vwvZ30cVLeBW14BsWq/fdWNQGMOxxqaSJVQVLqHhvgfQ7gxGDiN9tpJdeQhqJO+Q0r02/Tce5+USNg== - -"@esbuild/linux-arm64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.13.tgz#e8db3c3751b32ecf801751424eae43f6863a2ee7" - integrity sha512-qi5n7KwcGViyJeZeQnu8fB6dC3Mlm5PGaqSv2HhQDDx/MPvVfQGNMcv7zcBL4qk3FkuWhGVwXkjQ76x7R0PWlA== - -"@esbuild/linux-arm@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.13.tgz#ac0c8e9f3db8d418f588ae250e9c66ffdcf3cd82" - integrity sha512-18dLd2L3mda+iFj6sswyBMSh2UwniamD9M4DwPv8VM+9apRFlQ5IGKxBdumnTuOI4NvwwAernmUseWhYQ9k+rg== - -"@esbuild/linux-ia32@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.13.tgz#41ee9bd3b7161ab681fab6cb3990a3f5c08a9940" - integrity sha512-2489Xad9sr+6GD7nB913fUqpCsSwVwgskkQTq4Or2mZntSPYPebyJm8l1YruHo7oqYMTGV6RiwGE4gRo3H+EPQ== - -"@esbuild/linux-loong64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.13.tgz#e4a832708e0b47078b91413edcfdb6af88c854a3" - integrity sha512-x8KplRu9Y43Px8I9YS+sPBwQ+fw44Mvp2BPVADopKDWz+h3fcj1BvRU58kxb89WObmwKX9sWdtYzepL4Fmx03A== - -"@esbuild/linux-mips64el@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.13.tgz#30d8571b71e0b8bf25fc5ef11422221ed23cdacc" - integrity sha512-qhhdWph9FLwD9rVVC/nUf7k2U4NZIA6/mGx0B7+O6PFV0GjmPA2E3zDQ4NUjq9P26E0DeAZy9akH9dYcUBRU7A== - -"@esbuild/linux-ppc64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.13.tgz#32a3855d4b79ba1d2b63dab592cb9f0d4a9ba485" - integrity sha512-cVWAPKsrRVxI1jCeJHnYSbE3BrEU+pZTZK2gfao9HRxuc+3m4+RLfs3EVEpGLmMKEcWfVCB9wZ3yNxnknutGKQ== - -"@esbuild/linux-riscv64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.13.tgz#6139202858da8202724d7079102614c269524f34" - integrity sha512-Agb7dbRyZWnmPn5Vvf0eyqaEUqSsaIUwwyInu2EoFTaIDRp093QU2M5alUyOooMLkRbD1WvqQNwx08Z/g+SAcQ== - -"@esbuild/linux-s390x@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.13.tgz#df3550a51e4155cde31486e01d8121f078e959ae" - integrity sha512-AqRBIrc/+kl08ahliNG+EyU+j41wIzQfwBTKpi80cCDiYvYFPuXjvzZsD9muiu58Isj0RVni9VgC4xK/AnSW4g== - -"@esbuild/linux-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.13.tgz#deb7951829ea5930e0d88440aeb5df0756ebb2d0" - integrity sha512-S4wn2BimuhPcoArRtVrdHUKIymCCZcYAXQE47kUiX4yrUrEX2/ifn5eKNbZ5c1jJKUlh1gC2ESIN+iw3wQax3g== - -"@esbuild/netbsd-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.13.tgz#8cba08074263862138cc5c63ad7f9640fe3faa69" - integrity sha512-2c8JWgfUMlQHTdaR5X3xNMwqOyad8kgeCupuVkdm3QkUOzGREjlTETQsK6oHifocYzDCo9FeKcUwsK356SdR+g== - -"@esbuild/openbsd-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.13.tgz#4ae19ac63c665424d248ba5c577618dd7bbcebd5" - integrity sha512-Bwh+PmKD/LK+xBjqIpnYnKYj0fIyQJ0YpRxsn0F+WfzvQ2OA+GKDlf8AHosiCns26Q4Dje388jQVwfOBZ1GaFw== - -"@esbuild/sunos-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.13.tgz#592caacab6b2c7669cd869b51f66dc354da03fc2" - integrity sha512-8wwk6f9XGnhrF94/DBdFM4Xm1JeCyGTCj67r516VS9yvBVQf3Rar54L+XPVDs/oZOokwH+XsktrgkuTMAmjntg== - -"@esbuild/win32-arm64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.13.tgz#965ebbe889e4221962250c55facaa1e48130c162" - integrity sha512-Jmwbp/5ArLCiRAHC33ODfcrlIcbP/exXkOEUVkADNJC4e/so2jm+i8IQFvVX/lA2GWvK3GdgcN0VFfp9YITAbg== - -"@esbuild/win32-ia32@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.13.tgz#1b04965bcf340ba4879b452ac32df63216d4c87e" - integrity sha512-AX6WjntGjhJHzrPSVvjMD7grxt41koHfAOx6lxLorrpDwwIKKPaGDASPZgvFIZHTbwhOtILW6vAXxYPDsKpDJA== - -"@esbuild/win32-x64@0.16.13": - version "0.16.13" - resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.13.tgz#0b0989cf0e7887cb0f3124e705cee68a694b96dd" - integrity sha512-A+U4gM6OOkPS03UgVU08GTpAAAxPsP/8Z4FmneGo4TaVSD99bK9gVJXlqUEPMO/htFXEAht2O6pX4ErtLY5tVg== +"@esbuild/android-arm64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.16.tgz#833184b8a0a96f9c85105c53d0a67e6d3c5c3f07" + integrity sha512-hFHVAzUKp9Tf8psGq+bDVv+6hTy1bAOoV/jJMUWwhUnIHsh6WbFMhw0ZTkqDuh7TdpffFoHOiIOIxmHc7oYRBQ== + +"@esbuild/android-arm@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.16.tgz#23761b2fd1dfa4806161dbfc9e0824f04061cb95" + integrity sha512-BUuWMlt4WSXod1HSl7aGK8fJOsi+Tab/M0IDK1V1/GstzoOpqc/v3DqmN8MkuapPKQ9Br1WtLAN4uEgWR8x64A== + +"@esbuild/android-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.16.tgz#ffa09f04c0ffea5b594ab7655fc9ca1220365e9b" + integrity sha512-9WhxJpeb6XumlfivldxqmkJepEcELekmSw3NkGrs+Edq6sS5KRxtUBQuKYDD7KqP59dDkxVbaoPIQFKWQG0KLg== + +"@esbuild/darwin-arm64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.16.tgz#62ed2b4bfab594b9e5e708580361f1d059b53b26" + integrity sha512-8Z+wld+vr/prHPi2O0X7o1zQOfMbXWGAw9hT0jEyU/l/Yrg+0Z3FO9pjPho72dVkZs4ewZk0bDOFLdZHm8jEfw== + +"@esbuild/darwin-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.16.tgz#e9756d34cd9b3737a5354e89ca0fdca32d8df64c" + integrity sha512-CYkxVvkZzGCqFrt7EgjFxQKhlUPyDkuR9P0Y5wEcmJqVI8ncerOIY5Kej52MhZyzOBXkYrJgZeVZC9xXXoEg9A== + +"@esbuild/freebsd-arm64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.16.tgz#db7bce444d372e5a213a3f359c42aee3acc0dd45" + integrity sha512-fxrw4BYqQ39z/3Ja9xj/a1gMsVq0xEjhSyI4a9MjfvDDD8fUV8IYliac96i7tzZc3+VytyXX+XNsnpEk5sw5Wg== + +"@esbuild/freebsd-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.16.tgz#02e8a81b7e56040b5eb883896de445a6cd3501f0" + integrity sha512-8p3v1D+du2jiDvSoNVimHhj7leSfST9YlKsAEO7etBfuqjaBMndo0fmjNLp0JCMld+XIx9L80tooOkyUv1a1PQ== + +"@esbuild/linux-arm64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.16.tgz#ea8c3df172644fa6437f0083c2a38b50f89e5b98" + integrity sha512-N3u6BBbCVY3xeP2D8Db7QY8I+nZ+2AgOopUIqk+5yCoLnsWkcVxD2ay5E9iIdvApFi1Vg1lZiiwaVp8bOpAc4A== + +"@esbuild/linux-arm@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.16.tgz#c1c2e97e67bb7247e6f60e2644de057bfedb8cbb" + integrity sha512-bYaocE1/PTMRmkgSckZ0D0Xn2nox8v2qlk+MVVqm+VECNKDdZvghVZtH41dNtBbwADSvA6qkCHGYeWm9LrNCBw== + +"@esbuild/linux-ia32@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.16.tgz#9a0b0e926926f891a3e7f7c50bb38e3db49c2c9a" + integrity sha512-dxjqLKUW8GqGemoRT9v8IgHk+T4tRm1rn1gUcArsp26W9EkK/27VSjBVUXhEG5NInHZ92JaQ3SSMdTwv/r9a2A== + +"@esbuild/linux-loong64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.16.tgz#c5a50ff5981d457ed45f42c3f06a60086759c79b" + integrity sha512-MdUFggHjRiCCwNE9+1AibewoNq6wf94GLB9Q9aXwl+a75UlRmbRK3h6WJyrSGA6ZstDJgaD2wiTSP7tQNUYxwA== + +"@esbuild/linux-mips64el@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.16.tgz#e85b7e3c25000be2ae373e5208e55e282a9763e0" + integrity sha512-CO3YmO7jYMlGqGoeFeKzdwx/bx8Vtq/SZaMAi+ZLDUnDUdfC7GmGwXzIwDJ70Sg+P9pAemjJyJ1icKJ9R3q/Fg== + +"@esbuild/linux-ppc64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.16.tgz#24a0013bf727830df44fece571172ebe31b5c5e6" + integrity sha512-DSl5Czh5hCy/7azX0Wl9IdzPHX2H8clC6G87tBnZnzUpNgRxPFhfmArbaHoAysu4JfqCqbB/33u/GL9dUgCBAw== + +"@esbuild/linux-riscv64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.16.tgz#b080998d8d0480e8235f1384c585ae505e98a19d" + integrity sha512-sSVVMEXsqf1fQu0j7kkhXMViroixU5XoaJXl1u/u+jbXvvhhCt9YvA/B6VM3aM/77HuRQ94neS5bcisijGnKFQ== + +"@esbuild/linux-s390x@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.16.tgz#5042de05b9b653dfd134f05e1b37b61704c14c42" + integrity sha512-jRqBCre9gZGoCdCN/UWCCMwCMsOg65IpY9Pyj56mKCF5zXy9d60kkNRdDN6YXGjr3rzcC4DXnS/kQVCGcC4yPQ== + +"@esbuild/linux-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.16.tgz#b7c0750f2276c9dcf41f0f2229adca46ef22f698" + integrity sha512-G1+09TopOzo59/55lk5Q0UokghYLyHTKKzD5lXsAOOlGDbieGEFJpJBr3BLDbf7cz89KX04sBeExAR/pL/26sA== + +"@esbuild/netbsd-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.16.tgz#e2a0ee181fbbe834174d26e24ce1b258232bb3eb" + integrity sha512-xwjGJB5wwDEujLaJIrSMRqWkbigALpBNcsF9SqszoNKc+wY4kPTdKrSxiY5ik3IatojePP+WV108MvF6q6np4w== + +"@esbuild/openbsd-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.16.tgz#87a84c1932e00f52ab3380c31facf0e48086ffb9" + integrity sha512-yeERkoxG2nR2oxO5n+Ms7MsCeNk23zrby2GXCqnfCpPp7KNc0vxaaacIxb21wPMfXXRhGBrNP4YLIupUBrWdlg== + +"@esbuild/sunos-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.16.tgz#996bcd2603cd345733c3aa5f52bfd5b8fa7d1d36" + integrity sha512-nHfbEym0IObXPhtX6Va3H5GaKBty2kdhlAhKmyCj9u255ktAj0b1YACUs9j5H88NRn9cJCthD1Ik/k9wn8YKVg== + +"@esbuild/win32-arm64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.16.tgz#404a9411d12533d0f2ce0a85df6ddb32e851ef04" + integrity sha512-pdD+M1ZOFy4hE15ZyPX09fd5g4DqbbL1wXGY90YmleVS6Y5YlraW4BvHjim/X/4yuCpTsAFvsT4Nca2lbyDH/A== + +"@esbuild/win32-ia32@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.16.tgz#bb5655a48f5f87fee870061883411f5149bc5e44" + integrity sha512-IPEMfU9p0c3Vb8PqxaPX6BM9rYwlTZGYOf9u+kMdhoILZkVKEjq6PKZO0lB+isojWwAnAqh4ZxshD96njTXajg== + +"@esbuild/win32-x64@0.16.16": + version "0.16.16" + resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.16.tgz#ee22fed0b2e0c00ce895cdfae9d32ef069a12e04" + integrity sha512-1YYpoJ39WV/2bnShPwgdzJklc+XS0bysN6Tpnt1cWPdeoKOG4RMEY1g7i534QxXX/rPvNx/NLJQTTCeORYzipg== "@eslint/eslintrc@^0.4.3": version "0.4.3" @@ -538,6 +543,11 @@ resolved "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg== +"@isaacs/string-locale-compare@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz#291c227e93fd407a96ecd59879a35809120e432b" + integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -782,18 +792,18 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@jsii/check-node@1.72.0": - version "1.72.0" - resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.72.0.tgz#fde581956fb006489606ed09ef475cf2f05c2f91" - integrity sha512-OmXpp+Ipt6vhZVdVvaNCrGFgQg/FPh3wATz9WeLooMYtNPiaAmIkq29hZS1WzM4CGxJKc7T1i2e8lYPU3vGp0w== +"@jsii/check-node@1.73.0": + version "1.73.0" + resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.73.0.tgz#6f9cff84ac6762a30c642c85d2d56603c299a89d" + integrity sha512-oneDKgjplUw2Ivk78iAb9lCsAasxkuQ6Ii15qzXsw16CPSRCqQlE78lUVV7pr+rxx/vQDWBAa8ycRbuVghC6TQ== dependencies: chalk "^4.1.2" semver "^7.3.8" -"@jsii/spec@1.72.0", "@jsii/spec@^1.72.0": - version "1.72.0" - resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.72.0.tgz#ce9d76ec221ed39b9f602477378bf1b957c63d8f" - integrity sha512-zlKTRU8Pu8gIFTMl7ctj+f0l5YPEjAitUfOnSSNv6rZUY20p/zPjkBBw75Nt/4wfkz4UVagWJKuangxfkpsMuw== +"@jsii/spec@1.73.0", "@jsii/spec@^1.73.0": + version "1.73.0" + resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.73.0.tgz#7ab1d42947b4cb4099f084119657c39409bc7dc8" + integrity sha512-h0BeA6WQfxvYl5BaacmlvB5bAIdhlgf9SInJljxtERn2eYN+VjgMyU/1iv0Ww4Lp71xMGL96bmfXpdlFgRQFEg== dependencies: ajv "^8.11.2" @@ -1489,11 +1499,80 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@npmcli/arborist@^5.0.4", "@npmcli/arborist@^5.6.3": + version "5.6.3" + resolved "https://registry.npmjs.org/@npmcli/arborist/-/arborist-5.6.3.tgz#40810080272e097b4a7a4f56108f4a31638a9874" + integrity sha512-/7hbqEM6YuRjwTcQXkK1+xKslEblY5kFQe0tZ7jKyMlIR6x4iOmhLErIkBBGtTKvYxRKdpcxnFXjCobg3UqmsA== + dependencies: + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/installed-package-contents" "^1.0.7" + "@npmcli/map-workspaces" "^2.0.3" + "@npmcli/metavuln-calculator" "^3.0.1" + "@npmcli/move-file" "^2.0.0" + "@npmcli/name-from-folder" "^1.0.1" + "@npmcli/node-gyp" "^2.0.0" + "@npmcli/package-json" "^2.0.0" + "@npmcli/query" "^1.2.0" + "@npmcli/run-script" "^4.1.3" + bin-links "^3.0.3" + cacache "^16.1.3" + common-ancestor-path "^1.0.1" + hosted-git-info "^5.2.1" + json-parse-even-better-errors "^2.3.1" + json-stringify-nice "^1.1.4" + minimatch "^5.1.0" + mkdirp "^1.0.4" + mkdirp-infer-owner "^2.0.0" + nopt "^6.0.0" + npm-install-checks "^5.0.0" + npm-package-arg "^9.0.0" + npm-pick-manifest "^7.0.2" + npm-registry-fetch "^13.0.0" + npmlog "^6.0.2" + pacote "^13.6.1" + parse-conflict-json "^2.0.1" + proc-log "^2.0.0" + promise-all-reject-late "^1.0.0" + promise-call-limit "^1.0.1" + read-package-json-fast "^2.0.2" + readdir-scoped-modules "^1.1.0" + rimraf "^3.0.2" + semver "^7.3.7" + ssri "^9.0.0" + treeverse "^2.0.0" + walk-up-path "^1.0.0" + "@npmcli/ci-detect@^1.0.0": version "1.4.0" resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz#18478bbaa900c37bfbd8a2006a6262c62e8b0fe1" integrity sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q== +"@npmcli/ci-detect@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-2.0.0.tgz#e63c91bcd4185ac1e85720a34fc48e164ece5b89" + integrity sha512-8yQtQ9ArHh/TzdUDKQwEvwCgpDuhSWTDAbiKMl3854PcT+Dk4UmWaiawuFTLy9n5twzXOBXVflWe+90/ffXQrA== + +"@npmcli/config@^4.1.0": + version "4.2.2" + resolved "https://registry.npmjs.org/@npmcli/config/-/config-4.2.2.tgz#2e3334dda84f48d059309c53d152e66b05ca24b7" + integrity sha512-5GNcLd+0c4bYBnFop53+26CO5GQP0R9YcxlernohpHDWdIgzUg9I0+GEMk3sNHnLntATVU39d283A4OO+W402w== + dependencies: + "@npmcli/map-workspaces" "^2.0.2" + ini "^3.0.0" + mkdirp-infer-owner "^2.0.0" + nopt "^6.0.0" + proc-log "^2.0.0" + read-package-json-fast "^2.0.3" + semver "^7.3.5" + walk-up-path "^1.0.0" + +"@npmcli/disparity-colors@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz#cb518166ee21573b96241a3613fef70acb2a60ba" + integrity sha512-FFXGrIjhvd2qSZ8iS0yDvbI7nbjdyT2VNO7wotosjYZM2p2r8PN3B7Om3M5NO9KqW/OVzfzLB3L0V5Vo5QXC7A== + dependencies: + ansi-styles "^4.3.0" + "@npmcli/fs@^1.0.0": version "1.1.1" resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" @@ -1502,7 +1581,7 @@ "@gar/promisify" "^1.0.1" semver "^7.3.5" -"@npmcli/fs@^2.1.0": +"@npmcli/fs@^2.1.0", "@npmcli/fs@^2.1.1": version "2.1.2" resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz#a9e2541a4a2fec2e69c29b35e6060973da79b865" integrity sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ== @@ -1547,6 +1626,26 @@ npm-bundled "^1.1.1" npm-normalize-package-bin "^1.0.1" +"@npmcli/map-workspaces@^2.0.2", "@npmcli/map-workspaces@^2.0.3": + version "2.0.4" + resolved "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.4.tgz#9e5e8ab655215a262aefabf139782b894e0504fc" + integrity sha512-bMo0aAfwhVwqoVM5UzX1DJnlvVvzDCHae821jv48L1EsrYwfOZChlqWYXEtto/+BkBXetPbEWgau++/brh4oVg== + dependencies: + "@npmcli/name-from-folder" "^1.0.1" + glob "^8.0.1" + minimatch "^5.0.1" + read-package-json-fast "^2.0.3" + +"@npmcli/metavuln-calculator@^3.0.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.1.1.tgz#9359bd72b400f8353f6a28a25c8457b562602622" + integrity sha512-n69ygIaqAedecLeVH3KnO39M6ZHiJ2dEv5A7DGvcqCB8q17BGUgW8QaanIkbWUo2aYGZqJaOORTLAlIvKjNDKA== + dependencies: + cacache "^16.0.0" + json-parse-even-better-errors "^2.3.1" + pacote "^13.0.3" + semver "^7.3.5" + "@npmcli/move-file@^1.0.1": version "1.1.2" resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" @@ -1563,6 +1662,11 @@ mkdirp "^1.0.4" rimraf "^3.0.2" +"@npmcli/name-from-folder@^1.0.1": + version "1.0.1" + resolved "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz#77ecd0a4fcb772ba6fe927e2e2e155fbec2e6b1a" + integrity sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA== + "@npmcli/node-gyp@^1.0.2": version "1.0.3" resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz#a912e637418ffc5f2db375e93b85837691a43a33" @@ -1573,6 +1677,13 @@ resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz#8c20e53e34e9078d18815c1d2dda6f2420d75e35" integrity sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A== +"@npmcli/package-json@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@npmcli/package-json/-/package-json-2.0.0.tgz#3bbcf4677e21055adbe673d9f08c9f9cde942e4a" + integrity sha512-42jnZ6yl16GzjWSH7vtrmWyJDGVa/LXPdpN2rcUWolFjc9ON2N3uz0qdBbQACfmhuJZ2lbKYtmK5qx68ZPLHMA== + dependencies: + json-parse-even-better-errors "^2.3.1" + "@npmcli/promise-spawn@^1.2.0", "@npmcli/promise-spawn@^1.3.2": version "1.3.2" resolved "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz#42d4e56a8e9274fba180dabc0aea6e38f29274f5" @@ -1587,6 +1698,15 @@ dependencies: infer-owner "^1.0.4" +"@npmcli/query@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@npmcli/query/-/query-1.2.0.tgz#46468d583cf013aa92102970700f9555314aabe4" + integrity sha512-uWglsUM3PjBLgTSmZ3/vygeGdvWEIZ3wTUnzGFbprC/RtvQSaT+GAXu1DXmSFj2bD3oOZdcRm1xdzsV2z1YWdw== + dependencies: + npm-package-arg "^9.1.0" + postcss-selector-parser "^6.0.10" + semver "^7.3.7" + "@npmcli/run-script@^1.8.2": version "1.8.6" resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz#18314802a6660b0d4baa4c3afe7f1ad39d8c28b7" @@ -1597,7 +1717,17 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" -"@npmcli/run-script@^4.1.0": +"@npmcli/run-script@^3.0.1": + version "3.0.3" + resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-3.0.3.tgz#66afa6e0c4c3484056195f295fa6c1d1a45ddf58" + integrity sha512-ZXL6qgC5NjwfZJ2nET+ZSLEz/PJgJ/5CU90C2S66dZY4Jw73DasS4ZCXuy/KHWYP0imjJ4VtA+Gebb5BxxKp9Q== + dependencies: + "@npmcli/node-gyp" "^2.0.0" + "@npmcli/promise-spawn" "^3.0.0" + node-gyp "^8.4.1" + read-package-json-fast "^2.0.3" + +"@npmcli/run-script@^4.1.0", "@npmcli/run-script@^4.1.3", "@npmcli/run-script@^4.2.0": version "4.2.1" resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.1.tgz#c07c5c71bc1c70a5f2a06b0d4da976641609b946" integrity sha512-7dqywvVudPSrRCW5nTHpHgeWnbBtz8cFkOuKrecm6ih+oO9ciydhWt6OF7HlqupRRmB8Q/gECVdB9LMfToJbRg== @@ -1920,7 +2050,7 @@ dependencies: "@types/node" "*" -"@types/fs-extra@^9.0.13": +"@types/fs-extra@^9.0.0", "@types/fs-extra@^9.0.13": version "9.0.13" resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz#7594fbae04fe7f1918ce8b3d213f74ff44ac1f45" integrity sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA== @@ -1944,9 +2074,9 @@ "@types/node" "*" "@types/graceful-fs@^4.1.2": - version "4.1.5" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== + version "4.1.6" + resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" + integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== dependencies: "@types/node" "*" @@ -2054,6 +2184,11 @@ resolved "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== +"@types/node@^14.18.31": + version "14.18.35" + resolved "https://registry.npmjs.org/@types/node/-/node-14.18.35.tgz#879c4659cb7b3fe515844f029c75079c941bb65c" + integrity sha512-2ATO8pfhG1kDvw4Lc4C0GXIMSQFFJBCo/R1fSgTwmUlq5oy95LXyjDQinsRVgQY6gp6ghh3H91wk9ES5/5C+Tw== + "@types/node@^14.18.36": version "14.18.36" resolved "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" @@ -2069,6 +2204,13 @@ resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== +"@types/npm@^7.19.0": + version "7.19.0" + resolved "https://registry.npmjs.org/@types/npm/-/npm-7.19.0.tgz#a62382cea8ca8ef8452553e3d5daa68a331cda70" + integrity sha512-K/w+k8SnDjdQoK2fkUl9fHLAiVVmdFgdZ2/iGFuaaQC+wwaNdDQRTFaoCEYYrfCMbuVkhL3Lgqbi+p5d5I1lSg== + dependencies: + "@types/node" "*" + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -2118,6 +2260,13 @@ resolved "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz#bf2e02a3dbd4aecaf95942ecd99b7402e03fad5e" integrity sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA== +"@types/source-map-support@^0.5.6": + version "0.5.6" + resolved "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.6.tgz#aa4a8c98ec73a1f1f30a813573a9b2154a6eb39a" + integrity sha512-b2nJ9YyXmkhGaa2b8VLM0kJ04xxwNyijcq12/kDoomCt43qbHBeK2SLNJ9iJmETaAj+bKUT05PQUu3Q66GvLhQ== + dependencies: + source-map "^0.6.0" + "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" @@ -2187,6 +2336,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^17.0.13": + version "17.0.13" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz#34cced675ca1b1d51fcf4d34c3c6f0fa142a5c76" + integrity sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg== + dependencies: + "@types/yargs-parser" "*" + "@types/yarnpkg__lockfile@^1.1.5": version "1.1.5" resolved "https://registry.npmjs.org/@types/yarnpkg__lockfile/-/yarnpkg__lockfile-1.1.5.tgz#9639020e1fb65120a2f4387db8f1e8b63efdf229" @@ -2207,13 +2363,13 @@ tsutils "^3.21.0" "@typescript-eslint/eslint-plugin@^5": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz#54f8368d080eb384a455f60c2ee044e948a8ce67" - integrity sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ== + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.1.tgz#deee67e399f2cb6b4608c935777110e509d8018c" + integrity sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ== dependencies: - "@typescript-eslint/scope-manager" "5.48.0" - "@typescript-eslint/type-utils" "5.48.0" - "@typescript-eslint/utils" "5.48.0" + "@typescript-eslint/scope-manager" "5.48.1" + "@typescript-eslint/type-utils" "5.48.1" + "@typescript-eslint/utils" "5.48.1" debug "^4.3.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" @@ -2244,13 +2400,13 @@ debug "^4.3.1" "@typescript-eslint/parser@^5": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz#02803355b23884a83e543755349809a50b7ed9ba" - integrity sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg== + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.1.tgz#d0125792dab7e232035434ab8ef0658154db2f10" + integrity sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA== dependencies: - "@typescript-eslint/scope-manager" "5.48.0" - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/typescript-estree" "5.48.0" + "@typescript-eslint/scope-manager" "5.48.1" + "@typescript-eslint/types" "5.48.1" + "@typescript-eslint/typescript-estree" "5.48.1" debug "^4.3.4" "@typescript-eslint/scope-manager@4.33.0": @@ -2261,21 +2417,21 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/scope-manager@5.48.0": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz#607731cb0957fbc52fd754fd79507d1b6659cecf" - integrity sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow== +"@typescript-eslint/scope-manager@5.48.1": + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.1.tgz#39c71e4de639f5fe08b988005beaaf6d79f9d64d" + integrity sha512-S035ueRrbxRMKvSTv9vJKIWgr86BD8s3RqoRZmsSh/s8HhIs90g6UlK8ZabUSjUZQkhVxt7nmZ63VJ9dcZhtDQ== dependencies: - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/visitor-keys" "5.48.0" + "@typescript-eslint/types" "5.48.1" + "@typescript-eslint/visitor-keys" "5.48.1" -"@typescript-eslint/type-utils@5.48.0": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz#40496dccfdc2daa14a565f8be80ad1ae3882d6d6" - integrity sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g== +"@typescript-eslint/type-utils@5.48.1": + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.1.tgz#5d94ac0c269a81a91ad77c03407cea2caf481412" + integrity sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ== dependencies: - "@typescript-eslint/typescript-estree" "5.48.0" - "@typescript-eslint/utils" "5.48.0" + "@typescript-eslint/typescript-estree" "5.48.1" + "@typescript-eslint/utils" "5.48.1" debug "^4.3.4" tsutils "^3.21.0" @@ -2284,10 +2440,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.48.0": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz#d725da8dfcff320aab2ac6f65c97b0df30058449" - integrity sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw== +"@typescript-eslint/types@5.48.1": + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.1.tgz#efd1913a9aaf67caf8a6e6779fd53e14e8587e14" + integrity sha512-xHyDLU6MSuEEdIlzrrAerCGS3T7AA/L8Hggd0RCYBi0w3JMvGYxlLlXHeg50JI9Tfg5MrtsfuNxbS/3zF1/ATg== "@typescript-eslint/typescript-estree@4.33.0", "@typescript-eslint/typescript-estree@^4.33.0": version "4.33.0" @@ -2302,29 +2458,29 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.48.0": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz#a7f04bccb001003405bb5452d43953a382c2fac2" - integrity sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw== +"@typescript-eslint/typescript-estree@5.48.1": + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.1.tgz#9efa8ee2aa471c6ab62e649f6e64d8d121bc2056" + integrity sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA== dependencies: - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/visitor-keys" "5.48.0" + "@typescript-eslint/types" "5.48.1" + "@typescript-eslint/visitor-keys" "5.48.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.48.0": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz#eee926af2733f7156ad8d15e51791e42ce300273" - integrity sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ== +"@typescript-eslint/utils@5.48.1": + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.1.tgz#20f2f4e88e9e2a0961cbebcb47a1f0f7da7ba7f9" + integrity sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA== dependencies: "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.48.0" - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/typescript-estree" "5.48.0" + "@typescript-eslint/scope-manager" "5.48.1" + "@typescript-eslint/types" "5.48.1" + "@typescript-eslint/typescript-estree" "5.48.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" semver "^7.3.7" @@ -2337,12 +2493,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.48.0": - version "5.48.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz#4446d5e7f6cadde7140390c0e284c8702d944904" - integrity sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q== +"@typescript-eslint/visitor-keys@5.48.1": + version "5.48.1" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.1.tgz#79fd4fb9996023ef86849bf6f904f33eb6c8fccb" + integrity sha512-Ns0XBwmfuX7ZknznfXozgnydyR8F6ev/KEGePP4i74uL3ArsKbEhJ7raeKr1JSa997DBDwol/4a0Y+At82c9dA== dependencies: - "@typescript-eslint/types" "5.48.0" + "@typescript-eslint/types" "5.48.1" eslint-visitor-keys "^3.3.0" "@xmldom/xmldom@^0.8.6": @@ -2368,7 +2524,7 @@ abab@^2.0.3, abab@^2.0.5: resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -abbrev@1, abbrev@^1.0.0: +abbrev@1, abbrev@^1.0.0, abbrev@~1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== @@ -2491,7 +2647,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -2567,7 +2723,7 @@ archiver@^5.3.1: tar-stream "^2.2.0" zip-stream "^4.1.0" -archy@^1.0.0: +archy@^1.0.0, archy@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== @@ -2756,9 +2912,9 @@ aws-sdk-mock@5.6.0: traverse "^0.6.6" aws-sdk@^2.1211.0, aws-sdk@^2.596.0, aws-sdk@^2.928.0: - version "2.1287.0" - resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1287.0.tgz#40296aadf34e7550e058f73f3363130d65ffb1c0" - integrity sha512-mtfDstUdFNn8FnBaXs2KAaQ0cgDIiwlqwC2UptUKWWrugjZHAoRacfD/6bnah1Kwhu43F9CDEe5QLHnQtymNkw== + version "2.1292.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1292.0.tgz#bff92d794b8bbb71628c2f7b9d799c34ef2f27b4" + integrity sha512-GqN75aYmaZrirMCJI5CwvYW/bQRyBs59t/tDYBuwb9RMppL8vv9cEwGu3H74yxeoz89LyrbQtoOB8ZgHxNDNmA== dependencies: buffer "4.9.2" events "1.1.1" @@ -2777,9 +2933,9 @@ aws-sign2@~0.7.0: integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + version "1.12.0" + resolved "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== axios@^0.27.2: version "0.27.2" @@ -2872,7 +3028,19 @@ before-after-hook@^2.2.0: resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== -binary-extensions@^2.0.0: +bin-links@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz#3842711ef3db2cd9f16a5f404a996a12db355a6e" + integrity sha512-zKdnMPWEdh4F5INR07/eBrodC7QrF5JKvqskjz/ZZRXg5YSAZIbn8zGhbhUrElzHBZ2fvEQdOU59RHcTG3GiwA== + dependencies: + cmd-shim "^5.0.0" + mkdirp-infer-owner "^2.0.0" + npm-normalize-package-bin "^2.0.0" + read-cmd-shim "^3.0.0" + rimraf "^3.0.0" + write-file-atomic "^4.0.0" + +binary-extensions@^2.0.0, binary-extensions@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== @@ -3034,7 +3202,7 @@ cacache@^15.0.5, cacache@^15.2.0: tar "^6.0.2" unique-filename "^1.1.1" -cacache@^16.0.0, cacache@^16.1.0: +cacache@^16.0.0, cacache@^16.1.0, cacache@^16.1.3: version "16.1.3" resolved "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz#a02b9f34ecfaf9a78c9f4bc16fceb94d5d67a38e" integrity sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ== @@ -3114,9 +3282,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001400: - version "1.0.30001441" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" - integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg== + version "1.0.30001442" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001442.tgz#40337f1cf3be7c637b061e2f78582dc1daec0614" + integrity sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow== case@1.6.3, case@^1.6.3: version "1.6.3" @@ -3128,29 +3296,29 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -cdk-generate-synthetic-examples@^0.1.112: - version "0.1.112" - resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.112.tgz#99bde4de8626e72f8c3b797b80e83e696a8832cb" - integrity sha512-MhZa0hFnfxJQnDDvxYZOG+oTGq5K8hp/OGtSiP90cL7rZbZmVdK/yq6Y1Z3y71gBoqDVPWYNZsCZa+VakeNZ7w== +cdk-generate-synthetic-examples@^0.1.119: + version "0.1.119" + resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.119.tgz#dfbd95ab5b5e05268a27e5835ad54876b220bb4c" + integrity sha512-dRlv1VUGTUegYPxLlshA/MrEEPNuWzG+G81jEEe8Aa4Jtb2oHZfE9f69YbnryiklrAEXocOKeva+RwsPMf9fbQ== dependencies: - "@jsii/spec" "^1.72.0" + "@jsii/spec" "^1.73.0" fs-extra "^10.1.0" - jsii "^1.72.0" - jsii-reflect "^1.72.0" - jsii-rosetta "^1.72.0" + jsii "^1.73.0" + jsii-reflect "^1.73.0" + jsii-rosetta "^1.73.0" yargs "^17.6.2" -cdk8s-plus-24@2.3.13: - version "2.3.13" - resolved "https://registry.npmjs.org/cdk8s-plus-24/-/cdk8s-plus-24-2.3.13.tgz#3400be0e6dfe0e674e58d7ceee3b81530218b184" - integrity sha512-w8FgeJIMIEvSXC5zb6uallid9QcyQbLtKsNld96Z5SNxNtwE6Jv5R6KJpe+cgyplCpaIvTiQJo4thxZ6oGkPLA== +cdk8s-plus-24@2.3.20: + version "2.3.20" + resolved "https://registry.npmjs.org/cdk8s-plus-24/-/cdk8s-plus-24-2.3.20.tgz#528a0df4a432e4d5bd526a96a015fc12dd058e47" + integrity sha512-eUHIKDQzf/Qpv23+7BuU5RJvY3vqKXdYhPutYveAtaLbrkhVmA4JU9aGG5VrqiJFETTm068XOmZBWFOB3V9+0w== dependencies: minimatch "^3.1.2" -cdk8s@^2.6.8: - version "2.6.8" - resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.6.8.tgz#f7f279f4422ea5760558ee716fe916f3ac84d471" - integrity sha512-TLrcdA79rfyd5oN+zHIC1bK+e8fSyfLuZX8uPR+yEp/IKHjqKfKVWOjJhuvCK+t6z4RhkLE7Skd7SMBziy80OA== +cdk8s@^2.6.15: + version "2.6.15" + resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.6.15.tgz#75391eded62ab4df7105b1cba017911a67163572" + integrity sha512-Q46EEpqoQa2AfPqv9gIQkr+w1AYoR9jeyDUZhN58yBm0BIfKkl6j0cN+9mLM+HrHZaGwaMPdS60KL5dwQ9xIxA== dependencies: fast-json-patch "^3.1.1" follow-redirects "^1.15.2" @@ -3231,6 +3399,13 @@ ci-info@^3.2.0: resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f" integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w== +cidr-regex@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/cidr-regex/-/cidr-regex-3.1.1.tgz#ba1972c57c66f61875f18fd7dd487469770b571d" + integrity sha512-RBqYd32aDwbCMFJRL6wHOlDNYJsPNTt8vC82ErHF5vKt8QQzxm1FrkW8s/R5pVrXMf17sba09Uoy91PKiddAsw== + dependencies: + ip-regex "^4.1.0" + cint@^8.2.1: version "8.2.1" resolved "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz#70386b1b48e2773d0d63166a55aff94ef4456a12" @@ -3262,6 +3437,14 @@ cli-color@^2.0.0: memoizee "^0.4.15" timers-ext "^0.1.7" +cli-columns@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/cli-columns/-/cli-columns-4.0.0.tgz#9fe4d65975238d55218c41bd2ed296a7fa555646" + integrity sha512-XW2Vg+w+L9on9wtwKpyzluIPCWXjaBahI7mTcYjx+BVIYD9c3yqcv/yKC7CmdCZat4rq2yiE1UMSJC5ivKfMtQ== + dependencies: + string-width "^4.2.3" + strip-ansi "^6.0.1" + cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -3274,6 +3457,15 @@ cli-spinners@^2.5.0: resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== +cli-table3@^0.6.2: + version "0.6.3" + resolved "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" + integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + cli-table@^0.3.11: version "0.3.11" resolved "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz#ac69cdecbe81dccdba4889b9a18b7da312a9d3ee" @@ -3346,15 +3538,22 @@ cmd-shim@^4.1.0: dependencies: mkdirp-infer-owner "^2.0.0" +cmd-shim@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz#8d0aaa1a6b0708630694c4dbde070ed94c707724" + integrity sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw== + dependencies: + mkdirp-infer-owner "^2.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemaker@1.72.0, codemaker@^1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.72.0.tgz#ceef1aff84cb5d534f5be1226d5fc48103ccb50a" - integrity sha512-U4TM++FGA+vnWHTSMA8juU+C9iXn1TDauMFmn44gz9pKrbLtjGUiMjfC4vX5HachkNQgitRj6bc/g7PA4j0C3Q== +codemaker@1.73.0, codemaker@^1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.73.0.tgz#5b3b280759a31ee259bbcdc50ba9bd46e115b787" + integrity sha512-pgVFCAbR0Yw/qTrV/W8R7cXWJouhONMRf8sNCjmAGJyV3MFaLN4sUPdUkzYUu7LCkuHPh0nvYRlExWzrkhm7vw== dependencies: camelcase "^6.3.0" decamelize "^5.0.1" @@ -3399,7 +3598,7 @@ colors@1.0.3, colors@1.4.0: resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== -columnify@^1.5.4: +columnify@^1.5.4, columnify@^1.6.0: version "1.6.0" resolved "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" integrity sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q== @@ -3424,7 +3623,12 @@ commander@^7.2.0: resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== -commander@^9.1.0, commander@~9.4.0: +commander@^9.1.0: + version "9.5.0" + resolved "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" + integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== + +commander@~9.4.1: version "9.4.1" resolved "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== @@ -3440,6 +3644,11 @@ comment-json@4.2.2: has-own-prop "^2.0.0" repeat-string "^1.6.1" +common-ancestor-path@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz#4f7d2d1394d91b7abdf51871c62f71eadb0182a7" + integrity sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -3514,9 +3723,9 @@ console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control- integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== constructs@^10.0.0: - version "10.1.209" - resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.209.tgz#0e2a525fdc8471f8553d20e2182c0ee7dc0ed25f" - integrity sha512-BLvvM9bsKg4AGgeHWzT2elFh4UCFgmF4JyRjFcUMmHPJzgmErSwzUen/jVP4kI28nahakJXouiff6KZt0ey+3Q== + version "10.1.216" + resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.216.tgz#5e4268d27a4b8d0e510990e916c62f758c85c05a" + integrity sha512-Nx/Pzuyy46Bc5LFu3XPSmTKNcjN4ChQ/R3syOb7bJLfQ5VhJn+o0aCKBVwnbuF1av0YCG6IaDz8fdtWhjefJjA== conventional-changelog-angular@^5.0.12: version "5.0.13" @@ -3782,6 +3991,11 @@ crypto-random-string@^2.0.0: resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + cssom@^0.4.4: version "0.4.4" resolved "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" @@ -4303,26 +4517,32 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.20.4: - version "1.20.5" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.5.tgz#e6dc99177be37cacda5988e692c3fa8b218e95d2" - integrity sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ== + version "1.21.1" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz#e6105a099967c08377830a0c9cb589d570dd86c6" + integrity sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg== dependencies: + available-typed-arrays "^1.0.5" call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" function-bind "^1.1.1" function.prototype.name "^1.1.5" get-intrinsic "^1.1.3" get-symbol-description "^1.0.0" + globalthis "^1.0.3" gopd "^1.0.1" has "^1.0.3" has-property-descriptors "^1.0.0" + has-proto "^1.0.1" has-symbols "^1.0.3" - internal-slot "^1.0.3" + internal-slot "^1.0.4" + is-array-buffer "^3.0.1" is-callable "^1.2.7" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" + is-typed-array "^1.1.10" is-weakref "^1.0.2" object-inspect "^1.12.2" object-keys "^1.1.1" @@ -4331,13 +4551,24 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: safe-regex-test "^1.0.0" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" + typed-array-length "^1.0.4" unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + es-shim-unscopables@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" @@ -4395,33 +4626,33 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild@^0.16.13: - version "0.16.13" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.16.13.tgz#83cd347c28221268bbfa0425db532d7d05f85b48" - integrity sha512-oYwFdSEIoKM1oYzyem1osgKJAvg5447XF+05ava21fOtilyb2HeQQh26/74K4WeAk5dZmj/Mx10zUqUnI14jhA== +esbuild@^0.16.16: + version "0.16.16" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.16.16.tgz#e8a27820a30cc1449066f9bbe8916b145dbc9046" + integrity sha512-24JyKq10KXM5EBIgPotYIJ2fInNWVVqflv3gicIyQqfmUqi4HvDW1VR790cBgLJHCl96Syy7lhoz7tLFcmuRmg== optionalDependencies: - "@esbuild/android-arm" "0.16.13" - "@esbuild/android-arm64" "0.16.13" - "@esbuild/android-x64" "0.16.13" - "@esbuild/darwin-arm64" "0.16.13" - "@esbuild/darwin-x64" "0.16.13" - "@esbuild/freebsd-arm64" "0.16.13" - "@esbuild/freebsd-x64" "0.16.13" - "@esbuild/linux-arm" "0.16.13" - "@esbuild/linux-arm64" "0.16.13" - "@esbuild/linux-ia32" "0.16.13" - "@esbuild/linux-loong64" "0.16.13" - "@esbuild/linux-mips64el" "0.16.13" - "@esbuild/linux-ppc64" "0.16.13" - "@esbuild/linux-riscv64" "0.16.13" - "@esbuild/linux-s390x" "0.16.13" - "@esbuild/linux-x64" "0.16.13" - "@esbuild/netbsd-x64" "0.16.13" - "@esbuild/openbsd-x64" "0.16.13" - "@esbuild/sunos-x64" "0.16.13" - "@esbuild/win32-arm64" "0.16.13" - "@esbuild/win32-ia32" "0.16.13" - "@esbuild/win32-x64" "0.16.13" + "@esbuild/android-arm" "0.16.16" + "@esbuild/android-arm64" "0.16.16" + "@esbuild/android-x64" "0.16.16" + "@esbuild/darwin-arm64" "0.16.16" + "@esbuild/darwin-x64" "0.16.16" + "@esbuild/freebsd-arm64" "0.16.16" + "@esbuild/freebsd-x64" "0.16.16" + "@esbuild/linux-arm" "0.16.16" + "@esbuild/linux-arm64" "0.16.16" + "@esbuild/linux-ia32" "0.16.16" + "@esbuild/linux-loong64" "0.16.16" + "@esbuild/linux-mips64el" "0.16.16" + "@esbuild/linux-ppc64" "0.16.16" + "@esbuild/linux-riscv64" "0.16.16" + "@esbuild/linux-s390x" "0.16.16" + "@esbuild/linux-x64" "0.16.16" + "@esbuild/netbsd-x64" "0.16.16" + "@esbuild/openbsd-x64" "0.16.16" + "@esbuild/sunos-x64" "0.16.16" + "@esbuild/win32-arm64" "0.16.16" + "@esbuild/win32-ia32" "0.16.16" + "@esbuild/win32-x64" "0.16.16" escalade@^3.1.1: version "3.1.1" @@ -4554,11 +4785,6 @@ eslint-plugin-promise@^4.3.1: resolved "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz#61485df2a359e03149fdafc0a68b0e030ad2ac45" integrity sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ== -eslint-plugin-rulesdir@0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/eslint-plugin-rulesdir/-/eslint-plugin-rulesdir-0.2.1.tgz#e246bb9657e68eb0a30680c60775f40aa829ec0b" - integrity sha512-t7rQvEyfE4JZJu6dPl4/uVr6Fr0fxopBhzVbtq3isfOHMKdlIe9xW/5CtIaWZI0E1U+wzAk0lEnZC8laCD5YLA== - eslint-plugin-standard@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz#0c3bf3a67e853f8bbbc580fb4945fbf16f41b7c5" @@ -4874,6 +5100,11 @@ fast-memoize@^2.5.2: resolved "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz#79e3bb6a4ec867ea40ba0e7146816f6cdce9b57e" integrity sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw== +fastest-levenshtein@^1.0.12: + version "1.0.16" + resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== + fastq@^1.6.0: version "1.15.0" resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" @@ -5408,6 +5639,13 @@ globals@^13.19.0, globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@^11.0.2, globby@^11.0.3, globby@^11.0.4, globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -5525,6 +5763,11 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" @@ -5579,7 +5822,7 @@ hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: dependencies: lru-cache "^6.0.0" -hosted-git-info@^5.0.0: +hosted-git-info@^5.0.0, hosted-git-info@^5.2.1: version "5.2.1" resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz#0ba1c97178ef91f3ab30842ae63d6a272341156f" integrity sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw== @@ -5704,7 +5947,7 @@ ignore@^4.0.6: resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.1, ignore@^5.1.8, ignore@^5.2.0, ignore@^5.2.4, ignore@~5.2.0: +ignore@^5.1.1, ignore@^5.1.8, ignore@^5.2.0, ignore@^5.2.4, ignore@~5.2.4: version "5.2.4" resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -5778,7 +6021,7 @@ ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -ini@~3.0.0: +ini@^3.0.0, ini@~3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/ini/-/ini-3.0.1.tgz#c76ec81007875bc44d544ff7a11a55d12294102d" integrity sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ== @@ -5796,6 +6039,19 @@ init-package-json@^2.0.2: validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" +init-package-json@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.2.tgz#f5bc9bac93f2bdc005778bc2271be642fecfcd69" + integrity sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A== + dependencies: + npm-package-arg "^9.0.1" + promzard "^0.3.0" + read "^1.0.7" + read-package-json "^5.0.0" + semver "^7.3.5" + validate-npm-package-license "^3.0.4" + validate-npm-package-name "^4.0.0" + inquirer@^7.3.3: version "7.3.3" resolved "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" @@ -5815,7 +6071,7 @@ inquirer@^7.3.3: strip-ansi "^6.0.0" through "^2.3.6" -internal-slot@^1.0.3: +internal-slot@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz#8551e7baf74a7a6ba5f749cfb16aa60722f0d6f3" integrity sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ== @@ -5829,6 +6085,11 @@ interpret@^1.0.0: resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== +ip-regex@^4.1.0: + version "4.3.0" + resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" + integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== + ip@^1.1.5: version "1.1.8" resolved "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48" @@ -5847,6 +6108,15 @@ is-arguments@^1.0.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-array-buffer@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz#deb1db4fcae48308d54ef2442706c0393997052a" + integrity sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -5891,6 +6161,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-cidr@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/is-cidr/-/is-cidr-4.0.2.tgz#94c7585e4c6c77ceabf920f8cde51b8c0fda8814" + integrity sha512-z4a1ENUajDbEl/Q6/pVBpTR1nBjjEE1X7qb7bmWYanNnPoKAvUCPFKeXV6Fe4mgTkWKBqiHIcwsI3SndiO5FeA== + dependencies: + cidr-regex "^3.1.1" + is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" @@ -6089,7 +6366,7 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.10, is-typed-array@^1.1.3: +is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: version "1.1.10" resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== @@ -6448,6 +6725,16 @@ jest-junit@^13, jest-junit@^13.2.0: uuid "^8.3.2" xml "^1.0.1" +jest-junit@^14.0.0: + version "14.0.1" + resolved "https://registry.npmjs.org/jest-junit/-/jest-junit-14.0.1.tgz#5b357d6f5d333459585d628a24cd48b5bbc92ba2" + integrity sha512-h7/wwzPbllgpQhhVcRzRC76/cc89GlazThoV1fDxcALkf26IIlRsu/AcTG64f4nR2WPE3Cbd+i/sVf+NCUHrWQ== + dependencies: + mkdirp "^1.0.4" + strip-ansi "^6.0.1" + uuid "^8.3.2" + xml "^1.0.1" + jest-leak-detector@^27.5.1: version "27.5.1" resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" @@ -6756,73 +7043,73 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.72.0.tgz#a8689bba2886451ff1ad5da7e7383c60bc99cf3d" - integrity sha512-+rGhNuX2+pEXrGco6R36tgqtr7eg2ysLyILpCK6Rv4seiWZ8EUge/6Ifk6KzwgHmQ/v0Mk9Q2lmu8W22zWJNtQ== +jsii-diff@1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.73.0.tgz#378432f9b2b4c87790d1a530bf60596b8a712aee" + integrity sha512-pbMxeP1wFJwpA9Kki+IoFzVz/I81dHIW0yXyKOwTX7SrmoJ8LRlGJDb3Ks5H2MDdf2YL/6QVl0sgU6sC9/Ssvw== dependencies: - "@jsii/check-node" "1.72.0" - "@jsii/spec" "^1.72.0" + "@jsii/check-node" "1.73.0" + "@jsii/spec" "^1.73.0" fs-extra "^10.1.0" - jsii-reflect "^1.72.0" + jsii-reflect "^1.73.0" log4js "^6.7.1" yargs "^16.2.0" -jsii-pacmak@1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.72.0.tgz#3a981463d9fb5de0a3adf5dd297f32b1f251d523" - integrity sha512-yOrWXmtDA0CVZ21396pN0J9i9/Vh2F6EhKP9ZE/6N0G50gpTaoXDsAF4tIGe1XUMgtUcOLZUuOnMrpFk5l690A== +jsii-pacmak@1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.73.0.tgz#d31cdcfa5f9021f1b0a77c688201b826d2000090" + integrity sha512-zz3z+AoKXciKxBcmFt4PHPQPhbkjRUgN0hkrC6XhqugbpGprICtLNimU4qAQywHA+T0024TX8fnCCuymQ1sJPg== dependencies: - "@jsii/check-node" "1.72.0" - "@jsii/spec" "^1.72.0" + "@jsii/check-node" "1.73.0" + "@jsii/spec" "^1.73.0" clone "^2.1.2" - codemaker "^1.72.0" + codemaker "^1.73.0" commonmark "^0.30.0" escape-string-regexp "^4.0.0" fs-extra "^10.1.0" - jsii-reflect "^1.72.0" - jsii-rosetta "^1.72.0" + jsii-reflect "^1.73.0" + jsii-rosetta "^1.73.0" semver "^7.3.8" spdx-license-list "^6.6.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@1.72.0, jsii-reflect@^1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.72.0.tgz#33ac2529f81ff8482c01770fd66cbd31822b86b6" - integrity sha512-gEsL1QO8EY3OAjCkVt7Vnm0LeflTTXJkEYRCHdATjdXLMP3laSUWHcNuE+6KNBsVUMJr2zJgVQyi7moqRSonzw== +jsii-reflect@1.73.0, jsii-reflect@^1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.73.0.tgz#df6f57d6e8065aa836b6340465f08cfd7d388253" + integrity sha512-RNnejItM5DUvTpMNBhL095Yt87a6mLWTse9rYZmR+XglJ8WdyNW8mmDftz8gq58TKr5mDVUtq5vpRApCEm0Viw== dependencies: - "@jsii/check-node" "1.72.0" - "@jsii/spec" "^1.72.0" + "@jsii/check-node" "1.73.0" + "@jsii/spec" "^1.73.0" chalk "^4" fs-extra "^10.1.0" - oo-ascii-tree "^1.72.0" + oo-ascii-tree "^1.73.0" yargs "^16.2.0" -jsii-rosetta@1.72.0, jsii-rosetta@^1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.72.0.tgz#4866b0149bcd3a7c333984c31fee835e7f3589d5" - integrity sha512-4B9jCfWTPU9s1FsDv7aq7C1kw/eS4WaC7uHujPr+UmALpkfRNu82paylZ5zG1vaUqcBLoQHLydvMRlUzc9xeZw== +jsii-rosetta@1.73.0, jsii-rosetta@^1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.73.0.tgz#7e281e77a2bbbd3b9170aff4355eaf8a0209f3e1" + integrity sha512-UrXBaM/7jJldrlDN2aV/vaIurIZJM4ikJtcE/ugSoAuJUW42Hpi0Qd5k9MiSaE/k+KNxRpihS+skRa2TETT3Cg== dependencies: - "@jsii/check-node" "1.72.0" - "@jsii/spec" "1.72.0" + "@jsii/check-node" "1.73.0" + "@jsii/spec" "1.73.0" "@xmldom/xmldom" "^0.8.6" commonmark "^0.30.0" fast-glob "^3.2.12" - jsii "1.72.0" + jsii "1.73.0" semver "^7.3.8" semver-intersect "^1.4.0" typescript "~3.9.10" workerpool "^6.3.1" yargs "^16.2.0" -jsii@1.72.0, jsii@^1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/jsii/-/jsii-1.72.0.tgz#fbed64c9cec3461a47dc9bc16a97df9fae82694a" - integrity sha512-dwMHlO5SXuwAhchGg8emAuKjQRKGEiuR+GV5SxdhzhylxbPUexSBnsxGYqVIHaXwmXBIH3cOfoiqilQ5Xm2pMg== +jsii@1.73.0, jsii@^1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/jsii/-/jsii-1.73.0.tgz#b341845061f145a550a8052ecc7769b1c9ed8d95" + integrity sha512-6GLXJv+XDPNPw4JRAMr6NicWgLorFcKmAZB6x+gqCnrkA6FqZlgDPohFdcqAkxE5Px9K3oAFIsnEH/xV3HuGrg== dependencies: - "@jsii/check-node" "1.72.0" - "@jsii/spec" "^1.72.0" + "@jsii/check-node" "1.73.0" + "@jsii/spec" "^1.73.0" case "^1.6.3" chalk "^4" fast-deep-equal "^3.1.3" @@ -6886,12 +7173,17 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json-stringify-nice@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz#2c937962b80181d3f317dd39aa323e14f5a60a67" + integrity sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw== + json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@2.x, json5@^2.2.1, json5@^2.2.2: +json5@2.x, json5@^2.2.2: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -6903,10 +7195,10 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -jsonc-parser@~3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz#73b8f0e5c940b83d03476bc2e51a20ef0932615d" - integrity sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg== +jsonc-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== jsonfile@^4.0.0: version "4.0.0" @@ -6959,6 +7251,16 @@ jszip@^3.10.1: readable-stream "~2.3.6" setimmediate "^1.0.5" +just-diff-apply@^5.2.0: + version "5.5.0" + resolved "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.5.0.tgz#771c2ca9fa69f3d2b54e7c3f5c1dfcbcc47f9f0f" + integrity sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw== + +just-diff@^5.0.1: + version "5.2.0" + resolved "https://registry.npmjs.org/just-diff/-/just-diff-5.2.0.tgz#60dca55891cf24cd4a094e33504660692348a241" + integrity sha512-6ufhP9SHjb7jibNFrNxyFZ6od3g+An6Ai9mhGRvcYe8UJlH0prseN64M+6ZBBUoKYHZsitDP42gAJ8+eVWr3lw== + just-extend@^4.0.2: version "4.2.1" resolved "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" @@ -7075,6 +7377,16 @@ libnpmaccess@^4.0.1: npm-package-arg "^8.1.2" npm-registry-fetch "^11.0.0" +libnpmaccess@^6.0.2: + version "6.0.4" + resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-6.0.4.tgz#2dd158bd8a071817e2207d3b201d37cf1ad6ae6b" + integrity sha512-qZ3wcfIyUoW0+qSFkMBovcTrSGJ3ZeyvpR7d5N9pEYv/kXs8sHP2wiqEIXBKLFrZlmM0kR0RJD7mtfLngtlLag== + dependencies: + aproba "^2.0.0" + minipass "^3.1.1" + npm-package-arg "^9.0.1" + npm-registry-fetch "^13.0.0" + libnpmconfig@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz#c0c2f793a74e67d4825e5039e7a02a0044dfcbc0" @@ -7084,6 +7396,72 @@ libnpmconfig@^1.2.1: find-up "^3.0.0" ini "^1.3.5" +libnpmdiff@^4.0.2: + version "4.0.5" + resolved "https://registry.npmjs.org/libnpmdiff/-/libnpmdiff-4.0.5.tgz#ffaf93fa9440ea759444b8830fdb5c661b09a7c0" + integrity sha512-9fICQIzmH892UwHHPmb+Seup50UIBWcMIK2FdxvlXm9b4kc1nSH0b/BuY1mORJQtB6ydPMnn+BLzOTmd/SKJmw== + dependencies: + "@npmcli/disparity-colors" "^2.0.0" + "@npmcli/installed-package-contents" "^1.0.7" + binary-extensions "^2.2.0" + diff "^5.1.0" + minimatch "^5.0.1" + npm-package-arg "^9.0.1" + pacote "^13.6.1" + tar "^6.1.0" + +libnpmexec@^4.0.2: + version "4.0.14" + resolved "https://registry.npmjs.org/libnpmexec/-/libnpmexec-4.0.14.tgz#9ad44232434b374e477eb2c2e4548baaf698f773" + integrity sha512-dwmzv2K29SdoAHBOa7QR6CfQbFG/PiZDRF6HZrlI6C4DLt2hNgOHTFaUGOpqE2C+YGu0ZwYTDywxRe0eOnf0ZA== + dependencies: + "@npmcli/arborist" "^5.6.3" + "@npmcli/ci-detect" "^2.0.0" + "@npmcli/fs" "^2.1.1" + "@npmcli/run-script" "^4.2.0" + chalk "^4.1.0" + mkdirp-infer-owner "^2.0.0" + npm-package-arg "^9.0.1" + npmlog "^6.0.2" + pacote "^13.6.1" + proc-log "^2.0.0" + read "^1.0.7" + read-package-json-fast "^2.0.2" + semver "^7.3.7" + walk-up-path "^1.0.0" + +libnpmfund@^3.0.1: + version "3.0.5" + resolved "https://registry.npmjs.org/libnpmfund/-/libnpmfund-3.0.5.tgz#817f9e2120889beb483d9ba8eda142bb84293e4e" + integrity sha512-KdeRoG/dem8H3PcEU2/0SKi3ip7AWwczgS72y/3PE+PBrz/s/G52FNIA9jeLnBirkLC0sOyQHfeM3b7e24ZM+g== + dependencies: + "@npmcli/arborist" "^5.6.3" + +libnpmhook@^8.0.2: + version "8.0.4" + resolved "https://registry.npmjs.org/libnpmhook/-/libnpmhook-8.0.4.tgz#6c58e5fe763ff5d600ae9c20457ea9a69d1f7d87" + integrity sha512-nuD6e+Nx0OprjEi0wOeqASMl6QIH235th/Du2/8upK3evByFhzIgdfOeP1OhstavW4xtsl0hk5Vw4fAWWuSUgA== + dependencies: + aproba "^2.0.0" + npm-registry-fetch "^13.0.0" + +libnpmorg@^4.0.2: + version "4.0.4" + resolved "https://registry.npmjs.org/libnpmorg/-/libnpmorg-4.0.4.tgz#2a01d49372cf0df90d79a61e69bddaf2ed704311" + integrity sha512-1bTpD7iub1rDCsgiBguhJhiDufLQuc8DEti20euqsXz9O0ncXVpCYqf2SMmHR4GEdmAvAj2r7FMiyA9zGdaTpA== + dependencies: + aproba "^2.0.0" + npm-registry-fetch "^13.0.0" + +libnpmpack@^4.0.2: + version "4.1.3" + resolved "https://registry.npmjs.org/libnpmpack/-/libnpmpack-4.1.3.tgz#025cfe39829acd8260662bf259e3a9331fc1e4b2" + integrity sha512-rYP4X++ME3ZiFO+2iN3YnXJ4LB4Gsd0z5cgszWJZxaEpDN4lRIXirSyynGNsN/hn4taqnlxD+3DPlFDShvRM8w== + dependencies: + "@npmcli/run-script" "^4.1.3" + npm-package-arg "^9.0.1" + pacote "^13.6.1" + libnpmpublish@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-4.0.2.tgz#be77e8bf5956131bcb45e3caa6b96a842dec0794" @@ -7095,6 +7473,43 @@ libnpmpublish@^4.0.0: semver "^7.1.3" ssri "^8.0.1" +libnpmpublish@^6.0.2: + version "6.0.5" + resolved "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-6.0.5.tgz#5a894f3de2e267d62f86be2a508e362599b5a4b1" + integrity sha512-LUR08JKSviZiqrYTDfywvtnsnxr+tOvBU0BF8H+9frt7HMvc6Qn6F8Ubm72g5hDTHbq8qupKfDvDAln2TVPvFg== + dependencies: + normalize-package-data "^4.0.0" + npm-package-arg "^9.0.1" + npm-registry-fetch "^13.0.0" + semver "^7.3.7" + ssri "^9.0.0" + +libnpmsearch@^5.0.2: + version "5.0.4" + resolved "https://registry.npmjs.org/libnpmsearch/-/libnpmsearch-5.0.4.tgz#b32aa2b23051c00cdcc0912274d0d416e6655d81" + integrity sha512-XHDmsvpN5+pufvGnfLRqpy218gcGGbbbXR6wPrDJyd1em6agKdYByzU5ccskDHH9iVm2UeLydpDsW1ksYuU0cg== + dependencies: + npm-registry-fetch "^13.0.0" + +libnpmteam@^4.0.2: + version "4.0.4" + resolved "https://registry.npmjs.org/libnpmteam/-/libnpmteam-4.0.4.tgz#ac26068808d93b1051d926457db14e4b3ff669ef" + integrity sha512-rzKSwi6MLzwwevbM/vl+BBQTErgn24tCfgPUdzBlszrw3j5necOu7WnTzgvZMDv6maGUwec6Ut1rxszOgH0l+Q== + dependencies: + aproba "^2.0.0" + npm-registry-fetch "^13.0.0" + +libnpmversion@^3.0.1: + version "3.0.7" + resolved "https://registry.npmjs.org/libnpmversion/-/libnpmversion-3.0.7.tgz#e4c6c07ee28cf351ce1e2293a5ac9922b09ea94d" + integrity sha512-O0L4eNMUIMQ+effi1HsZPKp2N6wecwqGqB8PvkvmLPWN7EsdabdzAVG48nv0p/OjlbIai5KQg/L+qMMfCA4ZjA== + dependencies: + "@npmcli/git" "^3.0.0" + "@npmcli/run-script" "^4.1.3" + json-parse-even-better-errors "^2.3.1" + proc-log "^2.0.0" + semver "^7.3.7" + license-checker@^25.0.1: version "25.0.1" resolved "https://registry.npmjs.org/license-checker/-/license-checker-25.0.1.tgz#4d14504478a5240a857bb3c21cd0491a00d761fa" @@ -7368,7 +7783,7 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6: +make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.5: version "10.2.1" resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz#f5e3835c5e9817b617f2770870d9492d28678164" integrity sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w== @@ -7411,7 +7826,7 @@ make-fetch-happen@^8.0.9: socks-proxy-agent "^5.0.0" ssri "^8.0.0" -make-fetch-happen@^9.0.1: +make-fetch-happen@^9.0.1, make-fetch-happen@^9.1.0: version "9.1.0" resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== @@ -7469,31 +7884,25 @@ markdown-it@13.0.1, markdown-it@^12.3.2: mdurl "^1.0.1" uc.micro "^1.0.5" -markdownlint-cli@^0.32.2: - version "0.32.2" - resolved "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.32.2.tgz#b7b5c5808039aef4022aef603efaa607caf8e0de" - integrity sha512-xmJT1rGueUgT4yGNwk6D0oqQr90UJ7nMyakXtqjgswAkEhYYqjHew9RY8wDbOmh2R270IWjuKSeZzHDEGPAUkQ== +markdownlint-cli@^0.33.0: + version "0.33.0" + resolved "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.33.0.tgz#703af1234c32c309ab52fcd0e8bc797a34e2b096" + integrity sha512-zMK1oHpjYkhjO+94+ngARiBBrRDEUMzooDHBAHtmEIJ9oYddd9l3chCReY2mPlecwH7gflQp1ApilTo+o0zopQ== dependencies: - commander "~9.4.0" + commander "~9.4.1" get-stdin "~9.0.0" glob "~8.0.3" - ignore "~5.2.0" + ignore "~5.2.4" js-yaml "^4.1.0" - jsonc-parser "~3.1.0" - markdownlint "~0.26.2" - markdownlint-rule-helpers "~0.17.2" - minimatch "~5.1.0" + jsonc-parser "~3.2.0" + markdownlint "~0.27.0" + minimatch "~5.1.2" run-con "~1.2.11" -markdownlint-rule-helpers@~0.17.2: - version "0.17.2" - resolved "https://registry.npmjs.org/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.17.2.tgz#64d6e8c66e497e631b0e40cf1cef7ca622a0b654" - integrity sha512-XaeoW2NYSlWxMCZM2B3H7YTG6nlaLfkEZWMBhr4hSPlq9MuY2sy83+Xr89jXOqZMZYjvi5nBCGoFh7hHoPKZmA== - -markdownlint@~0.26.2: - version "0.26.2" - resolved "https://registry.npmjs.org/markdownlint/-/markdownlint-0.26.2.tgz#11d3d03e7f0dd3c2e239753ee8fd064a861d9237" - integrity sha512-2Am42YX2Ex5SQhRq35HxYWDfz1NLEOZWWN25nqd2h3AHRKsGRE+Qg1gt1++exW792eXTrR4jCNHfShfWk9Nz8w== +markdownlint@~0.27.0: + version "0.27.0" + resolved "https://registry.npmjs.org/markdownlint/-/markdownlint-0.27.0.tgz#9dabf7710a4999e2835e3c68317f1acd0bc89049" + integrity sha512-HtfVr/hzJJmE0C198F99JLaeada+646B5SaG2pVoEakLFI6iRGsvMqrnnrflq8hm1zQgwskEgqSnhDW11JBp0w== dependencies: markdown-it "13.0.1" @@ -7597,7 +8006,7 @@ min-indent@^1.0.0: resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@>=3.1, minimatch@^5.0.1, minimatch@^5.1.0, minimatch@~5.1.0: +minimatch@>=3.1, minimatch@^5.0.1, minimatch@^5.1.0, minimatch@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== @@ -7790,7 +8199,7 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0, ms@^2.1.1: +ms@^2.0.0, ms@^2.1.1, ms@^2.1.2: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -7873,10 +8282,10 @@ nise@^5.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@^13.2.9: - version "13.2.9" - resolved "https://registry.npmjs.org/nock/-/nock-13.2.9.tgz#4faf6c28175d36044da4cfa68e33e5a15086ad4c" - integrity sha512-1+XfJNYF1cjGB+TKMWi29eZ0b82QOvQs2YoLNzbpWGqFMtRQHTa57osqdGj4FrFPgkO4D4AZinzUJR9VvW3QUA== +nock@^13.3.0: + version "13.3.0" + resolved "https://registry.npmjs.org/nock/-/nock-13.3.0.tgz#b13069c1a03f1ad63120f994b04bfd2556925768" + integrity sha512-HHqYQ6mBeiMc+N038w8LkMpDCRquCHWeNmN3v6645P3NhN2+qXOBqvPqo7Rt1VyCMzKhJ733wZqw5B7cQVFNPg== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -7923,6 +8332,22 @@ node-gyp@^7.1.0: tar "^6.0.2" which "^2.0.2" +node-gyp@^8.4.1: + version "8.4.1" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz#3d49308fc31f768180957d6b5746845fbd429937" + integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== + dependencies: + env-paths "^2.2.0" + glob "^7.1.4" + graceful-fs "^4.2.6" + make-fetch-happen "^9.1.0" + nopt "^5.0.0" + npmlog "^6.0.0" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.2" + which "^2.0.2" + node-gyp@^9.0.0: version "9.3.1" resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-9.3.1.tgz#1e19f5f290afcc9c46973d68700cbd21a96192e4" @@ -8030,6 +8455,13 @@ normalize-url@^6.1.0: resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== +npm-audit-report@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-3.0.0.tgz#1bf3e531208b5f77347c8d00c3d9badf5be30cd6" + integrity sha512-tWQzfbwz1sc4244Bx2BVELw0EmZlCsCF0X93RDcmmwhonCsPMoEviYsi+32R+mdRvOWXolPce9zo64n2xgPESw== + dependencies: + chalk "^4.0.0" + npm-bundled@^1.1.1, npm-bundled@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" @@ -8126,7 +8558,7 @@ npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-pack semver "^7.3.4" validate-npm-package-name "^3.0.0" -npm-package-arg@^9.0.0, npm-package-arg@^9.0.1: +npm-package-arg@^9.0.0, npm-package-arg@^9.0.1, npm-package-arg@^9.0.2, npm-package-arg@^9.1.0: version "9.1.2" resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz#fc8acecb00235f42270dda446f36926ddd9ac2bc" integrity sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg== @@ -8166,7 +8598,7 @@ npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1: npm-package-arg "^8.1.2" semver "^7.3.4" -npm-pick-manifest@^7.0.0: +npm-pick-manifest@^7.0.0, npm-pick-manifest@^7.0.1, npm-pick-manifest@^7.0.2: version "7.0.2" resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz#1d372b4e7ea7c6712316c0e99388a73ed3496e84" integrity sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw== @@ -8176,6 +8608,14 @@ npm-pick-manifest@^7.0.0: npm-package-arg "^9.0.0" semver "^7.3.5" +npm-profile@^6.0.3: + version "6.2.1" + resolved "https://registry.npmjs.org/npm-profile/-/npm-profile-6.2.1.tgz#975c31ec75a6ae029ab5b8820ffdcbae3a1e3d5e" + integrity sha512-Tlu13duByHyDd4Xy0PgroxzxnBYWbGGL5aZifNp8cx2DxUrHSoETXtPKg38aRPsBWMRfDtvcvVfJNasj7oImQQ== + dependencies: + npm-registry-fetch "^13.0.1" + proc-log "^2.0.0" + npm-registry-fetch@^11.0.0: version "11.0.0" resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz#68c1bb810c46542760d62a6a965f85a702d43a76" @@ -8188,7 +8628,7 @@ npm-registry-fetch@^11.0.0: minizlib "^2.0.0" npm-package-arg "^8.0.0" -npm-registry-fetch@^13.0.1: +npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1, npm-registry-fetch@^13.1.1: version "13.3.1" resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz#bb078b5fa6c52774116ae501ba1af2a33166af7e" integrity sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw== @@ -8222,6 +8662,87 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +npm-user-validate@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.1.tgz#31428fc5475fe8416023f178c0ab47935ad8c561" + integrity sha512-uQwcd/tY+h1jnEaze6cdX/LrhWhoBxfSknxentoqmIuStxUExxjWd3ULMLFPiFUrZKbOVMowH6Jq2FRWfmhcEw== + +npm@^8.11.0: + version "8.11.0" + resolved "https://registry.npmjs.org/npm/-/npm-8.11.0.tgz#224fbca389252e43dd2a277249df3320a7f91189" + integrity sha512-4qmtwHa28J4SPmwCNoQI07KIF/ljmBhhuqG+xNXsIIRpwdKB5OXkMIGfH6KlThR6kzusxlkgR7t1haFDB88dcQ== + dependencies: + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/arborist" "^5.0.4" + "@npmcli/ci-detect" "^2.0.0" + "@npmcli/config" "^4.1.0" + "@npmcli/fs" "^2.1.0" + "@npmcli/map-workspaces" "^2.0.3" + "@npmcli/package-json" "^2.0.0" + "@npmcli/run-script" "^3.0.1" + abbrev "~1.1.1" + archy "~1.0.0" + cacache "^16.1.0" + chalk "^4.1.2" + chownr "^2.0.0" + cli-columns "^4.0.0" + cli-table3 "^0.6.2" + columnify "^1.6.0" + fastest-levenshtein "^1.0.12" + glob "^8.0.1" + graceful-fs "^4.2.10" + hosted-git-info "^5.0.0" + ini "^3.0.0" + init-package-json "^3.0.2" + is-cidr "^4.0.2" + json-parse-even-better-errors "^2.3.1" + libnpmaccess "^6.0.2" + libnpmdiff "^4.0.2" + libnpmexec "^4.0.2" + libnpmfund "^3.0.1" + libnpmhook "^8.0.2" + libnpmorg "^4.0.2" + libnpmpack "^4.0.2" + libnpmpublish "^6.0.2" + libnpmsearch "^5.0.2" + libnpmteam "^4.0.2" + libnpmversion "^3.0.1" + make-fetch-happen "^10.1.5" + minipass "^3.1.6" + minipass-pipeline "^1.2.4" + mkdirp "^1.0.4" + mkdirp-infer-owner "^2.0.0" + ms "^2.1.2" + node-gyp "^9.0.0" + nopt "^5.0.0" + npm-audit-report "^3.0.0" + npm-install-checks "^5.0.0" + npm-package-arg "^9.0.2" + npm-pick-manifest "^7.0.1" + npm-profile "^6.0.3" + npm-registry-fetch "^13.1.1" + npm-user-validate "^1.0.1" + npmlog "^6.0.2" + opener "^1.5.2" + pacote "^13.4.1" + parse-conflict-json "^2.0.2" + proc-log "^2.0.1" + qrcode-terminal "^0.12.0" + read "~1.0.7" + read-package-json "^5.0.1" + read-package-json-fast "^2.0.3" + readdir-scoped-modules "^1.1.0" + rimraf "^3.0.2" + semver "^7.3.7" + ssri "^9.0.1" + tar "^6.1.11" + text-table "~0.2.0" + tiny-relative-date "^1.3.0" + treeverse "^2.0.0" + validate-npm-package-name "^4.0.0" + which "^2.0.2" + write-file-atomic "^4.0.1" + npmlog@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -8232,7 +8753,7 @@ npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" -npmlog@^6.0.0: +npmlog@^6.0.0, npmlog@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" integrity sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg== @@ -8343,10 +8864,10 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.72.0: - version "1.72.0" - resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.72.0.tgz#189a02f43a855d097cd2b13b11fe3643124a262b" - integrity sha512-MDsUvkANZaO6V62LMLSqxOROpMqmgEqC9KxPv1VDo9dwIQ5jTAHugkMEaaN9G/l2HHuzrZUgnZtmuRr8ZzXpHA== +oo-ascii-tree@^1.73.0: + version "1.73.0" + resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.73.0.tgz#124c32155395f901296d801a1461e2713696cace" + integrity sha512-bGx23QLCltdo+jrUcvnxf+2Ob7Ntsr8n7UzHPVoz0pWABSjzIzxOh2GRQa/2GebYNTqIHLnERY5Ubs/V7RVPWg== open@^7.4.2: version "7.4.2" @@ -8356,6 +8877,11 @@ open@^7.4.2: is-docker "^2.0.0" is-wsl "^2.1.1" +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + optionator@^0.8.1: version "0.8.3" resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -8602,7 +9128,7 @@ pacote@^11.2.6: ssri "^8.0.1" tar "^6.1.0" -pacote@^13.0.5: +pacote@^13.0.3, pacote@^13.0.5, pacote@^13.4.1, pacote@^13.6.1: version "13.6.2" resolved "https://registry.npmjs.org/pacote/-/pacote-13.6.2.tgz#0d444ba3618ab3e5cd330b451c22967bbd0ca48a" integrity sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg== @@ -8641,6 +9167,15 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-conflict-json@^2.0.1, parse-conflict-json@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-2.0.2.tgz#3d05bc8ffe07d39600dc6436c6aefe382033d323" + integrity sha512-jDbRGb00TAPFsKWCpZZOT93SxVP9nONOSgES3AevqRq/CHvavEBvKAjxX9p5Y5F0RZLxH9Ufd9+RwtCsa+lFDA== + dependencies: + json-parse-even-better-errors "^2.3.1" + just-diff "^5.0.1" + just-diff-apply "^5.2.0" + parse-github-url@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395" @@ -8820,6 +9355,14 @@ pluralize@^8.0.0: resolved "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== +postcss-selector-parser@^6.0.10: + version "6.0.11" + resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" + integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + postcss-values-parser@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" @@ -8839,9 +9382,9 @@ postcss-values-parser@^5.0.0: quote-unquote "^1.0.0" postcss@^8.1.7, postcss@^8.4.6: - version "8.4.20" - resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz#64c52f509644cecad8567e949f4081d98349dc56" - integrity sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g== + version "8.4.21" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" + integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== dependencies: nanoid "^3.3.4" picocolors "^1.0.0" @@ -8929,10 +9472,10 @@ progress@^2.0.0, progress@^2.0.3: resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -projen@^0.66.0: - version "0.66.1" - resolved "https://registry.npmjs.org/projen/-/projen-0.66.1.tgz#35731bb33e94335029facf07366652f160a073b5" - integrity sha512-xlssuvyGV1OWAFZkn08zLb5mwzcz5oVPA+6GZe9iHnM7OqmVIcPiFHge6p1UOdp0mEM3Nq0+Q1LcbNsay4h4+w== +projen@^0.66.11: + version "0.66.11" + resolved "https://registry.npmjs.org/projen/-/projen-0.66.11.tgz#3174d97912ee9398063cc2695bc020bc47746c21" + integrity sha512-U0i6Gw5KIPhHVpycHbmVPB0GseFslF1oUzOww12WmAIwSBA3hAmDDzl2+PF/CQQBKQ5OvCqKPfg18RayRfr+UA== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3" @@ -8950,6 +9493,16 @@ projen@^0.66.0: yargs "^16.2.0" zlib "^1.0.5" +promise-all-reject-late@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz#f8ebf13483e5ca91ad809ccc2fcf25f26f8643c2" + integrity sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw== + +promise-call-limit@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.1.tgz#4bdee03aeb85674385ca934da7114e9bcd3c6e24" + integrity sha512-3+hgaa19jzCGLuSCbieeRsu5C2joKfYn8pY6JAuXFRVfF4IO+L7UPpFWNTeWT9pM7uhskvbPPd/oEOktCn317Q== + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -9051,10 +9604,10 @@ punycode@1.3.2: resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz#2092cc57cd2582c38e4e7e8bb869dc8d3148bc74" + integrity sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw== pupa@^2.1.1: version "2.1.1" @@ -9073,6 +9626,11 @@ q@^1.5.1: resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== +qrcode-terminal@^0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" + integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== + qs@^6.9.4: version "6.11.0" resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" @@ -9160,6 +9718,11 @@ read-cmd-shim@^2.0.0: resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== +read-cmd-shim@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.1.tgz#868c235ec59d1de2db69e11aec885bc095aea087" + integrity sha512-kEmDUoYf/CDy8yZbLTmhB1X9kkjf9Q80PCNsDMb7ufrGd6zZSQA1+UyjrO+pZm5K/S4OXCWJeiIt1JA8kAsa6g== + read-installed@~4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" @@ -9174,7 +9737,7 @@ read-installed@~4.0.3: optionalDependencies: graceful-fs "^4.1.2" -read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.3: +read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.2, read-package-json-fast@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83" integrity sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ== @@ -9212,7 +9775,7 @@ read-package-json@^4.1.1: normalize-package-data "^3.0.0" npm-normalize-package-bin "^1.0.0" -read-package-json@^5.0.0: +read-package-json@^5.0.0, read-package-json@^5.0.1: version "5.0.2" resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.2.tgz#b8779ccfd169f523b67208a89cc912e3f663f3fa" integrity sha512-BSzugrt4kQ/Z0krro8zhTwV1Kd79ue25IhNN/VtHFy1mG/6Tluyi+msc0UpwaoQzxSHa28mntAjIZY6kEgfR9Q== @@ -9267,7 +9830,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -read@1, read@^1.0.4, read@~1.0.1: +read@1, read@^1.0.4, read@^1.0.7, read@~1.0.1, read@~1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" integrity sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ== @@ -9313,7 +9876,7 @@ readdir-glob@^1.0.0: dependencies: minimatch "^5.1.0" -readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@^1.0.0, readdir-scoped-modules@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== @@ -9990,7 +10553,7 @@ ssri@^8.0.0, ssri@^8.0.1: dependencies: minipass "^3.1.1" -ssri@^9.0.0: +ssri@^9.0.0, ssri@^9.0.1: version "9.0.1" resolved "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz#544d4c357a8d7b71a19700074b6883fcb4eae057" integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== @@ -10326,7 +10889,7 @@ text-extensions@^1.0.0: resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== -text-table@^0.2.0: +text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== @@ -10364,6 +10927,11 @@ timers-ext@^0.1.7: es5-ext "~0.10.46" next-tick "1" +tiny-relative-date@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" + integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== + tmp@^0.0.33: version "0.0.33" resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -10438,6 +11006,11 @@ treeify@^1.1.0: resolved "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz#4e31c6a463accd0943879f30667c4fdaff411bb8" integrity sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A== +treeverse@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz#036dcef04bc3fd79a9b79a68d4da03e882d8a9ca" + integrity sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A== + trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" @@ -10596,6 +11169,15 @@ type@^2.7.2: resolved "https://registry.npmjs.org/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -10800,7 +11382,7 @@ url@0.10.3: punycode "1.3.2" querystring "0.2.0" -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== @@ -10920,6 +11502,11 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" +walk-up-path@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz#d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e" + integrity sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg== + walkdir@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz#dc119f83f4421df52e3061e514228a2db20afa39" @@ -10999,7 +11586,7 @@ which-module@^2.0.0: resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== -which-typed-array@^1.1.2: +which-typed-array@^1.1.2, which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== @@ -11096,6 +11683,14 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-file-atomic@^4.0.0, write-file-atomic@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + write-json-file@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" @@ -11258,7 +11853,7 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^21.1.1: +yargs-parser@^21.0.0, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== @@ -11306,6 +11901,19 @@ yargs@^17.1.1, yargs@^17.6.2: y18n "^5.0.5" yargs-parser "^21.1.1" +yargs@^17.5.0: + version "17.6.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz#e134900fc1f218bc230192bdec06a0a5f973e46c" + integrity sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" + yn@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"