diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index c378f500330fb..0000000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,115 +0,0 @@ -# Each line is a file pattern followed by one or more owners (@username or -# email@address). -# -# Order is important. The last matching pattern has the most precedence. -# So if a pull request only touches javascript files, only these owners -# will be requested to review. -# -# @See https://help.github.com/articles/about-codeowners/ - -* @aws/aws-cdk-team -/packages/aws-cdk @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-code*/ @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-ecs/ @aws/aws-cdk-team @SoManyHs -/packages/@aws-cdk/aws-ecs-patterns @aws/aws-cdk-team @SoManyHs -/packages/@aws-cdk/aws-budgets @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-cloudformation @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-config @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-opsworks @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-opsworkscm @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-sam @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-secretsmanager @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-servicecatalog @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-ssm @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-applicationautoscaling/ @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-autoscaling*/ @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-athena @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-batch @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-datapipeline @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-docdb @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-dynamodb @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-dynamodb-global @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-elasticsearch @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-emr @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-glue @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-kinesis @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-kinesisanalytics @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-kinesisfirehose @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-msk @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-elasticache @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/cloudformation-diff @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-cloud9 @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-appmesh @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-ecr @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-ecr-assets @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-servicediscovery @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/core @aws/aws-cdk-team @eladb -/packages/@aws-cdk/cx-api @aws/aws-cdk-team @eladb -/packages/@aws-cdk/region-info @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-dax @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-neptune @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-rds @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-redshift @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-sdb @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-dlm @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-dms @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-ec2 @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-efs @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-elasticloadbalancing*/ @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-fsx @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-pinpoint @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-pinpointemail @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-ses @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/custom-resources @aws/aws-cdk-team @eladb -/packages/@aws-cdk/region-info @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-ram @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-greengrass @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-iot @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-iot1click @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-iotanalytics @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-iotevents @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-iotthingsgraph @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-eks @aws/aws-cdk-team @eladb -/packages/@aws-cdk/cfnspec @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-sns @aws/aws-cdk-team @garnaat @nija-at -/packages/@aws-cdk/aws-sns-subscriptions @aws/aws-cdk-team @garnaat @nija-at -/packages/@aws-cdk/aws-sqs @aws/aws-cdk-team @garnaat @nija-at -/packages/@aws-cdk/aws-robomaker @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-sagemaker @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-amplify @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-appsync @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-cloudtrail @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-cloudwatch @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-events @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-events-targets @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-logs @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-logs-destinations @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-certificatemanager @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-kms @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-iam @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-inspector @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-apigateway @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-cognito @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-lambda @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-lambda-event-sources @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-stepfunctions @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-stepfunctions-tasks @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-waf @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-wafregional @aws/aws-cdk-team @eladb @nija-at -/packages/@aws-cdk/aws-cloudfront @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-mediastore @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-s3 @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-s3-assets @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-s3-deployment @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-s3-notifications @aws/aws-cdk-team @eladb -/packages/@aws-cdk/aws-transfer @aws/aws-cdk-team @eladb -/packages/@aws-cdk/assert @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-appstream @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-directoryservice @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-workspaces @aws/aws-cdk-team @RomainMuller -/packages/@aws-cdk/aws-elasticbeanstalk @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-gamelift @aws/aws-cdk-team @skinny85 -/packages/@aws-cdk/aws-guardduty @aws/aws-cdk-team @rix0rrr -/packages/@aws-cdk/aws-route53 @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-route53-targets @aws/aws-cdk-team @shivlaks -/packages/@aws-cdk/aws-route53resolver @aws/aws-cdk-team @shivlaks diff --git a/.github/actions/prlinter/LICENSE b/.github/actions/prlinter/LICENSE new file mode 100644 index 0000000000000..b71ec1688783a --- /dev/null +++ b/.github/actions/prlinter/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-2020 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/.github/actions/prlinter/NOTICE b/.github/actions/prlinter/NOTICE new file mode 100644 index 0000000000000..bfccac9a7f69c --- /dev/null +++ b/.github/actions/prlinter/NOTICE @@ -0,0 +1,2 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/.github/actions/prlinter/action.yml b/.github/actions/prlinter/action.yml new file mode 100644 index 0000000000000..4d6a52c193ced --- /dev/null +++ b/.github/actions/prlinter/action.yml @@ -0,0 +1,9 @@ +name: Pull Request Linter +description: Execute validation rules on GitHub Pull Requests +inputs: + check: + description: "Which check to execute. Choose one of: [MANDATORY_CHANGES]" + required: true +runs: + using: node12 + main: index.js \ No newline at end of file diff --git a/.github/actions/prlinter/index.js b/.github/actions/prlinter/index.js new file mode 100644 index 0000000000000..e36cc7aa9ffba --- /dev/null +++ b/.github/actions/prlinter/index.js @@ -0,0 +1,31 @@ +const core = require('@actions/core'); +const github = require('@actions/github'); +const linter = require('prlint') + +const checks = { + "MANDATORY_CHANGES": linter.mandatoryChanges +} + +async function run() { + const number = github.context.issue.number; + + try { + + const checkType = core.getInput('check', {required: true}); + + const check = checks[checkType]; + + if (!check) { + throw new Error(`Unsupported check type '${checkType}'. Choose one of: ${Object.keys(checks)}`) + } + + await check(number); + + } catch (error) { + + core.setFailed(error.message); + } + +} + +run() diff --git a/.github/actions/prlinter/package-lock.json b/.github/actions/prlinter/package-lock.json new file mode 100644 index 0000000000000..551e0261530ee --- /dev/null +++ b/.github/actions/prlinter/package-lock.json @@ -0,0 +1,773 @@ +{ + "name": "prlinter", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@actions/core": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.2.tgz", + "integrity": "sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg==" + }, + "@actions/github": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-2.1.0.tgz", + "integrity": "sha512-G4ncMlh4pLLAvNgHUYUtpWQ1zPf/VYqmRH9oshxLabdaOOnp7i1hgSgzr2xne2YUaSND3uqemd3YYTIsm2f/KQ==", + "requires": { + "@actions/http-client": "^1.0.3", + "@octokit/graphql": "^4.3.1", + "@octokit/rest": "^16.15.0" + } + }, + "@actions/http-client": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.3.tgz", + "integrity": "sha512-wFwh1U4adB/Zsk4cc9kVqaBOHoknhp/pJQk+aWTocbAZWpIl4Zx/At83WFRLXvxB+5HVTWOACM6qjULMZfQSfw==", + "requires": { + "tunnel": "0.0.6" + } + }, + "@octokit/auth-token": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz", + "integrity": "sha512-eoOVMjILna7FVQf96iWc3+ZtE/ZT6y8ob8ZzcqKY1ibSQCnu4O/B7pJvzMx5cyZ/RjAff6DAdEb0O0Cjcxidkg==", + "requires": { + "@octokit/types": "^2.0.0" + } + }, + "@octokit/endpoint": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz", + "integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==", + "requires": { + "@octokit/types": "^2.0.0", + "is-plain-object": "^3.0.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/graphql": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz", + "integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==", + "requires": { + "@octokit/request": "^5.3.0", + "@octokit/types": "^2.0.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/request": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz", + "integrity": "sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==", + "requires": { + "@octokit/endpoint": "^5.5.0", + "@octokit/request-error": "^1.0.1", + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "is-plain-object": "^3.0.0", + "node-fetch": "^2.3.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/request-error": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.0.tgz", + "integrity": "sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg==", + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "16.38.3", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.38.3.tgz", + "integrity": "sha512-Ui5W4Gzv0YHe9P3KDZAuU/BkRrT88PCuuATfWBMBf4fux4nB8th8LlyVAVnHKba1s/q4umci+sNHzoFYFujPEg==", + "requires": { + "@octokit/auth-token": "^2.4.0", + "@octokit/request": "^5.2.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/types": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.1.1.tgz", + "integrity": "sha512-89LOYH+d/vsbDX785NOfLxTW88GjNd0lWRz1DVPVsZgg9Yett5O+3MOvwo7iHgvUwbFz0mf/yPIjBkUbs4kxoQ==", + "requires": { + "@types/node": ">= 8" + } + }, + "@types/node": { + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.5.0.tgz", + "integrity": "sha512-Onhn+z72D2O2Pb2ql2xukJ55rglumsVo1H6Fmyi8mlU9SvKdBk/pUSUAiBY/d9bAOF7VVWajX3sths/+g6ZiAQ==" + }, + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=" + }, + "before-after-hook": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" + }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=" + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "requires": { + "isobject": "^4.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" + }, + "macos-release": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", + "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "os-name": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", + "requires": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "prlint": { + "version": "file:../../../tools/prlint", + "requires": { + "github-api": "^3.3.0", + "make-runnable": "^1.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "axios": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "requires": { + "follow-redirects": "1.5.10" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "requires": { + "debug": "=3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "github-api": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/github-api/-/github-api-3.3.0.tgz", + "integrity": "sha512-30pABj/1ciHmlqmjnWXn+A4JL8j9qB2IcQgibrJ7euGbaNRkAj+T6QhJwjLcPx4Hxlj+BP1TcdvaQ/7resw+VA==", + "requires": { + "axios": "^0.19.0", + "debug": "^2.2.0", + "js-base64": "^2.1.9", + "utf8": "^2.1.1" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + }, + "hosted-git-info": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "js-base64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", + "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==" + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "make-runnable": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-runnable/-/make-runnable-1.3.6.tgz", + "integrity": "sha1-ypsdMbBvBR43Vw+3rZi8U2n5gr4=", + "requires": { + "bluebird": "^3.5.0", + "yargs": "^4.7.1" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", + "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yargs": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + } + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "universal-user-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz", + "integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==", + "requires": { + "os-name": "^3.1.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "windows-release": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", + "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", + "requires": { + "execa": "^1.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/.github/actions/prlinter/package.json b/.github/actions/prlinter/package.json new file mode 100644 index 0000000000000..5ae65461ca232 --- /dev/null +++ b/.github/actions/prlinter/package.json @@ -0,0 +1,19 @@ +{ + "name": "prlinter", + "private": true, + "version": "999.0.0", + "description": "", + "main": "index.js", + "keywords": [], + "license": "Apache-2.0", + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "dependencies": { + "@actions/core": "^1.2.2", + "@actions/github": "^2.1.0", + "prlint": "file:../../../tools/prlint" + } +} diff --git a/.github/workflows/auto-approve-dependabot.yml b/.github/workflows/auto-approve-dependabot.yml new file mode 100644 index 0000000000000..5eb14a05c1890 --- /dev/null +++ b/.github/workflows/auto-approve-dependabot.yml @@ -0,0 +1,27 @@ +# Automatically approve PRs made by Dependabot +# +# Written to look at the original author of the PR (instead of the current +# actor) in order to be able to backresolve existing PRs using this action (by +# mass labeling them). Leads to slightly unnecessary spammage of aprovals in a +# PR... +# +# Only does approvals! A different GitHub Action takes care of merging. +name: Auto-approve Dependabot +on: + pull_request: + types: + - labeled + - opened + - ready_for_review + - reopened + - synchronize + - unlabeled + - unlocked +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: hmarr/auto-approve-action@7782c7e2bdf62b4d79bdcded8332808fd2f179cd + if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]' + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pr-linter.yml b/.github/workflows/pr-linter.yml new file mode 100644 index 0000000000000..10af00c534ccc --- /dev/null +++ b/.github/workflows/pr-linter.yml @@ -0,0 +1,23 @@ +# https://octokit.github.io/rest.js +# https://github.com/actions/toolkit/blob/master/packages/github/src/context.ts + +name: PR Linter +on: pull_request + +jobs: + mandatory-changes: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Install packages + run: cd .github/actions/prlinter && npm ci + + - name: Validate + uses: ./.github/actions/prlinter + with: + check: MANDATORY_CHANGES + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.gitignore b/.gitignore index 450c0ffc94eaf..17ba70d7ac568 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ pack/ .tools/ coverage/ .nyc_output +.nycrc .LAST_BUILD *.sw[a-z] *~ @@ -28,4 +29,10 @@ coverage/ cdk.context.json .cdk.staging/ cdk.out/ +*.tabl.json +# Yarn error log +yarn-error.log + +# Generated jest config +jest.config.gen.json diff --git a/.mergify.yml b/.mergify.yml index 5d12200567222..3947bc631cae0 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -6,7 +6,7 @@ pull_request_rules: label: add: [ contribution/core ] conditions: - - author~=^(eladb|RomainMuller|garnaat|nija-at|shivlaks|skinny85|rix0rrr|NGL321|Jerry-AWS|SomayaB|NetaNir|illapolo)$ + - author~=^(eladb|RomainMuller|garnaat|nija-at|shivlaks|skinny85|rix0rrr|NGL321|Jerry-AWS|SomayaB|MrArnoldPalmer|NetaNir|iliapolo)$ - -label~="contribution/core" - name: automatic merge actions: @@ -18,46 +18,44 @@ pull_request_rules: strict_method: merge delete_head_branch: {} conditions: + - base!=release - -title~=(WIP|wip) - - -label~=(blocked|do-not-merge) + - -label~=(blocked|do-not-merge|no-squash) - -merged - -closed + - author!=dependabot[bot] + - author!=dependabot-preview[bot] - "#approved-reviews-by>=1" - -approved-reviews-by~=author - "#changes-requested-reviews-by=0" - status-success~=AWS CodeBuild us-east-1 - status-success=Semantic Pull Request - - name: comment checklist + - status-success=mandatory-changes + - name: automatic merge actions: comment: - message: | - Thanks so much for taking the time to contribute to the AWS CDK ❤️ - - We will shortly assign someone to review this pull request and help get it - merged. In the meantime, please **take a minute to make sure you follow this - checklist**: - - * **PR title `type(scope): text`** - * __type__: `fix`, `feat`, `refactor` go into CHANGELOG, `chore` is hidden - - __scope__: name of module without `aws-` or `cdk-` prefix or postfix (e.g. `s3` instead of `aws-s3-deployment`) - - __text__: use all **lower-case**, **do not** end with a period, do not include issue refs - * **PR Description** - - __Rationale__: describe rationale of change and approach taken - - __Issues__: indicate issues fixed via: `fixes #xxx` or `closes #xxx` - - __Breaking?__: last paragraph: `BREAKING CHANGE: ` - * **Testing** - - Unit test added. Prefer to add a new test rather than modify existing tests - - **CLI or init templates change**? Re-run/add [CLI integration tests](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md#running-cli-integration-tests) - * **Documentation** - - **README**: update module README to describe new features - - **API docs**: public APIs must be documented. Copy from official AWS docs when possible - - **Design**: for significant features, follow [design process](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md#step-2-design-optional) + message: Thank you for contributing! Your pull request is now being automatically merged without squashing. + merge: + strict: smart + # Merge instead of squash + method: merge + strict_method: merge + delete_head_branch: {} conditions: - - author!=dependabot[bot] - - author!=dependabot-preview[bot] - - base=master + - -title~=(WIP|wip) + - -label~=(blocked|do-not-merge) + # Only if no-squash is set + - label~=no-squash - -merged - -closed + - author!=dependabot[bot] + - author!=dependabot-preview[bot] + - "#approved-reviews-by>=1" + - -approved-reviews-by~=author + - "#changes-requested-reviews-by=0" + - status-success~=AWS CodeBuild us-east-1 + - status-success=Semantic Pull Request + - status-success=mandatory-changes - name: remove stale reviews actions: dismiss_reviews: {} @@ -75,8 +73,9 @@ pull_request_rules: - author!=NGL321 - author!=Jerry-AWS - author!=SomayaB + - author!=MrArnoldPalmer - author!=NetaNir - - author!=illapolo + - author!=iliapolo - base=master - -merged - -closed @@ -90,3 +89,25 @@ pull_request_rules: - status-failure=Semantic Pull Request - -merged - -closed + - name: automatic merge of Dependabot PRs + actions: + comment: + message: Thanks Dependabot! + merge: + # 'strict: false' disables Mergify keeping the branch up-to-date from master. + # It's not necessary: Dependabot will do that itself. + # It's not dangerous: GitHub branch protection settings prevent merging stale branches. + strict: false + method: squash + delete_head_branch: {} + conditions: + - -title~=(WIP|wip) + - -label~=(blocked|do-not-merge) + - -merged + - -closed + - author~=dependabot + - "#approved-reviews-by>=1" + - "#changes-requested-reviews-by=0" + - status-success~=AWS CodeBuild us-east-1 + - status-success=Semantic Pull Request + - status-success=mandatory-changes diff --git a/CHANGELOG.md b/CHANGELOG.md index e11305cbbfb07..a817d29fd36b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,361 @@ 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. + +## [1.25.0](https://github.com/aws/aws-cdk/compare/v1.24.0...v1.25.0) (2020-02-18) + + +### ⚠ BREAKING CHANGES + +* **appsync:** Changes `MappingTemplate.dynamoDbPutItem()` to accept +`PrimaryKey` and `AttributeValues`, which allow configuring the primary +key and to project an object to a set of attribute values. + +### Features + +* **appsync:** more general mapping template for DynamoDB PutItem ([#6236](https://github.com/aws/aws-cdk/issues/6236)) ([e9937d3](https://github.com/aws/aws-cdk/commit/e9937d3717d07c679d7732db21231a6b4da80130)), closes [#6225](https://github.com/aws/aws-cdk/issues/6225) +* **aws-applicationautoscaling:** support Lambda and Comprehend ([#6191](https://github.com/aws/aws-cdk/issues/6191)) ([bdab747](https://github.com/aws/aws-cdk/commit/bdab7477b8464e04730a2b4b09841008bc6e8ab9)) +* **cfn:** update CloudFormation spec to v11.0.0 ([#6311](https://github.com/aws/aws-cdk/issues/6311)) ([ea272fa](https://github.com/aws/aws-cdk/commit/ea272fa270fd7dc09e0388a90e82bfb27a88491f)) + + +### Bug Fixes + +* **aws-lambda-nodejs:** Fix parcel invocation when invoked from globally installed cdk cli ([#6206](https://github.com/aws/aws-cdk/issues/6206)) ([ce96e08](https://github.com/aws/aws-cdk/commit/ce96e08a10f86361515f9210a52a37c9101e98fe)), closes [#6204](https://github.com/aws/aws-cdk/issues/6204) +* **codepipeline:** fixed typo in method docs within action.ts ([78a39b7](https://github.com/aws/aws-cdk/commit/78a39b7a07f35b4675fe63cb2134c166f846c6be)) +* **eks:** Helm release name length & `--wait` option. ([#6276](https://github.com/aws/aws-cdk/issues/6276)) ([1811e00](https://github.com/aws/aws-cdk/commit/1811e00ff7e90f235198f855051f11f1d457b3a4)), closes [/github.com/helm/helm/blob/b63822ed12de1badbb61736d2f7ea4e756ef757d/pkg/action/install.go#L52-L55](https://github.com/aws//github.com/helm/helm/blob/b63822ed12de1badbb61736d2f7ea4e756ef757d/pkg/action/install.go/issues/L52-L55) +* **lambda-nodejs:** not meaningful parcel error message when build fails ([#6277](https://github.com/aws/aws-cdk/issues/6277)) ([a97b48a](https://github.com/aws/aws-cdk/commit/a97b48ae4a7dafe050997e00bb57bf64117b551b)), closes [#6274](https://github.com/aws/aws-cdk/issues/6274) + +## [1.24.0](https://github.com/aws/aws-cdk/compare/v1.23.0...v1.24.0) (2020-02-13) + + +### Features + +* **assert:** add countResourcesLike method ([#6168](https://github.com/aws/aws-cdk/issues/6168)) ([491e2d9](https://github.com/aws/aws-cdk/commit/491e2d970c849cbc00e7cb3def927b12054d572f)) +* **cx-api:** clean up features.ts ([#6181](https://github.com/aws/aws-cdk/issues/6181)) ([efd6f3d](https://github.com/aws/aws-cdk/commit/efd6f3d7c7ccd985f386b29dffed47e2b3c6fa7c)), closes [#6098](https://github.com/aws/aws-cdk/issues/6098) +* **dynamodb:** add metrics for dynamodb table ([#6149](https://github.com/aws/aws-cdk/issues/6149)) ([295391e](https://github.com/aws/aws-cdk/commit/295391e901798a8f99415fd72a6b4fa664d75f44)) +* **dynamodb:** global tables version 2019.11.21 ([#5821](https://github.com/aws/aws-cdk/issues/5821)) ([8c0c2b1](https://github.com/aws/aws-cdk/commit/8c0c2b130060215509cd6db83f8d6b18f92f857b)), closes [#5752](https://github.com/aws/aws-cdk/issues/5752) +* **ec2:** smarter default for VPN route propagation ([#6071](https://github.com/aws/aws-cdk/issues/6071)) ([5dd8aca](https://github.com/aws/aws-cdk/commit/5dd8aca97c314a2293473f4c6695e844f14aaa62)), closes [#6008](https://github.com/aws/aws-cdk/issues/6008) +* **ec2:** VPC flow logs ([a2fddec](https://github.com/aws/aws-cdk/commit/a2fddec4aa1893d4bf68fdfbb5c9379e58cd19f3)), closes [#3493](https://github.com/aws/aws-cdk/issues/3493) +* **iam:** add ability to create IAM role descriptions ([cee8825](https://github.com/aws/aws-cdk/commit/cee882540527feb2b6f0fee866eb96cccc2eae36)) +* **iam:** descriptions for IAM Roles ([a1294d3](https://github.com/aws/aws-cdk/commit/a1294d35015faaf27f44a894a2367fe5791856a6)) +* **cfnspec**: update CloudFormation spec to 10.5.0 ([#6195](https://github.com/aws/aws-cdk/issues/6195)) ([47a9949](https://github.com/aws/aws-cdk/commit/47a994916cc7744a2335ae4c7496ad11be86e366)) +* **iam:** lookup ManagedPolicy via ARN ([2df2023](https://github.com/aws/aws-cdk/commit/2df2023755d696af0e82a1c83bfd2d4b4e54950d)), closes [#6186](https://github.com/aws/aws-cdk/issues/6186) +* **lambda:** expose `function.deadLetterQueue` ([6656047](https://github.com/aws/aws-cdk/commit/66560479c9417003c8cc61021155b8a8b732fb39)), closes [#6170](https://github.com/aws/aws-cdk/issues/6170) +* **step-functions:** `grantStartExecution` available on imported StateMachine ([5ae81cd](https://github.com/aws/aws-cdk/commit/5ae81cdddd75abedbcef7d856bdb20458fac5fcb)), closes [#6173](https://github.com/aws/aws-cdk/issues/6173) +* **stepfunctions:** EMR service integrations ([c69b6d2](https://github.com/aws/aws-cdk/commit/c69b6d2d712f9c307dd9de214acc96f5f944cc7d)), closes [#5224](https://github.com/aws/aws-cdk/issues/5224) + + +### Bug Fixes + +* **cli**: truncated 'cdk diff' output in pipes ([aba1485](https://github.com/aws/aws-cdk/commit/aba1485765a4ac31e5acabaa945b1b4adde94c6a)) +* **apigateway:** deployment fails when Model's contentType is not specified ([#6199](https://github.com/aws/aws-cdk/issues/6199)) ([0bf1403](https://github.com/aws/aws-cdk/commit/0bf1403a9f669556ed7942b5e1dd966f94ba812c)), closes [#6161](https://github.com/aws/aws-cdk/issues/6161) +* **apigateway:** stack deployment fails when a Stage is explicitly specified ([#6165](https://github.com/aws/aws-cdk/issues/6165)) ([879601e](https://github.com/aws/aws-cdk/commit/879601ead3c009cc10bd5d49dbc9d1132fa9ba82)), closes [#6068](https://github.com/aws/aws-cdk/issues/6068) +* **cli:** wrongly assume aws config file always exists ([#6196](https://github.com/aws/aws-cdk/issues/6196)) ([23f8b9f](https://github.com/aws/aws-cdk/commit/23f8b9f5e97f5f229faa9322d840339f6322a234)) +* **codebuild:** badge is not allowed for CodeCommit sources ([#6211](https://github.com/aws/aws-cdk/issues/6211)) ([433d957](https://github.com/aws/aws-cdk/commit/433d95763210f8798c604bf62560d2a4ba39d9c6)), closes [#6205](https://github.com/aws/aws-cdk/issues/6205) +* **ec2:** `onePerAz` does not work for looked-up VPCs ([3332d06](https://github.com/aws/aws-cdk/commit/3332d06982c6eb04e4f88c5b01ad745ed18d7e82)), closes [#3126](https://github.com/aws/aws-cdk/issues/3126) +* **ecs-patterns:** allow imported load balancers as inputs ([7f8c90d](https://github.com/aws/aws-cdk/commit/7f8c90decd58d2016611e6f94fc506156e047b59)) +* **elasticloadbalancingv2:** logAccessLogs in Base Load Balancer ([#6197](https://github.com/aws/aws-cdk/issues/6197)) ([adbc3b9](https://github.com/aws/aws-cdk/commit/adbc3b93e062b6687c048b36ef4d26ce2c784e53)), closes [#3794](https://github.com/aws/aws-cdk/issues/3794) +* **elbv2:** validate rule priority is a positive number ([#6222](https://github.com/aws/aws-cdk/issues/6222)) ([1fbaafe](https://github.com/aws/aws-cdk/commit/1fbaafe34ce3f45a84a2141f7171e02fb8ec4801)), closes [#3794](https://github.com/aws/aws-cdk/issues/3794) +* **kms:** add TagResource & UntagResource IAM permissions to default key policy ([#6125](https://github.com/aws/aws-cdk/issues/6125)) ([e65a326](https://github.com/aws/aws-cdk/commit/e65a326b7de3d97675e27af7f3cb9f2f8735a01d)), closes [#6102](https://github.com/aws/aws-cdk/issues/6102) + +## [1.23.0](https://github.com/aws/aws-cdk/compare/v1.22.0...v1.23.0) (2020-02-07) + + +### Features + +* **appsync:** add support for mapping DynamoDB queries ([#5940](https://github.com/aws/aws-cdk/issues/5940)) ([2240e97](https://github.com/aws/aws-cdk/commit/2240e97eded2578aa09ccd3af282bfb6db5667d7)), closes [#5861](https://github.com/aws/aws-cdk/issues/5861) +* **aws-codebuild:** allow github sourceversion branch ([#5890](https://github.com/aws/aws-cdk/issues/5890)) ([155b80e](https://github.com/aws/aws-cdk/commit/155b80ea30cf7c22e50fe4acdbc68978ae8be173)), closes [#5777](https://github.com/aws/aws-cdk/issues/5777) +* **cloudformation:** update Resource Specification to v10.4.0 ([#5982](https://github.com/aws/aws-cdk/issues/5982)) ([178ca5e](https://github.com/aws/aws-cdk/commit/178ca5ee75f3133c059077f0678b159c1d366c5f)) +* **ecs:** add support for enabling container insights ([#5601](https://github.com/aws/aws-cdk/issues/5601)) ([6236634](https://github.com/aws/aws-cdk/commit/6236634d86d3615f58153cca50595fa0d7a4540c)) +* **ecs:** ContainerImage.fromDockerImageAsset ([b94577a](https://github.com/aws/aws-cdk/commit/b94577a0acb0aa76e257fb15267faf6c0954700a)), closes [#5791](https://github.com/aws/aws-cdk/issues/5791) [#5983](https://github.com/aws/aws-cdk/issues/5983) +* **ecs:** ContainerImage.fromDockerImageAsset ([#6093](https://github.com/aws/aws-cdk/issues/6093)) ([38e9865](https://github.com/aws/aws-cdk/commit/38e9865509df4ddb8a875d37cee2a88a3db9f169)), closes [#5791](https://github.com/aws/aws-cdk/issues/5791) [#5983](https://github.com/aws/aws-cdk/issues/5983) +* **ecs:** Firelens log driver support ([#5457](https://github.com/aws/aws-cdk/issues/5457)) ([4acf0f7](https://github.com/aws/aws-cdk/commit/4acf0f7441eafdc7dc93d6d44a0f4bfb2e8fb47e)) +* **lambda:** avail function log group in the CDK ([#5878](https://github.com/aws/aws-cdk/issues/5878)) ([fd54a17](https://github.com/aws/aws-cdk/commit/fd54a17a82605ac1301e5776aa68f03bbfb63910)), closes [#3838](https://github.com/aws/aws-cdk/issues/3838) +* **lambda:** higher level construct for Node.js ([#5532](https://github.com/aws/aws-cdk/issues/5532)) ([02d0e2a](https://github.com/aws/aws-cdk/commit/02d0e2aa0075eec5e42b6b6a10ddd7a0e53b97c6)) + + + +### Bug Fixes + +* **assets:** add exclude glob patterns to calculating fingerprint for staging ([#6085](https://github.com/aws/aws-cdk/issues/6085)) ([d9a043b](https://github.com/aws/aws-cdk/commit/d9a043b6f604d70525a94e69db0c94589221e720)), closes [#5238](https://github.com/aws/aws-cdk/issues/5238) +* **aws-s3-deployment:** fix server side encryption parameters ([#6006](https://github.com/aws/aws-cdk/issues/6006)) ([c7197c0](https://github.com/aws/aws-cdk/commit/c7197c0048474f69e253b752e289abad6e72554f)), closes [#6002](https://github.com/aws/aws-cdk/issues/6002) +* **cli:** colored text is unreadable when using light themes ([#5250](https://github.com/aws/aws-cdk/issues/5250)) ([b4573ef](https://github.com/aws/aws-cdk/commit/b4573ef19e8b41121065d5d0830554b9d6b03565)) +* **cli:** parse equals sign in context values ([#5773](https://github.com/aws/aws-cdk/issues/5773)) ([667443c](https://github.com/aws/aws-cdk/commit/667443c99683dcb6b02073350bdabc8aa482d1c2)), closes [#5738](https://github.com/aws/aws-cdk/issues/5738) +* **codepipeline:** manual approval action doesn't have configuration without a topic ([#6106](https://github.com/aws/aws-cdk/issues/6106)) ([a63cbf8](https://github.com/aws/aws-cdk/commit/a63cbf803535e7e3043cadf9c4a4de1f8da45a9a)), closes [#6100](https://github.com/aws/aws-cdk/issues/6100) +* **cognito:** standard attr timezone unexpectedly creates custom attr ([#5973](https://github.com/aws/aws-cdk/issues/5973)) ([acf3ffc](https://github.com/aws/aws-cdk/commit/acf3ffce5b7dacd25b6611d07835f30c85d53006)) +* **ec2:** add `MachineImage` factory, document instance replacement ([#6065](https://github.com/aws/aws-cdk/issues/6065)) ([435d810](https://github.com/aws/aws-cdk/commit/435d81014a481d0828bddbf10a0a155f6efc2e7e)), closes [#5675](https://github.com/aws/aws-cdk/issues/5675) [#6025](https://github.com/aws/aws-cdk/issues/6025) +* **ec2:** private DNS for custom endpoints has incorrect default ([d681d96](https://github.com/aws/aws-cdk/commit/d681d964b91048eaf2044a27c8c70c05b2b9e2bc)) +* **ecr-assets:** docker images are not built if .dockerignore includes an entry that ignores the dockerfile. ([#6007](https://github.com/aws/aws-cdk/issues/6007)) ([e7ef5e5](https://github.com/aws/aws-cdk/commit/e7ef5e5660457eb82252e8992214da775b83c41c)) +* **ecs:** fix splunk-sourcetype ([#6128](https://github.com/aws/aws-cdk/issues/6128)) ([6456a7c](https://github.com/aws/aws-cdk/commit/6456a7c508c6cc68e98ebdcf8c0f4336cb3c0b89)) +* **ecs-patterns:** queue service grant permission automatically ([#6110](https://github.com/aws/aws-cdk/issues/6110)) ([0d0794e](https://github.com/aws/aws-cdk/commit/0d0794e4853f00d971d4e00f76fcced780fe0413)) +* **ecs-patterns:** remove duplicated schedule property for scheduled task pattern ([#6101](https://github.com/aws/aws-cdk/issues/6101)) ([15b6aa7](https://github.com/aws/aws-cdk/commit/15b6aa72e17b37f53b745dc33d0626d1c5d9ff4b)) +* **eks:** missing VPC permissions for fargate profiles ([#6074](https://github.com/aws/aws-cdk/issues/6074)) ([0a586fc](https://github.com/aws/aws-cdk/commit/0a586fc3e1c2c44dc4cf2d365d84103393682153)) +* **glue:** Make Glue Database locationUri optional. ([#5784](https://github.com/aws/aws-cdk/issues/5784)) ([a065169](https://github.com/aws/aws-cdk/commit/a0651693fb3eb00482f6b3ee70d1982d78ea0013)), closes [#5268](https://github.com/aws/aws-cdk/issues/5268) [#5268](https://github.com/aws/aws-cdk/issues/5268) [#5268](https://github.com/aws/aws-cdk/issues/5268) [#5268](https://github.com/aws/aws-cdk/issues/5268) +* **iam:** policies added to immutably imported role ([#6090](https://github.com/aws/aws-cdk/issues/6090)) ([f1f5319](https://github.com/aws/aws-cdk/commit/f1f53194b9b41031640987822f5ed562f1b2ecec)), closes [#5569](https://github.com/aws/aws-cdk/issues/5569) [#5943](https://github.com/aws/aws-cdk/issues/5943) +* **init-templates:** JavaScript, TypeScript, and Python init templates are broken in 1.21.0 ([#5989](https://github.com/aws/aws-cdk/issues/5989)) ([505c91e](https://github.com/aws/aws-cdk/commit/505c91e8b02c7c054d01e51f89e440f24f43ac8e)), closes [#5986](https://github.com/aws/aws-cdk/issues/5986) +* **route53:** CaaAmazonRecord ignores recordName ([#6027](https://github.com/aws/aws-cdk/issues/6027)) ([16f9721](https://github.com/aws/aws-cdk/commit/16f9721955b2aacec5ed3850b8b8d399ffecfe75)), closes [#5764](https://github.com/aws/aws-cdk/issues/5764) +* **route53:** correct import example in README.md ([#5946](https://github.com/aws/aws-cdk/issues/5946)) ([ed71931](https://github.com/aws/aws-cdk/commit/ed719317cd8422182df9512807294c2822d470ea)) +* **s3-deployment:** passing any system metadata causes lambda to fail on "Unknown options:" when invoking aws cli. ([#6086](https://github.com/aws/aws-cdk/issues/6086)) ([b30add8](https://github.com/aws/aws-cdk/commit/b30add8c70dcf6239c137a38eb764513ce1e1f29)) + +## [1.22.0](https://github.com/aws/aws-cdk/compare/v1.21.1...v1.22.0) (2020-01-23) + + +### ⚠ BREAKING CHANGES + +* **eks:** (experimental module) the `Mapping` struct was renamed to `AwsAuthMapping`. +* **core:** Arn.parseArn now returns empty string for nullable Arn components. Users who were depending on an undefined value will now receive the falsy empty string. +* **ecr-assets:** all docker image assets are now pushed to a single ECR repository named `aws-cdk/assets` with an image tag based on the hash of the docker build source directory (the directory where your `Dockerfile` resides). See PR #5733 for details and discussion. +* **autoscaling:** AutoScaling by using `scaleOnMetric` will no longer force the alarm period to 1 minute, but use the period from the Metric object instead (5 minutes by default). Use `metric.with({ period: Duration.minute(1) })` to create a high-frequency scaling policy. + +### Features + +* **apigatewayv2:** fork APIGatewayV2 into its own package ([#5816](https://github.com/aws/aws-cdk/issues/5816)) ([d58667e](https://github.com/aws/aws-cdk/commit/d58667e473c1e07ac8f2f073b3a541569a014e01)) +* **cloudformation:** upgrade the CloudFormation resource specification to v10.3.0 ([#5882](https://github.com/aws/aws-cdk/issues/5882)) ([e5e4725](https://github.com/aws/aws-cdk/commit/e5e47252b39ee1aedba1eaf81f32a0110ac2ab32)) +* **ecr-assets:** simplify docker asset publishing ([#5733](https://github.com/aws/aws-cdk/issues/5733)) ([b52b43d](https://github.com/aws/aws-cdk/commit/b52b43ddfea0398b3f6e05002bf5b97bc831d1a7)), closes [#3463](https://github.com/aws/aws-cdk/issues/3463) [#5807](https://github.com/aws/aws-cdk/issues/5807) +* **eks:** fargate profiles ([#5589](https://github.com/aws/aws-cdk/issues/5589)) ([450a127](https://github.com/aws/aws-cdk/commit/450a12789f3f145d3409db4a7a9d1eb06ae48e37)), closes [#5303](https://github.com/aws/aws-cdk/issues/5303) +* **lambda:** allow inline code for nodejs12.x runtime ([#5710](https://github.com/aws/aws-cdk/issues/5710)) ([a1cd743](https://github.com/aws/aws-cdk/commit/a1cd7432eb817a0a9361c907445c01eea4cb1321)) +* **lambda-destinations:** option to auto-extract the payload when using LambdaDestination ([#5503](https://github.com/aws/aws-cdk/issues/5503)) ([321372f](https://github.com/aws/aws-cdk/commit/321372fb68ba2a9928069d24d500061efec188f8)) +* **route53-targets:** Add aws-route53-targets/InterfaceVpcEndpointTarget ([#4868](https://github.com/aws/aws-cdk/issues/4868)) ([6969562](https://github.com/aws/aws-cdk/commit/696956240f36fc7235f77b0d4f2d286ab580f78d)) +* bump JSII to version 0.21.2 ([#5919](https://github.com/aws/aws-cdk/issues/5919)) ([dd18456](https://github.com/aws/aws-cdk/commit/dd184563521f2b4eca72af650c98e91177f2831d)) + + +### Bug Fixes + +* **apigateway:** LambdaRestApi fails when a user defined Stage is attached ([#5838](https://github.com/aws/aws-cdk/issues/5838)) ([05719d7](https://github.com/aws/aws-cdk/commit/05719d75edefce45781516f440e1e685741006df)), closes [#5744](https://github.com/aws/aws-cdk/issues/5744) +* **autoscaling:** can't use `MathExpression` in `scaleOnMetric` ([d4c1b0e](https://github.com/aws/aws-cdk/commit/d4c1b0ee84abb1c0ca24ddf1260a4b2161dde7b8)), closes [#5776](https://github.com/aws/aws-cdk/issues/5776) +* `SecretsManagerRDSPostgreSQLRotationMultiUser` not working ([49032ee](https://github.com/aws/aws-cdk/commit/49032eef373d6d05f580abf2d3e1cc2a66b31042)) +* **autoscaling:** can't use block devices ([fee1324](https://github.com/aws/aws-cdk/commit/fee1324548350842d81fbc646b011db214b59de3)), closes [#5868](https://github.com/aws/aws-cdk/issues/5868) +* **core:** allow empty string components in parseArn ([#5875](https://github.com/aws/aws-cdk/issues/5875)) ([5ed5eb4](https://github.com/aws/aws-cdk/commit/5ed5eb416ec92f12c6bda352bc81b684f7a54517)), closes [#5808](https://github.com/aws/aws-cdk/issues/5808) +* **lambda:** setting log retention to INFINITE causes failure ([#5876](https://github.com/aws/aws-cdk/issues/5876)) ([19ed739](https://github.com/aws/aws-cdk/commit/19ed7397f721e42841ef494bd4fdcc0131505554)) +* **route53:** incorrect domain name produced when using HTTPS in ApplicationLoadBalancedFargateService ([#5802](https://github.com/aws/aws-cdk/issues/5802)) ([5ba5a5e](https://github.com/aws/aws-cdk/commit/5ba5a5ea1627046524408d0cf9648d552f0e4b7a)) + +## [1.21.1](https://github.com/aws/aws-cdk/compare/v1.21.0...v1.21.1) (2020-01-16) + +### Bug Fixes + +* **ecr-assets:** cannot build docker images outside the source tree (i.e. against a cdk.out directory) ([#5836](https://github.com/aws/aws-cdk/pull/5836)) ([6bc8ecc](https://github.com/aws/aws-cdk/pull/5833/commits/6bc8eccdba21a10944c81ababe07df37c07481d0)), fixes ([#5807](https://github.com/aws/aws-cdk/issues/5807)) +* **cli:** `cdk init` fails if run under a directory where `cdk.json` exists, reverts ([#5772](https://github.com/aws/aws-cdk/pull/5772)) due to an issue which will be fixed in a subsequent version ([#5836](https://github.com/aws/aws-cdk/pull/5836)) ([da9c626](https://github.com/aws/aws-cdk/pull/5833/commits/da9c6262fd262a5cfd8c150c2c165e46ecbc95b1)) +, fixes ([#5826](https://github.com/aws/aws-cdk/issues/5826)) +## [1.21.0](https://github.com/aws/aws-cdk/compare/v1.20.0...v1.21.0) (2020-01-15) + + +### Features + +* **assert:** cdk assert: implement 'haveOutput' assertion ([#5366](https://github.com/aws/aws-cdk/issues/5366)) ([ee6decb](https://github.com/aws/aws-cdk/commit/ee6decbb4f2b90454777632f8750eae8674b1be2)), closes [#1906](https://github.com/aws/aws-cdk/issues/1906) +* **cli:** run cdk from inner directories ([#5772](https://github.com/aws/aws-cdk/issues/5772)) ([a54630d](https://github.com/aws/aws-cdk/commit/a54630db99716e1a7a19e4320fa4c55a42e5ea68)) +* **codepipeline:** add CannedACL and CacheControl to S3 deploy action ([#5698](https://github.com/aws/aws-cdk/issues/5698)) ([b3e7978](https://github.com/aws/aws-cdk/commit/b3e7978dff2ce20d8e0327db13186922205a1b4c)) +* **codepipeline:** add support for externalEntityLink in the manual approval action ([#5558](https://github.com/aws/aws-cdk/issues/5558)) ([be2e3e3](https://github.com/aws/aws-cdk/commit/be2e3e305eee5d90552c08512a4d476db74b91d0)) +* **codepipeline:** Pipeline Variables ([#5604](https://github.com/aws/aws-cdk/issues/5604)) ([34d3e7d](https://github.com/aws/aws-cdk/commit/34d3e7de39dc197510013f6e4f91170b4c2e29f7)), closes [#5219](https://github.com/aws/aws-cdk/issues/5219) +* **ec2:** `VpcEndpointService` construct ([#5498](https://github.com/aws/aws-cdk/issues/5498)) ([a2713f3](https://github.com/aws/aws-cdk/commit/a2713f35d65bd26fb9ff878c6daed072ffed5f15)) +* recommend matching commands ([#5668](https://github.com/aws/aws-cdk/issues/5668)) ([6108b91](https://github.com/aws/aws-cdk/commit/6108b91d6d3c087a61ac9b3990030a5a52a08808)) +* **elbv2:** default config for internal load balancer will fall back to Isolated subnets ([#5696](https://github.com/aws/aws-cdk/pull/5696)) ([8b9c1fc](https://github.com/aws/aws-cdk/commit/8b9c1fc652673083ffd92f58a97931c1bbb834c9)) +* **iam:** `Role.withoutPolicyUpdates()` ([#5569](https://github.com/aws/aws-cdk/issues/5569)) ([ea4ca3e](https://github.com/aws/aws-cdk/commit/ea4ca3ea251e54921c39ee79f321cae2701837ad)), closes [#2985](https://github.com/aws/aws-cdk/issues/2985) [#4465](https://github.com/aws/aws-cdk/issues/4465) [#4501](https://github.com/aws/aws-cdk/issues/4501) +* **iam:** support importing service roles ([#5701](https://github.com/aws/aws-cdk/issues/5701)) ([0f02dad](https://github.com/aws/aws-cdk/commit/0f02dad9ffa9d01912f29edc0c8d91869a6c4824)), closes [#2651](https://github.com/aws/aws-cdk/issues/2651) +* **s3:** server access logs ([#5072](https://github.com/aws/aws-cdk/issues/5072)) ([c9b074b](https://github.com/aws/aws-cdk/commit/c9b074b28b26a537fb81b9a4a431df6412964c59)) + + +### Bug Fixes + +* **acm:** `DnsValidatedCertificate` in non-aws partitions ([#5771](https://github.com/aws/aws-cdk/issues/5771)) ([e3305d8](https://github.com/aws/aws-cdk/commit/e3305d8d09b3fd87a0609606c3638332c4eeef33)) +* **apigateway:** authorizer name is not optional ([#5731](https://github.com/aws/aws-cdk/issues/5731)) ([21c425e](https://github.com/aws/aws-cdk/commit/21c425e066dec3ec44daedfa980f9e4d96488755)), closes [#5678](https://github.com/aws/aws-cdk/issues/5678) +* **apigateway:** unable to associate RestApi as a route53 target for late bound domains ([#5555](https://github.com/aws/aws-cdk/issues/5555)) ([c02741e](https://github.com/aws/aws-cdk/commit/c02741ed53ecc834acfb5c3c4d5fc0deab6f2726)) +* **cli:** Fix various init templates & their tests ([#5693](https://github.com/aws/aws-cdk/issues/5693)) ([a85da79](https://github.com/aws/aws-cdk/commit/a85da79c0da05f57af84d388efe7775502cf0039)) +* **cli:** proxy support is broken ([#5803](https://github.com/aws/aws-cdk/issues/5803)) ([3a63f57](https://github.com/aws/aws-cdk/commit/3a63f57b3f36f914ac086d9bfe08274f0ddec574)), closes [#5743](https://github.com/aws/aws-cdk/issues/5743) [#5791](https://github.com/aws/aws-cdk/issues/5791) +* **cloudformation:** nested stack example in readme is broken ([#5729](https://github.com/aws/aws-cdk/issues/5729)) ([c53356a](https://github.com/aws/aws-cdk/commit/c53356a3cc4c4a96d326d73bfa28d791100391bc)), closes [#5686](https://github.com/aws/aws-cdk/issues/5686) +* **cloudwatch:** cross-account metrics in env-agnostic stack ([#5775](https://github.com/aws/aws-cdk/issues/5775)) ([5292bd5](https://github.com/aws/aws-cdk/commit/5292bd56ad4f7c2bf68767861c5e252b13282f34)), closes [aws/aws-cdk#5628](https://github.com/aws/aws-cdk/issues/5628) +* **codepipeline:** Action.onStateChange() has wrong detail type ([#5721](https://github.com/aws/aws-cdk/issues/5721)) ([8686dd5](https://github.com/aws/aws-cdk/commit/8686dd5bae583df08f2b25a8133c7e9296f7a643)), closes [#3614](https://github.com/aws/aws-cdk/issues/3614) +* **custom-resources:** missing physical resource id for delete calls ([#5805](https://github.com/aws/aws-cdk/issues/5805)) ([9b7236a](https://github.com/aws/aws-cdk/commit/9b7236abb4b08c2d080858059dc2b531031da6fe)), closes [#5796](https://github.com/aws/aws-cdk/issues/5796) +* **ecr-assets:** unable to use one Dockerfile to build multiple images ([#5705](https://github.com/aws/aws-cdk/issues/5705)) ([ff3f27f](https://github.com/aws/aws-cdk/commit/ff3f27fe56dc2300032c307cf09f50a3cd7a997e)), closes [#5683](https://github.com/aws/aws-cdk/issues/5683) +* **ecs:** cannot separate `Cluster` and `Ec2Service` behind ALB ([#5813](https://github.com/aws/aws-cdk/issues/5813)) ([eb3c517](https://github.com/aws/aws-cdk/commit/eb3c5170e1c3f5243ee437ab7627dd84d68d5740)) +* **glue:** empty string in Table.s3prefix is not undefined ([#5783](https://github.com/aws/aws-cdk/issues/5783)) ([18e15de](https://github.com/aws/aws-cdk/commit/18e15de64dfcadd9b5cacef54ed5d93a9a91189a)), closes [#5763](https://github.com/aws/aws-cdk/issues/5763) +* **iam:** can't use `OrganizationPrincipal` for assuming Role ([#5746](https://github.com/aws/aws-cdk/issues/5746)) ([6c3d4c4](https://github.com/aws/aws-cdk/commit/6c3d4c40b7f4cef1c3d484bf9b3409ee6f33cc27)), closes [#5732](https://github.com/aws/aws-cdk/issues/5732) +* **rds:** pass the ARN of master instead of its ID in DatabaseInstanceReadReplica ([#5702](https://github.com/aws/aws-cdk/issues/5702)) ([d323c0c](https://github.com/aws/aws-cdk/commit/d323c0c13aaf475f59615a41969bb60cbb678be8)), closes [#5530](https://github.com/aws/aws-cdk/issues/5530) + +## [1.20.0](https://github.com/aws/aws-cdk/compare/v1.19.0...v1.20.0) (2020-01-07) + + +### ⚠ BREAKING CHANGES + +* **autoscaling:** AutoScalingGroups without `desiredCapacity` are now +initially scaled to their minimum capacity (instead of their maximum +capaciety). +* **rds:** `addRotationSingleUser(id: string, options: SecretRotationOptions)` is now `addRotationSingleUser(automaticallyAfter?: Duration)` +* **glue:** InputFormat. TEXT_INPUT_FORMAT has been renamed to TEXT. OutputFormat. HIVE_IGNORE_KEY_TEXT_OUTPUT_FORMAT has been renamed to HIVE_IGNORE_KEY_TEXT + +### Features + +* **apigateway:** lambda token authorizer ([#5197](https://github.com/aws/aws-cdk/issues/5197)) ([5c16744](https://github.com/aws/aws-cdk/commit/5c167448f16ea368efc8192abc26e281f976ec7f)), closes [#5584](https://github.com/aws/aws-cdk/issues/5584) +* **aws-stepfunctions:** support StateMachineType ([#5398](https://github.com/aws/aws-cdk/issues/5398)) ([ea095f0](https://github.com/aws/aws-cdk/commit/ea095f0198ebe1efd2f20621cac111b71ee68bd7)), closes [#5397](https://github.com/aws/aws-cdk/issues/5397) +* **cli:** support custom CA certificate bundles ([ac748c1](https://github.com/aws/aws-cdk/commit/ac748c1786e68774f5d0ea9cfbec439034166c40)), closes [#5294](https://github.com/aws/aws-cdk/issues/5294) +* **cloudformation:** update cloudformation spec to v10.2.0 ([#5542](https://github.com/aws/aws-cdk/issues/5542)) ([cb65da3](https://github.com/aws/aws-cdk/commit/cb65da3cd31425265aadd2f2e806a45b244fab8b)) +* **cloudwatch:** make Metric objects region-aware ([212687c](https://github.com/aws/aws-cdk/commit/212687c1427b4e0e6dde11c69139e5036a1ce087)) +* **cloudwatch:** support for metric math ([#5582](https://github.com/aws/aws-cdk/issues/5582)) ([a7f189e](https://github.com/aws/aws-cdk/commit/a7f189e980fdc21b44b8d20fcb491d798ffb682e)), closes [#1077](https://github.com/aws/aws-cdk/issues/1077) [#5449](https://github.com/aws/aws-cdk/issues/5449) [#5261](https://github.com/aws/aws-cdk/issues/5261) [#4716](https://github.com/aws/aws-cdk/issues/4716) +* **codebuild:** add 2X_Large compute type option ([#5429](https://github.com/aws/aws-cdk/issues/5429)) ([1291ef6](https://github.com/aws/aws-cdk/commit/1291ef6b4eb7b8333247b243bcf37bdcb8aaa07f)), closes [#5401](https://github.com/aws/aws-cdk/issues/5401) +* **core:** add support for the ref intrinsic function ([#5468](https://github.com/aws/aws-cdk/issues/5468)) ([#5470](https://github.com/aws/aws-cdk/issues/5470)) ([cad5bc1](https://github.com/aws/aws-cdk/commit/cad5bc148bfdd088c1307932b919899a98fd860a)) +* **custom-resource:** Allow custom ResourceTypes on CustomResources ([#5248](https://github.com/aws/aws-cdk/issues/5248)) ([c605ceb](https://github.com/aws/aws-cdk/commit/c605ceb40a49528505669bac61403673b38da5ba)) +* **custom-resources:** getDataString for AwsCustomResource ([#5578](https://github.com/aws/aws-cdk/issues/5578)) ([faa368d](https://github.com/aws/aws-cdk/commit/faa368dfa7d6706669a9eaca2279cb86d2dd42c7)), closes [#5570](https://github.com/aws/aws-cdk/issues/5570) +* **custom-resources:** ignore DELETE after failed CREATE ([#5525](https://github.com/aws/aws-cdk/issues/5525)) ([9ab989e](https://github.com/aws/aws-cdk/commit/9ab989e4aba7b4fdeee062097dda01b25d41675d)), closes [#5524](https://github.com/aws/aws-cdk/issues/5524) +* **custom-resources:** use latest SDK in AwsCustomResource ([#5442](https://github.com/aws/aws-cdk/issues/5442)) ([a111cdd](https://github.com/aws/aws-cdk/commit/a111cdd97928280b206c3dcfc522e642106e3a70)), closes [#2689](https://github.com/aws/aws-cdk/issues/2689) [#5063](https://github.com/aws/aws-cdk/issues/5063) +* **dynamodb:** Implement importing existing dynamodb table. ([#5280](https://github.com/aws/aws-cdk/issues/5280)) ([8d9b58b](https://github.com/aws/aws-cdk/commit/8d9b58bbf58c0b7281dbce79720e471e533a18c0)), closes [#3895](https://github.com/aws/aws-cdk/issues/3895) +* **ec2:** add `privateIpAddress` to Instance ([a00906d](https://github.com/aws/aws-cdk/commit/a00906d22317103156acacc597623aafa660acbb)), closes [#4004](https://github.com/aws/aws-cdk/issues/4004) +* **ec2:** support block devices for `Instance` ([#5567](https://github.com/aws/aws-cdk/issues/5567)) ([1085a27](https://github.com/aws/aws-cdk/commit/1085a27d6d57621b47f415a3e2a11166702e8709)), closes [#4773](https://github.com/aws/aws-cdk/issues/4773) [#4781](https://github.com/aws/aws-cdk/issues/4781) +* **ecr-assets:** custom docker files ([#5652](https://github.com/aws/aws-cdk/issues/5652)) ([1b25a4b](https://github.com/aws/aws-cdk/commit/1b25a4b44e992f076d0bcf2d805880fdbebca34a)) +* **ecs-patterns:** higher-level constructs for ECS service with multiple target groups ([#5083](https://github.com/aws/aws-cdk/issues/5083)) ([c0a7192](https://github.com/aws/aws-cdk/commit/c0a7192c7a3b4a69a0415af679c684f7783c95c8)) +* **eks:** EKS-Optimized AMI with GPU support for G4 instance ([#5479](https://github.com/aws/aws-cdk/issues/5479)) ([7b34d56](https://github.com/aws/aws-cdk/commit/7b34d5635ecda5db337dfab32711443f57ad1518)) +* **eks:** helm chart support ([#5390](https://github.com/aws/aws-cdk/issues/5390)) ([394313e](https://github.com/aws/aws-cdk/commit/394313ee931e38bc20fc3dcb1cd2fd1b6f66822e)) +* **glue:** add support for more DataFormats ([#5246](https://github.com/aws/aws-cdk/issues/5246)) ([ca535d0](https://github.com/aws/aws-cdk/commit/ca535d0b1f1e993e3cc452e9ebc2a4a268032998)) +* **lambda:** configuration for async invocations ([#5299](https://github.com/aws/aws-cdk/issues/5299)) ([746ba32](https://github.com/aws/aws-cdk/commit/746ba3247a86a0cca60a1bb7897dd12848d904e9)) +* **logs:** import a LogGroup from its name ([#5580](https://github.com/aws/aws-cdk/issues/5580)) ([9cbbaea](https://github.com/aws/aws-cdk/commit/9cbbaeae66311921c2db459e91f2a6943628577e)) +* **rds:** more extensive secret rotation support ([#5281](https://github.com/aws/aws-cdk/issues/5281)) ([b700b77](https://github.com/aws/aws-cdk/commit/b700b778e74822e520867dbc5ff5524fb0c82eaf)), closes [#5194](https://github.com/aws/aws-cdk/issues/5194) +* **codebuild:** add Secrets Manager to CodeBuild environment variable types ([#5464](https://github.com/aws/aws-cdk/issues/5464)) ([ff1fa68](https://github.com/aws/aws-cdk/commit/ff1fa68408136f9677326f0d2d92a891396c0709)) + + +### Bug Fixes + +* **autoscaling:** every deployment resets capacity ([#5507](https://github.com/aws/aws-cdk/issues/5507)) ([0adf6c7](https://github.com/aws/aws-cdk/commit/0adf6c75c1f0aa4acc131915970a496326dc559f)), closes [#5215](https://github.com/aws/aws-cdk/issues/5215) [#5208](https://github.com/aws/aws-cdk/issues/5208) +* **aws-cdk:** upgrade canaries lambda node version ([#5674](https://github.com/aws/aws-cdk/issues/5674)) ([96b802b](https://github.com/aws/aws-cdk/commit/96b802b23f347a83617aa292e320cee20793b0c1)) +* **codebuild:** ARM images have the wrong type and compute kind ([#5541](https://github.com/aws/aws-cdk/issues/5541)) ([6999baf](https://github.com/aws/aws-cdk/commit/6999baf4c493ce618e66c3a4e4f6f4970540a5d1)), closes [#5517](https://github.com/aws/aws-cdk/issues/5517) +* **codebuild:** cannot use immutable roles for Project ([6103180](https://github.com/aws/aws-cdk/commit/6103180c5427bb887fe1734330b109579874649d)), closes [#1408](https://github.com/aws/aws-cdk/issues/1408) +* **codebuild:** rename CodeBuild VPC policy to be unique ([#5385](https://github.com/aws/aws-cdk/issues/5385)) ([16a1200](https://github.com/aws/aws-cdk/commit/16a1200b7132f72772a5d5230e137f793cd56d7a)) +* **core:** nested Fn.join with token fails ([#5679](https://github.com/aws/aws-cdk/issues/5679)) ([24ded60](https://github.com/aws/aws-cdk/commit/24ded60d82482b17bb08f98cba262f4f9bd23493)), closes [#5655](https://github.com/aws/aws-cdk/issues/5655) +* **cli:** java sample-app init template does not have a src/ directory ([#5546](https://github.com/aws/aws-cdk/issues/5546)) ([71947b5](https://github.com/aws/aws-cdk/commit/71947b5d7417e9ff26b59f16b6610fd176195662)) +* **core:** nested stacks does not report missing context [#5594](https://github.com/aws/aws-cdk/issues/5594) ([#5638](https://github.com/aws/aws-cdk/issues/5638)) ([9472e09](https://github.com/aws/aws-cdk/commit/9472e0956c9e2ebe657462afe581fab5675c55cd)) +* **core:** tags not working for cognito user pools ([#4225](https://github.com/aws/aws-cdk/issues/4225)) ([a67f0ef](https://github.com/aws/aws-cdk/commit/a67f0efb736f71ee8dd9c9ec31f8c867618849df)), closes [#3882](https://github.com/aws/aws-cdk/issues/3882) +* **custom-resources:** default timeout of 2 minutes for AwsCustomResource ([#5658](https://github.com/aws/aws-cdk/issues/5658)) ([e0c41d4](https://github.com/aws/aws-cdk/commit/e0c41d4246fc0588a298bb27efd743fc05439b36)) +* **ec2:** allow ingress to VPC interface endpoints ([#4938](https://github.com/aws/aws-cdk/issues/4938)) ([d5ed97a](https://github.com/aws/aws-cdk/commit/d5ed97a84d91e4eb7b13c11c4b0b826625f564d4)), closes [#4937](https://github.com/aws/aws-cdk/issues/4937) +* **eks:** aws-auth username not set by default ([#5649](https://github.com/aws/aws-cdk/issues/5649)) ([87befa6](https://github.com/aws/aws-cdk/commit/87befa6f725072cb0fa3712e8819f97ef3698602)), closes [#5263](https://github.com/aws/aws-cdk/issues/5263) +* **eks:** default capacity uses desiredCapacity which is an anti-pattern ([#5651](https://github.com/aws/aws-cdk/issues/5651)) ([a883fed](https://github.com/aws/aws-cdk/commit/a883fed02a520068221c91ea3755cf63dd493f4e)), closes [#5215](https://github.com/aws/aws-cdk/issues/5215) [#5507](https://github.com/aws/aws-cdk/issues/5507) [#5650](https://github.com/aws/aws-cdk/issues/5650) +* **eks:** failures when creating or updating clusters ([#5540](https://github.com/aws/aws-cdk/issues/5540)) ([a13cfe6](https://github.com/aws/aws-cdk/commit/a13cfe683412f81198f65aa7639d52100ce3aa17)), closes [#5544](https://github.com/aws/aws-cdk/issues/5544) [#4087](https://github.com/aws/aws-cdk/issues/4087) [#4695](https://github.com/aws/aws-cdk/issues/4695) [#5259](https://github.com/aws/aws-cdk/issues/5259) [#5501](https://github.com/aws/aws-cdk/issues/5501) +* **eks:** generated cluster name can exceed 100 characters ([#5597](https://github.com/aws/aws-cdk/issues/5597)) ([3256a41](https://github.com/aws/aws-cdk/commit/3256a41787c365a67b01bee193bd75e48645f7a0)), closes [#5596](https://github.com/aws/aws-cdk/issues/5596) +* **eks:** kubernetes cannot create external load balancers ([#5448](https://github.com/aws/aws-cdk/issues/5448)) ([384d22d](https://github.com/aws/aws-cdk/commit/384d22da7198c1885df019e3cf985c16c59a825b)), closes [#5443](https://github.com/aws/aws-cdk/issues/5443) +* **iam:** policy added to resource for immutable Role ([#5568](https://github.com/aws/aws-cdk/issues/5568)) ([950a5f7](https://github.com/aws/aws-cdk/commit/950a5f76185f7e1197f006535d2638c6e79db2d2)) +* **java:** resolve Java class naming error ([#5602](https://github.com/aws/aws-cdk/issues/5602)) ([e9ede13](https://github.com/aws/aws-cdk/commit/e9ede138b7681115f1fdf9e60b710fabd5bf14b4)) +* **rds:** do not allow aurora engines when using DatabaseInstance ([#5367](https://github.com/aws/aws-cdk/issues/5367)) ([03b3b7a](https://github.com/aws/aws-cdk/commit/03b3b7a9ea0f8449e60d46370e9e4daec81d7c54)), closes [#5345](https://github.com/aws/aws-cdk/issues/5345) +* **s3n:** s3n lambda destination works with function by arn ([#5599](https://github.com/aws/aws-cdk/issues/5599)) ([7ceee6d](https://github.com/aws/aws-cdk/commit/7ceee6dacc268a3e2daecbec254c59886d28add6)), closes [#5592](https://github.com/aws/aws-cdk/issues/5592) +* **stepfunctions:** permission race condition on state machine deletion ([#5466](https://github.com/aws/aws-cdk/issues/5466)) ([c3ac965](https://github.com/aws/aws-cdk/commit/c3ac965b5c4cb816e9ecc974b741dc7e29fb86b1)), closes [#5336](https://github.com/aws/aws-cdk/issues/5336) +* **tests:** flaky integration tests in release pipeline ([#5485](https://github.com/aws/aws-cdk/issues/5485)) ([01800cf](https://github.com/aws/aws-cdk/commit/01800cfd848b84a3d7646738128946ef58eebf60)) +* increase IAM wait timeout in integ test ([#5504](https://github.com/aws/aws-cdk/issues/5504)) ([f10b3e6](https://github.com/aws/aws-cdk/commit/f10b3e64feab9c9ccc78c9820dc99a8b6b0971ec)) + +## [1.19.0](https://github.com/aws/aws-cdk/compare/v1.18.0...v1.19.0) (2019-12-17) + + +### ⚠ BREAKING CHANGES + +* **route53:** the value of `hostedZoneId` will no longer include `/hostedzone/` prefix and only includes the hostedZoneId when using `HostedZone.fromLookup` or `fromHostedZoneAttributes` +* **cloudfront:** (experimental module) `S3OriginConfig.originAccessIdentityId` or type `string` has been removed in favor of `S3OriginConfig.originAccessIdentity` of type `IOriginAccessIdentity`. + +### Features + +* **appsync:** add L2 constuct for AppSync ([#4438](https://github.com/aws/aws-cdk/issues/4438)) ([226b27a](https://github.com/aws/aws-cdk/commit/226b27afe719093d074187bafb84231448e7b933)) +* **cfnspec:** Update CloudFormation spec to v10.1.0 ([#5431](https://github.com/aws/aws-cdk/issues/5431)) ([ac905ac](https://github.com/aws/aws-cdk/commit/ac905aca92f2d3484b95739e16a796a49df6bcf6)) +* **cli:** always exit with 0 on cdk diff (under feature flag) ([#4721](https://github.com/aws/aws-cdk/issues/4721)) ([3ffd810](https://github.com/aws/aws-cdk/commit/3ffd810879eae4144778a9a5c995aad88fa6d9d8)), closes [#4650](https://github.com/aws/aws-cdk/issues/4650) [#4708](https://github.com/aws/aws-cdk/issues/4708) +* **cloudformation:** import CloudFormation resource specification v9.1.1 ([#5297](https://github.com/aws/aws-cdk/issues/5297)) ([7f33541](https://github.com/aws/aws-cdk/commit/7f33541146ed96acb0ef8123f6a91e36d56e3e4e)) +* **cloudformation:** update Resource Specification to v10.0.0 ([#5339](https://github.com/aws/aws-cdk/issues/5339)) ([3db8565](https://github.com/aws/aws-cdk/commit/3db856573498214e57afb9ffbf30697ba152e7b5)), closes [#5302](https://github.com/aws/aws-cdk/issues/5302) +* **cloudfront:** CloudFrontOriginAccessIdentity ([#4491](https://github.com/aws/aws-cdk/issues/4491)) ([8623fe5](https://github.com/aws/aws-cdk/commit/8623fe56d0d38bc9e02f1742601014924bd5250f)) +* **codebuild:** support AL2 2.0 & Standard 3.0 ([#5226](https://github.com/aws/aws-cdk/issues/5226)) ([e6ef981](https://github.com/aws/aws-cdk/commit/e6ef98127d070e7e5aabf839cecc198594700e1b)) +* **codebuild:** Support ARM-based AL2 image ([#5233](https://github.com/aws/aws-cdk/issues/5233)) ([8fc5622](https://github.com/aws/aws-cdk/commit/8fc562222f4a6ff37c125247b2a4a532524aba8a)) +* **codepipeline:** allow retrieving created stages and actions ([#5206](https://github.com/aws/aws-cdk/issues/5206)) ([a5b056b](https://github.com/aws/aws-cdk/commit/a5b056b71e57b79aa568434fbe98bca207f2113f)), closes [#4878](https://github.com/aws/aws-cdk/issues/4878) +* **ec2:** access gateways created by NatProvider ([#4948](https://github.com/aws/aws-cdk/issues/4948)) ([5907055](https://github.com/aws/aws-cdk/commit/590705586eb545c2c55cea1c0733b6d5f0876765)), closes [#4858](https://github.com/aws/aws-cdk/issues/4858) +* **ec2:** Add missing EC2 instance types ([#5349](https://github.com/aws/aws-cdk/issues/5349)) ([#5350](https://github.com/aws/aws-cdk/issues/5350)) ([bc161d6](https://github.com/aws/aws-cdk/commit/bc161d6e2db80091fd82dc7b13a450fff5a7aa80)) +* **ec2:** Add REKOGNITION_FIPS interface endpoint ([#5316](https://github.com/aws/aws-cdk/issues/5316)) ([b291280](https://github.com/aws/aws-cdk/commit/b291280d82677ae4f58ee1f78c44803b194864fd)), closes [#5314](https://github.com/aws/aws-cdk/issues/5314) +* **ecs:** Add support for ECS DeploymentController ([#5402](https://github.com/aws/aws-cdk/issues/5402)) ([58e67e6](https://github.com/aws/aws-cdk/commit/58e67e6185fae008d797c68417f1653b1ecee2d6)) +* **ecs-patterns:** healthyPercent on ALB, NLB, Fargate ([#4820](https://github.com/aws/aws-cdk/issues/4820)) ([150e65c](https://github.com/aws/aws-cdk/commit/150e65cababe8ba44183436b9964f7b70f47eb0c)) +* **events:** add static grantPutEvents() to EventBus ([#5133](https://github.com/aws/aws-cdk/issues/5133)) ([0823396](https://github.com/aws/aws-cdk/commit/08233965e7a1a32e518b08a4d6671ffe702a239d)) +* **lambda:** function can be attached to a list of security groups in the vpc ([#5049](https://github.com/aws/aws-cdk/issues/5049)) ([4c1a9ec](https://github.com/aws/aws-cdk/commit/4c1a9ec2fbb08b7d3406e767e69e43a42fd935a9)) +* **lambda:** provisioned concurrency ([#5308](https://github.com/aws/aws-cdk/issues/5308)) ([d50344a](https://github.com/aws/aws-cdk/commit/d50344abb643f6f2c200bba15cfce4d469485dd9)), closes [#5298](https://github.com/aws/aws-cdk/issues/5298) +* **region-info:** throw exception when no fact found ([#5166](https://github.com/aws/aws-cdk/issues/5166)) ([88df1eb](https://github.com/aws/aws-cdk/commit/88df1ebdbe9faf3717ed32a7daf96e3668bb483e)), closes [#3194](https://github.com/aws/aws-cdk/issues/3194) +* **sns:** support KMS masterKey on SNS ([#5052](https://github.com/aws/aws-cdk/issues/5052)) ([edd5395](https://github.com/aws/aws-cdk/commit/edd53959af38969339205a5c33aaab11acc72fa6)), closes [#1729](https://github.com/aws/aws-cdk/issues/1729) +* Make activating Python virtualenv easier on Windows ([#5014](https://github.com/aws/aws-cdk/issues/5014)) ([fc73747](https://github.com/aws/aws-cdk/commit/fc73747cc7c56ba7e2911745c3dc92e2d25b001b)) + + +### Bug Fixes + +* **apigateway:** unable to enable cors with a root proxy and LambdaRestApi ([#5249](https://github.com/aws/aws-cdk/issues/5249)) ([f3d5fc9](https://github.com/aws/aws-cdk/commit/f3d5fc98fefdf379f62925bbdf30bb7eecfa0a52)), closes [#5232](https://github.com/aws/aws-cdk/issues/5232) +* **cdk-dasm:** prevent duplicate imports ([#5293](https://github.com/aws/aws-cdk/issues/5293)) ([d4562b7](https://github.com/aws/aws-cdk/commit/d4562b78627599f5f2efbaf6573addd51ee932e2)) +* **cli:** fix the behaviour for the `--generate-only` flag ([#5253](https://github.com/aws/aws-cdk/issues/5253)) ([ecbe0b6](https://github.com/aws/aws-cdk/commit/ecbe0b6ab2e652454d561879f699821bfb18b81a)) +* **cli:** this.node.addError does not cause `cdk diff` to fail [#4700](https://github.com/aws/aws-cdk/issues/4700) ([#5284](https://github.com/aws/aws-cdk/issues/5284)) ([1b12dba](https://github.com/aws/aws-cdk/commit/1b12dba660acbff1b64780198db768f9b4f481ed)) +* **cloudfront:** associated lambda role requires edgelambda.amazonaws.com ([#5191](https://github.com/aws/aws-cdk/issues/5191)) ([173d886](https://github.com/aws/aws-cdk/commit/173d8862f3ad8237357f4704c16ddfbcc0708a04)), closes [#5180](https://github.com/aws/aws-cdk/issues/5180) +* **codebuild:** add deprecation warning for UBUNTU_14_04 ([#5234](https://github.com/aws/aws-cdk/issues/5234)) ([c1b575f](https://github.com/aws/aws-cdk/commit/c1b575fb7ecc864600769d0fff2e85dc2e84db9c)) +* **codepipeline:** CloudFormation deployment role always gets pipeline bucket and key permissions ([#5190](https://github.com/aws/aws-cdk/issues/5190)) ([d5c0f3e](https://github.com/aws/aws-cdk/commit/d5c0f3edd9b4315ad208af4d2a4308ec80f273ce)), closes [#5183](https://github.com/aws/aws-cdk/issues/5183) +* **core:** dependencies across stack boundaries of all kinds ([#5211](https://github.com/aws/aws-cdk/issues/5211)) ([d1f0dd5](https://github.com/aws/aws-cdk/commit/d1f0dd5b3192877329879e058f5cffb9b312cef5)), closes [#4460](https://github.com/aws/aws-cdk/issues/4460) [#4474](https://github.com/aws/aws-cdk/issues/4474) +* **dockerfile:** `docker build` is missing `dotnet` ([#5091](https://github.com/aws/aws-cdk/issues/5091)) ([18fa3aa](https://github.com/aws/aws-cdk/commit/18fa3aa985346d7764da0d700fdc70011b5e44ad)) +* **docs:** update removed subscribeLambda method example ([#5060](https://github.com/aws/aws-cdk/issues/5060)) ([d2a86a5](https://github.com/aws/aws-cdk/commit/d2a86a575377737b7d5772afb6d012aa80fa2b0f)) +* **dynamodb:** add missing permission for read stream data ([#5074](https://github.com/aws/aws-cdk/issues/5074)) ([22688ce](https://github.com/aws/aws-cdk/commit/22688ce838de5cd97d8ef3cf9694ce2e346d00dd)) +* **dynamodb:** stacks created by GlobalTable correctly inherit their account. ([#5202](https://github.com/aws/aws-cdk/issues/5202)) ([5ad5407](https://github.com/aws/aws-cdk/commit/5ad54075fb3f7e363ab63c9cf02e01e1db4685b5)), closes [#4882](https://github.com/aws/aws-cdk/issues/4882) +* **ec2:** can't add non-default routes to subnets ([#5332](https://github.com/aws/aws-cdk/issues/5332)) ([e4309ab](https://github.com/aws/aws-cdk/commit/e4309abf07f3b0cc9f2f2f89789f14669f3d3581)) +* **ec2:** CIDR for "any" IPv6 too long ([#5179](https://github.com/aws/aws-cdk/issues/5179)) ([3695d8c](https://github.com/aws/aws-cdk/commit/3695d8c64e070efc9b3ea42384aaf24e12af18ce)) +* **ec2:** Fix CODEBUILD_FIPS interface endpoint ([#5315](https://github.com/aws/aws-cdk/issues/5315)) ([465c848](https://github.com/aws/aws-cdk/commit/465c8484c65acc69141acd3dad6a61e5955e7cc6)) +* **ecr:** remove deprecated requirement on docs and comments ([#5428](https://github.com/aws/aws-cdk/issues/5428)) ([40ec78e](https://github.com/aws/aws-cdk/commit/40ec78e31cb476d42b329fee2cf35aaed7faed02)), closes [#2857](https://github.com/aws/aws-cdk/issues/2857) [#2857](https://github.com/aws/aws-cdk/issues/2857) [#3273](https://github.com/aws/aws-cdk/issues/3273) +* **init-templates:** use pytest for Python sample-app init template ([#5325](https://github.com/aws/aws-cdk/issues/5325)) ([6c25da7](https://github.com/aws/aws-cdk/commit/6c25da77089d38954d75d9b726b8b92845546057)), closes [#5313](https://github.com/aws/aws-cdk/issues/5313) +* **route53:** return plain hosted zone id without /hostedzone/ prefix ([#5230](https://github.com/aws/aws-cdk/issues/5230)) ([5e08753](https://github.com/aws/aws-cdk/commit/5e0875341fae8eee4489bcda495a6dcc246cad63)) +* **sfn:** Task `parameters` property does nothing ([#5408](https://github.com/aws/aws-cdk/issues/5408)) ([01df7c6](https://github.com/aws/aws-cdk/commit/01df7c659bd8734f927b981e6e40aa675999671a)), closes [#5267](https://github.com/aws/aws-cdk/issues/5267) +* **test:** fix .nycrc symlinking ([#5245](https://github.com/aws/aws-cdk/issues/5245)) ([d2496e0](https://github.com/aws/aws-cdk/commit/d2496e0e1e4fa0b15604fa089105854e8e937e1f)) + +## [1.18.0](https://github.com/aws/aws-cdk/compare/v1.17.1...v1.18.0) (2019-11-25) + +### General Availability of AWS CDK for .NET and Java!! 🎉🎉🥂🥂🍾🍾 + +We are excited to announce the general availability of support for the .NET family of languages (C#, +F#, ...) as well as Java! + +We want to express our gratitude to all of our early customers as well as the amazing contributors +for all the help and support in making this release possible. Thank you for all the feedback +provided during the Developer Preview of .NET and Java support, without which the product would not +be what it is today. + +Special thanks go out to a handful of amazing people who have provided instrumental support in +bringing .NET and Java support to this point: + +* [Aaron Costley](http://github.com/costleya) +* [Ben Maizels](http://github.com/bmaizels) +* [Daniel Dinu](http://github.com/ddinu) +* [Erik Karlsson](http://github.com/McDoit) +* [Hamza Assyad](http://github.com/assyadh) +* [Jerry Kindall](http://github.com/Jerry-AWS) +* [Noah Litov](http://github.com/NGL321) +* [Richard Boyd](http://github.com/rhboyd) + + +Of course, we continue to be amazed and thrilled by the community contributions we received besides +language support. The passion demonstrated by the CDK community is heartwarming and largely +contributes to making maintaining the CDK an enjoyable, enriching experience! + +### Features + +* **lambda:** node12.x, python3.8 and java11 runtimes ([#5107](https://github.com/aws/aws-cdk/issues/5107)) ([e62f9fb](https://github.com/aws/aws-cdk/commit/e62f9fbe6b5658e9aad41452c6b8aecbc2fa94bc)) +* **lambda:** unlock the lambda environment variables restriction in China regions ([#5122](https://github.com/aws/aws-cdk/issues/5122)) ([cc13009](https://github.com/aws/aws-cdk/commit/cc1300929b7823669a958283a1ed48311ce77e37)) + + +### Bug Fixes + +* **init/chsarp:** correct README for sample-app C# template ([#5144](https://github.com/aws/aws-cdk/issues/5144)) ([b2031f6](https://github.com/aws/aws-cdk/commit/b2031f673356a170012a48235a12e576ed4219f9)) +* **init/sample-app:** numerous fixes and additions to the sample-app init templates ([#5119](https://github.com/aws/aws-cdk/issues/5119)) ([02c3b05](https://github.com/aws/aws-cdk/commit/02c3b0592b9640221909b8dd494f1dfc93b53539)), closes [#5130](https://github.com/aws/aws-cdk/issues/5130) [#5130](https://github.com/aws/aws-cdk/issues/5130) +* **init/java:** add -e to mvn command so errors aren't hidden ([#5129](https://github.com/aws/aws-cdk/issues/5129)) ([5427106](https://github.com/aws/aws-cdk/commit/5427106efab1629218c225c0e85dd627bf2ec76f)), closes [#5128](https://github.com/aws/aws-cdk/issues/5128) +* **init/csharp:** .NET semantic fixes for init templates ([#5154](https://github.com/aws/aws-cdk/issues/5154)) ([04a1b32](https://github.com/aws/aws-cdk/commit/04a1b326b7162896218ee8d2d3acd51353ddedfd)) + +### Known Issues + +The following known issues were identified that specifically affect .NET and Java support in the CDK, +and which will be promptly addressed in upcoming CDK releases (in no particular order). See the +GitHub issues for more information and workarounds where applicable. + +* **.NET** and **Java**: [`aws/jsii#1011`] - abstract members are not marked as such on their **.NET** and **Java** representations +* **.NET**: [`aws/jsii#1029`] - user-defined classes implementing CDK interfaces must extend `Amazon.Jsii.Runtime.Deputy.DeputyBase` +* **.NET**: [`aws/jsii#1042`] - Parameters typed object accept only primitive types, instances of CDK types, `Dictionary` +* **.NET**: [`aws/jsii#1044`] - Unable to pass interface instance through in a `Dictionary` +* **Java**: [`aws/jsii#1034`] - Implementing or overriding overloaded methods in Java does not work consistently +* **Java**: [`aws/jsii#1035`] - Returning `Lazy.anyValue` from an method whose return type is `java.lang.Object` may result in Resolution Errors +* **Java**: [`aws/jsii#1005`] - property getter implementations (e.g: from an interface) may be ignored + +[`aws/jsii#1011`]: https://github.com/aws/jsii/issues/1011 +[`aws/jsii#1029`]: https://github.com/aws/jsii/issues/1029 +[`aws/jsii#1042`]: https://github.com/aws/jsii/issues/1042 +[`aws/jsii#1044`]: https://github.com/aws/jsii/issues/1044 +[`aws/jsii#1034`]: https://github.com/aws/jsii/issues/1034 +[`aws/jsii#1035`]: https://github.com/aws/jsii/issues/1035 +[`aws/jsii#1005`]: https://github.com/aws/jsii/issues/1005 +[TypeScript API Reference]: https://docs.aws.amazon.com/cdk/api/latest/typescript/api/index.html + ## [1.17.1](https://github.com/aws/aws-cdk/compare/v1.17.0...v1.17.1) (2019-11-19) @@ -30,6 +385,14 @@ All notable changes to this project will be documented in this file. See [standa * **init-templates:** update init templates for csharp and java ([#5059](https://github.com/aws/aws-cdk/issues/5059)) ([2d92ab3](https://github.com/aws/aws-cdk/commit/2d92ab3e22130408056257d87620a3e03d75b226)) * **logs:** cannot use same Lambda for multiple SubscriptionFilters ([#4975](https://github.com/aws/aws-cdk/issues/4975)) ([94f5017](https://github.com/aws/aws-cdk/commit/94f501729af80e17eee67c9107a897840d8347ce)), closes [#4951](https://github.com/aws/aws-cdk/issues/4951) +## [1.16.3](https://github.com/aws/aws-cdk/compare/v1.16.2...v1.16.3) (2019-11-13) + + +### Bug Fixes + +* **ecs-patterns:** Fix issue related to protocol being passed to target group ([#4988](https://github.com/aws/aws-cdk/issues/4988)) ([6bb29b5](https://github.com/aws/aws-cdk/commit/6bb29b5b7d4ed200ebb0e217f2f4de2630fa18cd)) +* **core:** unable to find stack by name using the cli in legacy mode ([#4998](https://github.com/aws/aws-cdk/issues/4998)) ([26bba19](https://github.com/aws/aws-cdk/commit/26bba196abc6e67b3d6424b281beee6aa60079d3)) + ## [1.16.2](https://github.com/aws/aws-cdk/compare/v1.16.1...v1.16.2) (2019-11-12) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86f9c0ccb0a8d..01355b0f529fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,7 @@ and let us know if it's not up-to-date (even better, submit a PR with your corr - [Updating all Dependencies](#updating-all-dependencies) - [Running CLI integration tests](#running-cli-integration-tests) - [API Compatibility Checks](#api-compatibility-checks) + - [Examples](#examples) - [Feature Flags](#feature-flags) - [Troubleshooting](#troubleshooting) - [Debugging](#debugging) @@ -44,23 +45,26 @@ and let us know if it's not up-to-date (even better, submit a PR with your corr ## Getting Started -For day-to-day development and normal contributions, [Node.js ≥ 10.3.0](https://nodejs.org/download/release/latest-v10.x/) -with [Yarn >= 1.19.1](https://yarnpkg.com/lang/en/docs/install) should be sufficient. +For day-to-day development and normal contributions, the following SDKs and tools are required: + - [Node.js 10.3.0](https://nodejs.org/download/release/latest-v10.x/) + - [Yarn >= 1.19.1](https://yarnpkg.com/lang/en/docs/install) + - [Java OpenJDK 8](http://openjdk.java.net/install/) + - [.NET Core SDK 3.0](https://www.microsoft.com/net/download) + - [Python 3.6.5](https://www.python.org/downloads/release/python-365/) + - [Ruby 2.5.1](https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-5-1-released/) + +The basic commands to get the repository cloned and built locally follow: ```console $ git clone https://github.com/aws/aws-cdk.git $ cd aws-cdk +$ yarn install $ yarn build ``` -If you wish to produce language bindings through `pack.sh`, you will need the following toolchains -installed, or use the Docker workflow. - - - [Node.js 10.3.0](https://nodejs.org/download/release/latest-v10.x/) - - [Java OpenJDK 8](http://openjdk.java.net/install/) - - [.NET Core 2.0](https://www.microsoft.com/net/download) - - [Python 3.6.5](https://www.python.org/downloads/release/python-365/) - - [Ruby 2.5.1](https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-5-1-released/) +Alternatively, the [Full Docker build](#full-docker-build) workflow can be used so +that you don't have to worry about installing all those tools on your local machine +and instead only depend on having a working Docker install. ## Pull Requests @@ -126,6 +130,37 @@ Work your magic. Here are some guidelines: changes along the way, but try to avoid conflating multiple features. Eventually all these are going to go into a single commit, so you can use that to frame your scope. +#### Integration Tests + +Integration tests perform a few functions in the CDK code base - +1. Acts as a regression detector. It does this by running `cdk synth` on the integration test and comparing it against + the `*.expected.json` file. This highlights how a change affects the synthesized stacks. +2. Allows for a way to verify if the stacks are still valid CloudFormation templates, as part of an intrusive change. + This is done by running `yarn integ` which will run `cdk deploy` across all of the integration tests in that package. + Remember to set up AWS credentials before doing this. +3. (Optionally) Acts as a way to validate that constructs set up the CloudFormation resources as expected. A successful + CloudFormation deployment does not mean that the resources are set up correctly. + +If you are working on a new feature that is using previously unused CloudFormation resource types, or involves +configuring resource types across services, you need to write integration tests that use these resource types or +features. + +To the extent possible, include a section (like below) in the integration test file that specifies how the successfully +deployed stack can be verified for correctness. Correctness here implies that the resources have been set up correctly. +The steps here are usually AWS CLI commands but they need not be. + +```ts +/* + * Stack verification steps: + * * + * * + */ +``` + +Examples: +* [integ.destinations.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-lambda-destinations/test/integ.destinations.ts#L7) +* [integ.token-authorizer.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.ts#L6) + ### Step 4: Commit Create a commit with the proposed change changes: @@ -198,7 +233,7 @@ The build process is divided into stages, so you can invoke them as needed from - __`yarn build`__: runs the `build` and `test` commands in all modules (in topological order). - __`yarn pack`__: packages all modules to all supported languages and produces a `dist/` directory with all the outputs - (running this script requires that you installed the [toolchains](#Toolchains) for all target languages on your + (running this script requires that you installed the [toolchains](#getting-started) for all target languages on your system). ### Partial build tools @@ -299,10 +334,17 @@ if a task fails, it will stop, and then to resume, simply run `foreach.sh` again To reset the session (either when all tasks finished or if you wish to run a different session), run: ```console -$ rm -f ~/.foreach.* +$ scripts/foreach.sh --reset ``` -This will effectively delete the state files. +If you wish to run a command only against a module's dependency closure, use: + +```console +$ cd packages/my-module +$ ../scripts/foreach.sh --up COMMAND +``` + +This will execute `COMMAND` against `my-module` and all it's deps (in a topological order of course). ### Jetbrains support (WebStorm/IntelliJ) @@ -333,7 +375,7 @@ $ ./install.sh $ yarn build ``` -If you also wish to package to all languages, make sure you have all the [toolchains](#Toolchains) and now run: +If you also wish to package to all languages, make sure you have all the [toolchains](#getting-started) and now run: ``` $ ./pack.sh @@ -367,11 +409,14 @@ $ docker run -v $(pwd):/app -w /app aws-cdk In many cases, you don't really need to build the entire project. Say you want to work on the `@aws-cdk/aws-ec2` module: ```console -$ ./install.sh +$ yarn install $ cd packages/@aws-cdk/aws-ec2 $ ../../../scripts/buildup ``` +Note that `buildup` uses `foreach.sh`, which means it's resumable. If your build fails and you wish to resume, just run +`buildup --resume`. If you wish to restart, run `buildup` again. + ### Quick Iteration After you've built the modules you want to work on once, use `lr watch` for each module that you are modifying. @@ -448,7 +493,7 @@ Guidelines: * Make sure dependencies are defined using [caret ranges](https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004) (e.g. `^1.2.3`). This enables non-breaking updates to automatically be picked up. - * Make sure `package-lock.json` files are included in your commit. + * Make sure `yarn.lock` is included in your commit. ### Finding dependency cycles between packages @@ -471,7 +516,7 @@ Cycle: @aws-cdk/aws-sns => @aws-cdk/aws-lambda => @aws-cdk/aws-codecommit => @aw To update all dependencies (without bumping major versions): 1. Obtain a fresh clone from "master". -2. Run `./install.sh` +2. Run `yarn install` 3. Run `./scripts/update-dependencies.sh --mode full` (use `--mode semver` to avoid bumping major versions) 4. Submit a Pull Request. @@ -515,6 +560,62 @@ this API we will not break anyone, because they weren't able to use it. The file `allowed-breaking-changes.txt` in the root of the repo is an exclusion file that can be used in these cases. +### Examples + +Examples typed in fenced code blocks (looking like `'''ts`, but then with backticks +instead of regular quotes) will be automatically extrated, compiled and translated +to other languages when the bindings are generated. + +To successfully do that, they must be compilable. The easiest way to do that is using +a *fixture*, which looks like this: + +``` +'''ts fixture=with-bucket +bucket.addLifecycleTransition({ ... }); +''' +``` + +While processing the examples, the tool will look for a file called +`rosetta/with-bucket.ts-fixture` in the package directory. This file will be +treated as a regular TypeScript source file, but it must also contain the text +`/// here`, at which point the example will be inserted. The complete file must +compile properly. + +Before the `/// here` marker, the fixture should import the necessary packages +and initialize the required variables. + +If no fixture is specified, the fixture with the name +`rosetta/default.ts-fixture` will be used if present. `nofixture` can be used to +opt out of that behavior. + +In an `@example` block, which is unfenced, the first line of the example can +contain three slashes to achieve the same effect: + +``` +/** + * @example + * /// fixture=with-bucket + * bucket.addLifecycleTransition({ ... }); + */ +``` + +When including packages in your examples (even the package you're writing the +examples for), use the full package name (e.g. `import s3 = +require('@aws-cdk/aws-s3);`). The example will be compiled in an environment +where all CDK packages are available using their public names. In this way, +it's also possible to import packages that are not in the dependency set of +the current package. + +For a practical example of how making sample code compilable works, see the +`aws-ec2` package. + +Examples of all packages are extracted and compiled as part of the packaging +step. If you are working on getting rid of example compilation errors of a +single package, you can run `scripts/compile-samples` on the package by itself. + +For now, non-compiling examples will not yet block the build, but at some point +in the future they will. + ### Feature Flags Sometimes we want to introduce new breaking behavior because we believe this is @@ -535,8 +636,8 @@ The pattern is simple: form `module.Type:feature` (e.g. `@aws-cdk/core:enableStackNameDuplicates`). 2. Use `node.tryGetContext(cxapi.ENABLE_XXX)` to check if this feature is enabled in your code. If it is not defined, revert to the legacy behavior. -3. Add your feature flag to - [cx-api/lib/future.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cx-api/lib/future.ts). +3. Add your feature flag to the `FUTURE_FLAGS` map in + [cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cx-api/lib/features.ts). This map is inserted to generated `cdk.json` files for new projects created through `cdk init`. 4. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g: @@ -547,9 +648,9 @@ The pattern is simple: 5. Under `BREAKING CHANGES` in your commit message describe this new behavior: ``` - BREAKING CHANGE: template file names for new projects created through "cdk init" - will use the template artifact ID instead of the physical stack name to enable - multiple stacks to use the same name. This is enabled through the flag + BREAKING CHANGE: template file names for new projects created through "cdk init" + will use the template artifact ID instead of the physical stack name to enable + multiple stacks to use the same name. This is enabled through the flag `@aws-cdk/core:enableStackNameDuplicates` in newly generated `cdk.json` files. ``` @@ -686,4 +787,3 @@ To debug your CDK application along with the CDK repository, * [Workshop](https://github.com/aws-samples/aws-cdk-intro-workshop): source for https://cdkworkshop.com * [Developer Guide](https://github.com/awsdocs/aws-cdk-guide): markdown source for developer guide * [jsii](https://github.com/aws/jsii): the technology we use for multi-language support. If you are looking to help us support new languages, start there. - diff --git a/Dockerfile b/Dockerfile index 2ff34c083d581..ac1830af4ec59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,39 +1,11 @@ -FROM amazonlinux:2 +FROM jsii/superchain WORKDIR /app -ENV NODE_VERSION 10.17.0 -ENV YARN_VERSION 1.19.1 - -RUN yum -y --security update \ - && yum install -y \ - git \ - rsync \ - zip \ - unzip \ - tar \ - xz \ - python3 \ - python3-dev \ - py3-setuptools \ - && yum clean all \ - && rm -rf /var/cache/yum \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt" \ - && grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ - && tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ - && ln -s /usr/local/bin/node /usr/local/bin/nodejs \ - && rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt \ - && gpg --list-keys 23E7166788B63E1E >/dev/null 2>&1 || (curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import) \ - && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ - && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ - && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ - && tar zvxf yarn-v$YARN_VERSION.tar.gz -C /usr/local --strip-components=1 --no-same-owner \ - && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz +ARG BUILD_ARGS COPY . . -RUN ./build.sh \ - && ./link-all.sh +RUN ./build.sh ${BUILD_ARGS} && ./link-all.sh ENTRYPOINT ["/app/node_modules/.bin/cdk"] diff --git a/LICENSE b/LICENSE index 46c185646b439..b71ec1688783a 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 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. diff --git a/README.md b/README.md index 33461f866603b..34fdaf211c532 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ infrastructure definition and share it without worrying about boilerplate logic. The CDK is available in the following languages: -* JavaScript, TypeScript (GA, [Node.js ≥ 10.3.0](https://nodejs.org/download/release/latest-v10.x/)) -* Python (GA, [Python ≥ 3.6](https://www.python.org/downloads/)) -* Java (Developer Preview, [Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi)) -* .NET (Developer Preview, [.NET Core ≥ 2.0](https://dotnet.microsoft.com/download)) +* JavaScript, TypeScript ([Node.js ≥ 10.3.0](https://nodejs.org/download/release/latest-v10.x/)) +* Python ([Python ≥ 3.6](https://www.python.org/downloads/)) +* Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi)) +* .NET ([.NET Core ≥ 3.0](https://dotnet.microsoft.com/download)) ------- @@ -29,7 +29,8 @@ The CDK is available in the following languages: [Getting Started](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html) | [API Reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html) | [Examples](https://github.com/aws-samples/aws-cdk-examples) | -[Getting Help](#getting-help) +[Getting Help](#getting-help) | +[RFCs](https://github.com/aws/aws-cdk-rfcs) Developers use the [CDK framework] in one of the supported programming languages to define reusable cloud components called [constructs], which @@ -51,7 +52,7 @@ on AWS. [apps]: https://docs.aws.amazon.com/cdk/latest/guide/apps_and_stacks.html#apps [Developer Guide]: https://docs.aws.amazon.com/cdk/latest/guide [AWS CDK CLI]: https://docs.aws.amazon.com/cdk/latest/guide/tools.html -[AWS Construct Library]: https://docs.aws.amazon.com/cdk/latest/guide/aws_construct_lib.html +[AWS Construct Library]: https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html ## At a glance diff --git a/allowed-breaking-changes.txt b/allowed-breaking-changes.txt index 402968212c43d..48d35a18122ba 100644 --- a/allowed-breaking-changes.txt +++ b/allowed-breaking-changes.txt @@ -12,6 +12,14 @@ removed:@aws-cdk/aws-apigateway.HttpIntegration.props removed:@aws-cdk/aws-apigateway.Integration.props removed:@aws-cdk/aws-apigateway.LambdaIntegration.props removed:@aws-cdk/aws-apigateway.MockIntegration.props +removed:@aws-cdk/aws-ecs-patterns.ScheduledEc2TaskDefinitionOptions.schedule +removed:@aws-cdk/aws-ecs-patterns.ScheduledEc2TaskDefinitionOptions.cluster +removed:@aws-cdk/aws-ecs-patterns.ScheduledEc2TaskDefinitionOptions.desiredTaskCount +removed:@aws-cdk/aws-ecs-patterns.ScheduledEc2TaskDefinitionOptions.vpc +removed:@aws-cdk/aws-ecs-patterns.ScheduledFargateTaskDefinitionOptions.schedule +removed:@aws-cdk/aws-ecs-patterns.ScheduledFargateTaskDefinitionOptions.cluster +removed:@aws-cdk/aws-ecs-patterns.ScheduledFargateTaskDefinitionOptions.desiredTaskCount +removed:@aws-cdk/aws-ecs-patterns.ScheduledFargateTaskDefinitionOptions.vpc incompatible-argument:@aws-cdk/aws-lambda.Function. incompatible-argument:@aws-cdk/aws-lambda.SingletonFunction. incompatible-argument:@aws-cdk/aws-lambda.Function.addEnvironment @@ -27,3 +35,8 @@ incompatible-argument:@aws-cdk/aws-servicediscovery.Service.fromServiceAttribute removed:@aws-cdk/core.ConstructNode.addReference removed:@aws-cdk/core.ConstructNode.references removed:@aws-cdk/core.OutgoingReference +change-return-type:@aws-cdk/aws-lambda-destinations.EventBridgeDestination.bind +change-return-type:@aws-cdk/aws-lambda-destinations.LambdaDestination.bind +change-return-type:@aws-cdk/aws-lambda-destinations.SnsDestination.bind +change-return-type:@aws-cdk/aws-lambda-destinations.SqsDestination.bind + diff --git a/buildspec.yaml b/buildspec.yaml index c38d30f692b6d..9d8f575942945 100644 --- a/buildspec.yaml +++ b/buildspec.yaml @@ -13,6 +13,7 @@ phases: - /bin/bash ./fetch-dotnet-snk.sh build: commands: + - /bin/bash ./scripts/align-version.sh - /bin/bash ./build.sh post_build: commands: diff --git a/bump.sh b/bump.sh index 1a2d6a7fdf72e..c7f7b0fe74873 100755 --- a/bump.sh +++ b/bump.sh @@ -17,18 +17,14 @@ version=${1:-minor} echo "Starting ${version} version bump" -export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" - -/bin/bash ./install.sh - -npx lerna version ${version} --yes --exact --force-publish=* --no-git-tag-version --no-push - -# Another round of install to fix package-lock.jsons -/bin/bash ./install.sh - -# align "peerDependencies" to actual dependencies after bump -# this is technically only required for major version bumps, but in the meantime we shall do it in every bump -/bin/bash scripts/fix-peer-deps.sh +# /bin/bash ./install.sh # Generate CHANGELOG and create a commit -npx standard-version --release --skip.tag=true --commit-all +# --skip.tag because we create the tag as part of creating the github release +npx standard-version \ + --bumpFiles package.json \ + --release-as ${version} \ + --skip.tag=true \ + --releaseCommitMessageFormat="chore(release): v{{currentTag}}" \ + --commit-all + diff --git a/design/cdk-assets.md b/design/cdk-assets.md new file mode 100644 index 0000000000000..543626341a677 --- /dev/null +++ b/design/cdk-assets.md @@ -0,0 +1 @@ +Moved to [aws-cdk-rfcs](https://github.com/aws/aws-cdk-rfcs/blob/master/text/0092-asset-publishing.md). \ No newline at end of file diff --git a/design/cdk-bootstrap.md b/design/cdk-bootstrap.md new file mode 100644 index 0000000000000..ddabe43b43caa --- /dev/null +++ b/design/cdk-bootstrap.md @@ -0,0 +1,341 @@ +# `cdk bootstrap` + +`cdk bootstrap` is a tool in the AWS CDK command-line interface responsible for populating a given environment +(that is, a combination of AWS account and region) +with resources required by the CDK to perform deployments into that environment. + +This document is a design for extending the capabilities of the `bootstrap` command motivated by the needs of the +["Continuous delivery for CDK apps"](https://github.com/aws/aws-cdk/pull/3437) epic. + +## Required changes + +### `--trust` + +We will add a new, optional command-line flag called `--trust` to the `bootstrap` command. +Its value is a list of AWS account IDs: + +```shell +$ cdk bootstrap \ + [--trust accountId[,otherAccountId]...] \ + [--cloudformation-execution-policies policyArn[,otherPolicyArn]...] \ + aws://account/region +``` + +**Note**: if a user wants to add new trusted account(s) to an existing bootstrap stack, +they have to specify all of the accounts they want to trust in the `--trust` option, +not only the one being newly added - +otherwise, the previously trusted account(s) will be removed. +We should make sure to make that explicit in the documentation of this option. + +We will also add a another option, +`--cloudformation-execution-policies`, +that allows you to pass a list of managed policy ARNs on the command line to attach to the +**CloudFormation Execution Role**. +This option will be required if `--trust` was passed. + +### Bootstrap resources + +The `bootstrap` command creates a CloudFormation stack in the environment passed on the command line. +Currently, the only resource in that stack is: + +* An S3 bucket that holds the file assets and the resulting CloudFormation template to deploy. + +We will add the following resources to the bootstrap stack: + +* An ECR repository that stores the images that are the results of building Docker assets. + +* An IAM role, called the **Publishing role**, + that has permissions to write to both the S3 bucket and the ECR repository from above. + This role will be assumable by any principal from the account(s) passed by the `--trust` option, + and from any principal in the target environment's account. + +* An IAM role, called the **Deployment Action Role**, + that will be assumed when executing the CloudFormation deployment actions + (CreateChangeSet and ExecuteChangeSet). + It is also assumable by any principal from the account(s) passed by the `--trust` option, + and from any principal in the target environment's account. + +* An IAM role, called the **CloudFormation Execution Role**, + that will be used to perform the actual CFN stack deployment in the continuous delivery pipeline to this environment. + It is assumable *only* by the CloudFormation service principal + (this is for security reasons, as this role will have, necessarily, very wide permissions). + It will not have any inline policies, + but will instead have the Managed Policies attached that the user passed in the + `--cloudformation-execution-policies` option. + +#### Physical resource names + +All of the above resources will be created with well-defined physical names - +none of them will rely on automated CloudFormation naming. +This is so that the other stages of CDK synthesis, +like asset resolution, can rely on the concrete names +(there is no reliable way to transfer this kind of information in an automated way across regions and/or accounts). +This also allows for more fine-grained permissions - +for instance, the continuous delivery pipeline needs to grant the **Deployment Action Role** +permissions to read from the pipeline's bucket +(to read the artifact that contains the CFN template to deploy); +this way, it can add a well-defined name to the resource policy of the artifact bucket, +instead of granting those permissions to all principals in the account. + +The naming scheme will include the following elements in order to minimize the chance of name collisions: + +* The region we're bootstrapping in. +* The account ID we're bootstrapping in. +* The type of the resource (file assets bucket, Docker assets repository, etc.). + +### Removing existing customization options + +The existing customization options: `--bootstrap-bucket-name` and `--bootstrap-kms-key-id` will be removed. +We will need to know the names of the bootstrap bucket and KMS key and synthesis time. + +The only way to customize the bootstrap template will be to deploy your own, +based on the default one the CDK provides, +and then change the default options when creating instances of the `Stack` +class to match the names used in the custom template +(this customization will most likely require overriding some methods, +so probably involves implementing a custom subclass of `Stack`). + +### CLI options in detail + +#### Existing kept options + +These options are inherited from the current CLI experience, +and need to be kept for backwards compatibility reasons: + +* `--profile`: use the given local AWS credentials profile when interacting with the target environment. + +* `--toolkit-stack-name`: allows you to explicitly name the CloudFormation bootstrap stack + (instead of relying on the default naming scheme). + +* `--tags` / `-t`: a list of key=value pairs to add as tags to add to the bootstrap stack. + +#### Existing removed options + +The following options that exist today will be removed: + +* `--toolkit-bucket-name` / `--bootstrap-bucket-name` / `-b`: allows you to explicitly name the file assets S3 bucket + (instead of relying on the default naming scheme). + +* `--bootstrap-kms-key-id`: optional identifier of the KMS key used for encrypting the file assets S3 bucket. + +#### New options + +These options will be added to the `bootstrap` command: + +* `--trust`: allows specifying an AWS account ID, or a list of them, + that the created roles (see above) should be assumable from. + This will be required to be passed as the pipeline account, + for deployment from a Continuous Delivery CDK pipeline to work. + +* `--cloudformation-execution-policies`: allows specifying the ManagedPolicy ARN(s) + that should be attached to the **CloudFormation Execution Role**. + +## Bootstrap resources version + +Because we already have a bootstrap solution in place, +and it's possible we will need to add more bootstrap resources as time goes by, +we should have a mechanism in place for migrating, +and giving meaningful errors if the bootstrapping has not been done for an environment that needs it. + +I don't think invoking the full `cdk-bootstrap` tool on every deploy is a good idea, though; +I worry that calculating a full diff of actual versus desired resource state might impact the performance of commands like +`deploy` too negatively. + +My proposal is to have an export on the bootstrap stack, +called `AwsCdkBootstrapVersion`, that will simply contain a number. +We will start with the bootstrap template setting that export to the value `1`. +With time, as we change the bootstrap template, +we will increment the version export number. + +In the `cdk` commands, +we can add a CLI option that will perform a 'bootstrap version check' +before doing any operations. +It will call the `DescribeStack` CFN API, +and get the value of the `AwsCdkBootstrapVersion` export. +Depending on the value retrieved, it will then: + +* If no such stack was found, that means bootstrapping was not performed for this environment. + Fail with the appropriate message. + +* If the stack was found, but it didn't have an export called `AwsCdkBootstrapVersion`, + that means the bootstrap stack is of an older version than the used CLI version, + and needs to be updated. + Fail with the appropriate message. + +* If the export is the same as the `BOOTSTRAP_VERSION` constant in the current CLI, + everything is fine - nothing to do. + +* If the export value is smaller than the `BOOTSTRAP_VERSION` constant in the current CLI, + that means the bootstrap stack is of an older version than the used CLI version, + and needs to be updated. + Fail with the appropriate message. + +* If the export value is larger than the `BOOTSTRAP_VERSION` constant in the current CLI, + that means the bootstrap stack is actually from a later version than the used CLI version. + In this case, I think it's correct to proceed with carrying out the operation; + perhaps print a warning that the user should consider updating their CLI version + if they encounter any errors. + +## Backwards compatibility + +This section outlines how does the backwards compatibility with the existing `cdk bootstrap` functionality work. +In the below template, "old" means the current behavior, +and "new" means "a version released including the changes needed for the CI/CD story". + +The particular components are: + +* CLI: the version of the `aws-cdk` package used to invoke various CDK commands, + like `synth` and `deploy`. +* Framework: the version of the CDK libraries that the CDK application uses. +* Bootstrap: the version of the bootstrap stack that is installed in the target environment. +* Init template: the version of the `aws-cdk` package that was used to run the `cdk init` command + that generated the current CDK application. + +Let's go through each of the scenarios: + +### CLI: old, framework: old, bootstrap: old, init template: old + +This is the current situation +(before any of the changes needed for "CI/CD for CDK apps" are implemented). + +### CLI: old, framework: old, bootstrap: old, init template: new + +The new template will differ from the old one in only one aspect: +it will contain a setting in the `cdk.json` file that activates the new assets behavior, +using our [feature flags](./feature-flags.md) functionality. + +The old code will simply ignore this setting +(as it doesn't have any knowledge of it), +so everything should work exactly as it does currently. + +### CLI: old, framework: old, bootstrap: new, init template: old + +To make this scenario work, we will need the outputs in the new bootstrap template to be preserved, +with exactly the same names as in the old bootstrap template. +The current [code reads them using the CFN API](https://github.com/aws/aws-cdk/blob/45f0e02735f6e12becccc606447607c2dda9c3a5/packages/aws-cdk/lib/api/toolkit-info.ts#L220-L233), +so the specific names of the bucket are immaterial +(it doesn't matter that the new bootstrap template uses physical names). + +The one danger I see here is that, +if we want to always add the KMS key to the new bootstrap resources, +the role putting assets into the bucket needs permissions to the used key, +which wasn't true before. + +### CLI: old, framework: new, bootstrap: old, init template: old + +In this scenario, because the feature flag in the init template is not set, +the framework should use the current assets behavior +(use parameters instead of hard-coding the paths), +and so the old bootstrapping is fine. + +### CLI: new, framework: old, bootstrap: old, init template: old + +In this scenario, the CLI should auto-detect that it's running with an old version of the framework, +and use the current assets behavior +(use parameters instead of hard-coding the paths), +and so the old bootstrapping is fine. + +### CLI: old, framework: old, bootstrap: new, init template: new + +This is similar to the "old, old, new, old" scenario above - +to make it work, we need to preserve the outputs from the old bootstrap template in the new bootstrap template. + +The flag set in `cdk.json` by the init template will be ignored by the old code, +so the asset behavior will be unchanged. + +### CLI: old, framework: new, bootstrap: old, init template: new + +This is a tricky one. +I believe in this case, we need to error out in the framework, +and prompt the user to update their CLI version, +as it won't be able to handle the new asset behavior +(which will be triggered by the flag set in `cdk.json` by the new init template). + +### CLI: new, framework: old, bootstrap: old, init template: new + +This is similar to the "new, old, old, old" scenario - +the CLI should detect it's running with an old version of the framework, +and use the current assets behavior. + +### CLI: old, framework: new, bootstrap: new, init template: old + +Since the flag in `cdk.json` is not set by the old init template, +the asset behavior is the same as the current one, +so as long as the new bootstrap template preserves the outputs, +everything should work like it does now. + +### CLI: new, framework: new, bootstrap: old, init template: old + +Since the flag in `cdk.json` is not set by the old init template, +the asset behavior is the same as the current one, +so the old bootstrapping is fine. + +### CLI: old, framework: new, bootstrap: new, init template: new + +This is similar to the "old, new, old, new" scenario above: +we need to error out in the framework, +and prompt the user to update their CLI version, +as it won't be able to handle the new asset behavior +(which will be triggered by the flag set in `cdk.json` by the new init template). + +### CLI: new, framework: old, bootstrap: new, init template: new + +This is similar to the "new, old, old, old" scenario - +the CLI should detect it's running with an old version of the framework, +and use the current assets behavior. +Bootstrapping needs to preserve the outputs of the stack in order to support this scenario. + +### CLI: new, framework: new, bootstrap: old, init template: new + +This is an interesting case. +At `synth` time, the template will be invalid: +pointing to S3 paths that don't exist +(because of the old bootstrap stack). +However, when any command that has AWS credentials runs +(like `cdk deploy`, or `cdk publish`), +it should do a verification using the `AwsCdkBootstrapVersion` export described above, +and fail, telling the customer to run `cdk bootstrap` again. + +We can also do deeper checks: for example, +we can verify that the bucket the file assets point to actually exists. +If it doesn't, it's probable that the name was overridden in either the stack definition, +or during bootstrapping - and it needs to be done in both of those places to work, +so we can display a helpful error message to the user. + +### CLI: new, framework: new, bootstrap: new, init template: old + +Pretty much identical to the "old, new, new, old" scenario above +(since the flag in `cdk.json` is not set by the old init template, +the asset behavior is the same as the current one, +so as long as the new bootstrap template preserves the outputs, +everything should work like it does now). + +### CLI: new, framework: new, bootstrap: new, init template: new + +The desired final state. + +## Updating the existing bootstrap stack + +As all current CDK customers already have a bootstrap stack defined, +we have to make sure that running the `cdk bootstrap` command in the new version works correctly for that case +(and not only for the case when the bootstrap stack didn't exist in a given environment). + +We already saw that, to preserve backwards compatibility in many cases, +we need to use the same stack name in the new bootstrapping as in the old one. +Which means running `cdk bootstrap` will result in a CFN stack update. + +The tricky part is the existing assets bucket. +Non-empty buckets cannot be removed by CloudFormation, +so if we don't have a resource with that logical ID in the template, +CloudFormation will try to remove it, and fail - +so, the entire bootstrap command will fail! + +To combat that, I think we have to give the S3 assets bucket in the new template the same logical ID as in the old one. +We will set its `UpdateReplacePolicy` to `Retain`, +so that assigning it our custom physical name will leave the old one orphaned. +This should make sure the CFN update succeeds. + +## Bootstrap template + +The bootstrap template used by the CLI command can be found in the +[aws-cdk package](../packages/aws-cdk/lib/api/bootstrap/bootstrap-template.json). diff --git a/design/construct-tree.md b/design/construct-tree.md new file mode 100644 index 0000000000000..9c9c44c327f74 --- /dev/null +++ b/design/construct-tree.md @@ -0,0 +1,227 @@ +## RFC: PUBLISH CDK CONSTRUCT TREE + +## Overview + +This is a strategy for publishing the construct tree which represents a CDK app as a part of the Cloud Assembly that the CDK generates. + +**Goal: Expose the `construct tree` for CDK Apps as an artifact of the Cloud Assembly** + +This proposal details the motivation behind the goal, requirements, specification of the construct tree, and the proposed design. The scope of the design is focused on defining what the construct tree should include and the approach to produce it as an output. + +Prototype: https://github.com/aws/aws-cdk/tree/prototypes/cdk-look + +## Background + +ALL CDK applications are composed of constructs, which are the basic building blocks of AWS CDK applications. They encapsulate everything that underlying providers such as AWS CloudFormation need to create cloud components. + +A construct can represent a single resource, such as an Amazon Simple Storage Service (Amazon S3) bucket, or it can represent a higher-level component consisting of multiple AWS CDK resources. Examples of such components include a worker queue with its associated compute capacity, a cron job with monitoring resources and a dashboard, or even an entire app spanning multiple AWS accounts and regions. + +The CDK CLI is the primary mechanism through which developers currently interact with their AWS CDK applications. It supports various operations throughout the lifecycle of application development from from the initialization of a CDK app from a template to the deployment and destruction of the AWS CloudFormation stacks. + +## Motivation + +Developers author their CDK applications by leveraging higher-level intent based APIs offered through the [AWS Construct Library](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html). They use CLI commands such as `cdk synth` to produce the cloud assembly and `cdk deploy` to deploy it to AWS CloudFormation. When deployments fail, they often have to drop into the AWS CloudFormation templates that the CDK generated or log into the AWS console to trace their issues. + +As an example, the following CDK application for an Application Load Balancer includes constructs from Auto Scaling, VPC, and Application Load Balancing. + +```typescript +const vpc = new ec2.Vpc(this, 'VPC'); + +const asg = new autoscaling.AutoScalingGroup(this, 'ASG', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), +}); + +const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', { + vpc, + internetFacing: true +}); + +const listener = lb.addListener('Listener', { + port: 80, +}); + +listener.addTargets('Target', { + port: 80, + targets: [asg] +}); + +listener.connections.allowDefaultPortFromAnyIpv4('Open to the world'); + +asg.scaleOnRequestCount('AModestLoad', { + targetRequestsPerSecond: 1 +}); +``` + +Running `cdk synth` on this application produces ~800 lines of CloudFormation template and represents over 35 AWS resources spanning 5 services. The generated template is part of the cloud assembly and will be used subsequently by deploy and is staged in the `cdk.out` directory. This showcases the power of the CDK in the ability to define high level abstractions of infrastructure in familiar languages that can be reused. + +Continuing with this example, inspecting the the cloud assembly’s CloudFormation template doesn’t help gain any insight when behavior does not match expectations. + +In this scenario, these are some details that are not intuitive without diving deeper: + +>1. What resources does the AutoScalingGroup construct contain? the VPC construct? etc. +>2. What properties were the resources initialized with? Can they be changed? +>3. Is the relationship between these constructs captured in the cloud assembly correctly? + +When deployments fail, or provisioned resources don’t hold the properties that one might expect, developers can’t figure out what properties that resources such as `NatGateway, AutoScalingGroup, Subnets, Route Tables` were configured with without dropping into the generated CloudFormation template. It can take a good amount of clicking and digging before developers can figure out what happened and almost certainly needs them to get away from their favourite IDE and switch context to find out. + +The recurring theme is that intent based constructs are easy to get started with, take a lot of complexity away from the developer. The flip-side of this experience is that debugging and figuring out what the CDK did on your behalf can become challenging as applications come more complex. This problem will proliferate as more third-party constructs become available for consumption. + + Exposing the construct tree will enrich the developer experience for CDK application construction by exposing the construct tree explicitly. + +Let’s take another look at an example of what a construct tree might look like: + +This is a Lambda function that has it’s handler code written as an asset: + +```typescript + new lambda.Function(this, 'HelloWorldHandler', { + runtime: lambda.Runtime.NODE_JS_8_10, + code: lambda.Code.directory('lambda'), + handler: 'hello.handler' + }); +``` + +Ideally this simple Lambda code, will be represented by a construct tree that looks something like the following, with the ability to expand on constructs and navigate all the way down to their properties and values: + +```bash +├── App +│ ├── Stack 1 +│ │ ├── Lambda Function [L2 Construct](... properties ...) +| │ │ ├── IAM Role (policy information) +| │ │ ├── Asset Code (Lambda Handler, pointer to S3 location where Asset will reside) +| │ │ ├── Lambda Function (Function definition and properties) +``` + +## Requirements + +This list describes only the minimal set of requirements from this feature. After we release these building blocks, we will look into extending the model to meet other use cases that arise. + +1. **Format** - Publish underlying data as a `.json` file that contains the information required to render a construct tree view. The construct tree illustrated in the previous section is only a depiction of what a human readable(ish) view might look like +2. **Constructs** + 1. ***Nodes*** - CDK application constructs at the root and drill down to the constructs it contains (1+ cloud resources.) Initially, we will focus our attention on AWS resources, but the model is extensible to cloud components from any provider + 2. **Types/Hierarchy** - Types and hierarchy information will contain the details around the level of abstraction (L1, L2, L3..), service(s), and resource(s) that they represent. + 3. ***Metadata -*** Constructs will expose metadata which will include an array of objects associated with the construct. + 1. **Location** - The full path of the location where the construct is defined. This will support use cases where the construct-tree nodes can support navigability back to the declaration in the IDE itself. + 2. ***Properties*** - Constructs will opt into the set of properties, and these will be exposed. Higher level constructs (L2 and L3) will expose properties and values of the resources they contain and not necessarily enumerate every property that’s available for a resource. This will especially be useful for constructs that are opinionated and set defaults on behalf of developers. Low level constructs (L1) will expose all properties that are configured. + 4. **Assets** - Assets information will be included in the construct tree. Assets represent actions that the CDK *will* take ahead of stack deployments (i.e. S3 assets are zipped and uploaded directly, Docker images are uploaded to ECR). The asset metadata in the tree is the S3 key that an asset *would* have +3. **Local** - The construct tree is produced at synthesis time. Connectivity to AWS and CloudFormation should not be required to produce a tree view of a CDK application. + +## Approach + +At a high-level, we will render the `construct tree` through a construct tree data model and construct metadata interface that constructs will implement. This section will describe the components of the JSON structure that will represent the construct-tree: + +### Construct Tree Data Model + +A feature will be added to the CDK core module so that any CDK application will produce an artifact called `tree.json` during calls to `cdk synth` and include it as an output to the cloud assembly in `cdk.out`. + +The construct tree will be a list of paths that are indexed into a map of constructs. The file structure itself represents the tree. This information will need to include the following to start rendering a map of constructs: + +### Construct properties + +|Property |Type |Required |Source | Description | +|--- |--- |--- |--- | --- | +|path |string |Required |`construct.node.path` | Full, absolute path of the construct within the tree | +|children |Array |Not Required |`construct.node.children` | All direct children of this construct. Array of the absolute paths of the constructs. Will be used to walk entire list of constructs | +|attributes |Array |Not Required |`construct.node.attributes` | Attributes describing all constructs/resources/properties that are encapsulated by the construct | + +### Metadata Properties + +The following metadata properties will be included by the construct that produces the `tree.json` output. + +|Property |Type |Required | Description | +|--- |--- |--- | --- | +|attributes |Array |Not Required | constructs can fill in arbitrary metadata such as configuration, type, properties, etc | + +Attributes are an extensible list and their keys should be namespaced by convention to avoid conflicts. + +As an example, L1 CloudFormation resources would use the following convention within the bag of attributes: + +`aws:cdk:cloudformation:type` - CloudFormation resource that this construct represents +`aws:cdk:cloudformation:properties` - properties of the CloudFormation resource + +The example below is a sample tree with a stack that has 2 resources within it. The resources have attributes in their bag that are named by convention. +```json +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "path": "Tree" + }, + "mystack": { + "path": "mystack", + "children": { + "mycfnresource": { + "path": "mystack/mycfnresource", + "attributes": { + "aws:cdk:props": { + "mystringpropkey": "mystringpropval", + "mylistpropkey": [ + "listitem1" + ], + "mystructpropkey": { + "myboolpropkey": true, + "mynumpropkey": 50 + } + } + } + }, + "mytopic": { + "path": "mystack/mytopic", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:properties": { + "DisplayName": "MyTopic" + } + } + } + } + } + } + } +} +``` + +### Construct metadata + +We will also introduce an interface that constructs *can* implement to provide metadata such as configured values, +additional context, anything a construct would want to report back as properties. +Constructs will be able to supply information about themselves for inclusion into the context tree. + +The context tree provides the skeleton and the structure for rendering a tree-view of a CDK application. +The proposed Interface will be added to `construct.ts` in the core library and implemented by `constructs` +that have additional information to contribute to the construct tree : + +```typescript +/*** + * Information that a construct will contribute towards the construct tree* + * such as dependencies, properties, links, documentation, etc + */ +export interface ITreeAttributes { + // attributes will be added to the construct tree + readonly attributes: [key: string]: string; +} +``` + +## Unresolved Questions + +* Experience across all supported languages - nuances, considerations, etc +* How to report on stability of properties that are rendered and returned through "IDisplayable" + +## Future Possibilities + +We do not expect customers to have to interact directly with the outputs that the CDK produces as a part of the cloud assembly. +Publishing the CDK construct tree as an output to the cloud assembly is intended to be a starting point to build on and create experiences based on it. + +### Tooling + +With a construct tree model in place and construct tree being published as a `.json` file, it opens the door to build tooling and utilities to enhance the application development experience so that developers can gain context and insight without having to leave their IDEs. Some of these features could include: + +**Diff** diff the construct tree against the resources that are deployed in the cloud. This capability would require cloud capability but we should always be able to render a construct tree without the need to connect. + +**Navigability** include the location in code where the construct is defined. This would start to pave the way towards building tooling and extensions that IDE's can leverage. + +**Errors/Warnings** - Errors and warnings that are produced during synthesis indicating validation failures, deprecation notices, guidance, etc will be included in the tree. These are emitted at the construct level although the message may point towards a specific property. The construct tree should be complete and include failures for all resources in the CDK application rather than just just fail on the first error. diff --git a/design/continuous-delivery.md b/design/continuous-delivery.md new file mode 100644 index 0000000000000..ad5d72e70417a --- /dev/null +++ b/design/continuous-delivery.md @@ -0,0 +1 @@ +Moved to [aws-cdk-rfcs](https://github.com/aws/aws-cdk-rfcs/blob/master/text/0049-continuous-delivery.md). \ No newline at end of file diff --git a/design/feature-flags.md b/design/feature-flags.md index 3b2b96a658bd7..afd076bdbfd1f 100644 --- a/design/feature-flags.md +++ b/design/feature-flags.md @@ -1,92 +1 @@ -# Feature Flags - -Sometimes we want to introduce new breaking behavior because we believe this is -the correct default behavior for the CDK. The problem, of course, is that -breaking changes are only allowed in major versions and those are rare. - -This document describes a proposal for a pattern/mechanism called feature flags. -It will allow us to introduce breaking behavior which is disabled by default (so -existing projects will not be affected) but enabled automatically for new -projects created through `cdk init`. - -## Approach - -The basic idea is that new breaking behavior will always be disabled by default -and only enabled when a certain CDK context parameter is set. If not enabled, -the system will continue to behave exactly like it used to without breaking any -existing projects. - -When we release a new major version of the AWS CDK, we will flip this behavior -or completely remove the legacy behavior. - -In order for new projects to pick up this new behavior automatically, we will -modify `cdk init` to inject the set of "future flags" into the generated -`cdk.json` file. This means that the new project will have the latest behavior, -but projects that were created prior to the introduction of this feature will -have the same legacy behavior based on the set of capabilities that were -available at the time of the project's creation. This list will be cleaned up -every time we release a major version of course. - -Using fine-grained flags will allow users of old projects to pick up specific -new "future" behaviors by manually adding the specific keys to their `cdk.json` -file, without risking breakage in other unexpected areas. - -## Alternative Considered - -We considered an alternative of "bundling" new capabilities under a single flag -that specifies the CDK version which created the project, but this means that -users won't have the ability to pick and choose which future capabilities they -want to enable in case they need them but don't want to take the risk of -unexpected changes. - -The downside of the fine-grained approach is that it could result in a "blowing -up" new `cdk.json` files in case there will be many new breaking capabilities -between major releases. But this is hypothetical and even if this list ends up -with 20 features before we release the next major version, I still think the -benefits outweigh the risks of the alternative approach. - -## Design - -Context keys for feature flags will be listed in `cx-api/lib/features.ts` and -will take the form: `:`. - -For example: - -- `@aws-cdk/core:enableStackNameDuplicates` -- `@aws-cdk/aws-cloudformation:doNotCapitalizeCustomResourcePropertyNames`. - -Using the module name will allow easy tracing of the code that consumes this -flag. - -The configuration for which feature flags should be enabled for new projects -will be under `cx-api/lib/future.ts` and will be encoded as a simple context -hash that will be injected by `cdk init` to all `cdk.json` files generated for -new projects. - -We will mandate that when a feature or bug fix is introduced under a feature -flag, the CHANGELOG will include: - -- The suffix `(under feature flag)` in the title. -- A `BREAKING CHANGES` paragraph will be added which describes the *new* - behavior but disclaims that it will only apply to new projects created through - `cdk init`. It will also indicate the context key this flag uses for users who - wish to enable it manually in their project. - -## Future Development - -As a general rule, using a feature flag should be last resort in the case where -it is impossible to implement backwards compatibility. A feature flag is likely -to get less usage and therefore mature slower, so it's important to make sure we -don't abuse this pattern. - -Still, a valid concern is that we end up with too many feature flags between -major releases (I would say >20 is too many), in which case it might be required -to offer additional tools to manage and discover them. - -Here are a few ideas that came up as we designed this. All of these can be -implemented on top of the proposed mechanism, and should be considered if needed -in the future (as well as any other idea of course): - -- Introduce a CLI command to list all flags and enable/disable them in your `cdk.json`. -- Aggregate all flags in groups so it will be easier to enable many of them. -- Define a flag that will allow users to say "I want all feature up until a certain CDK version" (basically enables all features that were available when the version was releases). +Moved to [aws-cdk-rfcs](https://github.com/aws/aws-cdk-rfcs/blob/master/text/0055-feature-flags.md). \ No newline at end of file diff --git a/lerna.json b/lerna.json index 4629f658fd173..b0265f2414ca4 100644 --- a/lerna.json +++ b/lerna.json @@ -5,9 +5,10 @@ "packages": [ "packages/*", "packages/@aws-cdk/*", + "packages/@monocdk-experiment/*", "packages/@aws-cdk/*/lambda-packages/*", "tools/*" ], "rejectCycles": "true", - "version": "1.17.1" + "version": "999.0.0" } diff --git a/pack.sh b/pack.sh index 199ad97a51c77..e139d0a048eba 100755 --- a/pack.sh +++ b/pack.sh @@ -7,6 +7,8 @@ export PATH=$PWD/node_modules/.bin:$PATH export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" root=$PWD +PACMAK=${PACMAK:-jsii-pacmak} +ROSETTA=${ROSETTA:-jsii-rosetta} TMPDIR=${TMPDIR:-$(dirname $(mktemp -u))} distdir="$PWD/dist" rm -fr ${distdir} @@ -25,22 +27,31 @@ function lerna_scopes() { done } -echo "Packaging jsii modules" >&2 +# Compile examples with respect to "decdk" directory, as all packages will +# be symlinked there so they can all be included. +echo "Extracting code samples" >&2 +node --experimental-worker $(which $ROSETTA) \ + --compile \ + --output samples.tabl.json \ + --directory packages/decdk \ + $(cat $TMPDIR/jsii.txt) # Jsii packaging (all at once using jsii-pacmak) -jsii-pacmak \ +echo "Packaging jsii modules" >&2 +$PACMAK \ --verbose \ - --outdir $distdir/ \ + --rosetta-tablet samples.tabl.json \ $(cat $TMPDIR/jsii.txt) # Non-jsii packaging, which means running 'package' in every individual -# module and rsync'ing the result to the shared dist directory. +# module echo "Packaging non-jsii modules" >&2 lerna run $(lerna_scopes $(cat $TMPDIR/nonjsii.txt)) --sort --concurrency=1 --stream package +# Finally rsync all 'dist' directories together into a global 'dist' directory for dir in $(find packages -name dist | grep -v node_modules | grep -v run-wrappers); do - echo "Merging ${dir} into ${distdir}" - rsync -av $dir/ ${distdir}/ + echo "Merging ${dir} into ${distdir}" >&2 + rsync -a $dir/ ${distdir}/ done # Remove a JSII aggregate POM that may have snuk past diff --git a/package.json b/package.json index aadc5e488113e..7225da6c67cbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-cdk", - "version": "1.17.1", + "version": "1.25.0", "private": true, "pkglint": { "include": "dependencies/node-version" @@ -10,36 +10,23 @@ "build": "./build.sh", "pack": "./pack.sh", "compat": "./scripts/check-api-compatibility.sh", + "bump": "./bump.sh", "build-all": "tsc -b" }, "devDependencies": { - "@types/jest": "^24.0.23", - "@types/node": "^10.17.5", - "@types/nodeunit": "^0.0.30", - "conventional-changelog-cli": "^2.0.28", + "conventional-changelog-cli": "^2.0.31", "fs-extra": "^8.1.0", - "jest": "^24.9.0", - "jsii-diff": "^0.20.7", - "jsii-pacmak": "^0.20.7", - "lerna": "^3.18.4", - "nodeunit": "^0.11.3", - "nyc": "^14.1.1", - "standard-version": "^7.0.1", - "ts-jest": "^24.1.0", - "tslint": "^5.20.1", - "typescript": "~3.6.4" + "jsii-diff": "^1.0.0", + "jsii-pacmak": "^0.22.0", + "jsii-rosetta": "^0.22.0", + "lerna": "^3.20.2", + "standard-version": "^7.1.0", + "typescript": "~3.8.2" }, "repository": { "type": "git", "url": "git://github.com/aws/aws-cdk" }, - "standard-version": { - "releaseCommitMessageFormat": "v{{currentTag}}", - "scripts": { - "prebump": "echo $(node -pe \"require('./lerna.json').version\")", - "precommit": "git add ." - } - }, "license": "Apache-2.0", "author": { "name": "Amazon Web Services", @@ -49,15 +36,25 @@ "packages": [ "packages/*", "packages/@aws-cdk/*", + "packages/@monocdk-experiment/*", "packages/@aws-cdk/*/lambda-packages/*", "tools/*" ], "nohoist": [ "**/jszip", "**/jszip/**", + "@aws-cdk/cdk-assets-schema/semver", + "@aws-cdk/cdk-assets-schema/semver/**", "@aws-cdk/assets/minimatch", "@aws-cdk/assets/minimatch/**", + "@aws-cdk/aws-codepipeline-actions/case", + "@aws-cdk/aws-codepipeline-actions/case/**", + "@aws-cdk/aws-ecr-assets/minimatch", + "@aws-cdk/aws-ecr-assets/minimatch/**", + "@aws-cdk/aws-lambda-nodejs/parcel-bundler", + "@aws-cdk/aws-lambda-nodejs/parcel-bundler/**", "@aws-cdk/cx-api/semver", + "@aws-cdk/cx-api/semver/**", "@aws-cdk/cx-api/semver/**" ] } diff --git a/packages/@aws-cdk/alexa-ask/.gitignore b/packages/@aws-cdk/alexa-ask/.gitignore index 7b20ed5f53385..95ee96981d6b4 100644 --- a/packages/@aws-cdk/alexa-ask/.gitignore +++ b/packages/@aws-cdk/alexa-ask/.gitignore @@ -6,7 +6,7 @@ .jsii .LAST_BUILD .LAST_PACKAGE -.nycrc +nyc.config.js .nyc_output coverage dist diff --git a/packages/@aws-cdk/alexa-ask/LICENSE b/packages/@aws-cdk/alexa-ask/LICENSE index 46c185646b439..b71ec1688783a 100644 --- a/packages/@aws-cdk/alexa-ask/LICENSE +++ b/packages/@aws-cdk/alexa-ask/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 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. diff --git a/packages/@aws-cdk/alexa-ask/NOTICE b/packages/@aws-cdk/alexa-ask/NOTICE index 8585168af8b7d..bfccac9a7f69c 100644 --- a/packages/@aws-cdk/alexa-ask/NOTICE +++ b/packages/@aws-cdk/alexa-ask/NOTICE @@ -1,2 +1,2 @@ AWS Cloud Development Kit (AWS CDK) -Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 5408fbcff0c50..2af1e5f0438b3 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/alexa-ask", - "version": "1.17.1", + "version": "999.0.0", "description": "The CDK Construct Library for Alexa::ASK", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -12,15 +12,13 @@ "packageId": "Amazon.CDK.Alexa.Ask", "signAssembly": true, "assemblyOriginatorKeyFile": "../../key.snk", - "versionSuffix": "-devpreview", "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" }, "java": { "package": "software.amazon.awscdk.alexa.ask", "maven": { "groupId": "software.amazon.awscdk", - "artifactId": "alexa-ask", - "versionSuffix": ".DEVPREVIEW" + "artifactId": "alexa-ask" } }, "python": { @@ -63,18 +61,35 @@ "url": "https://aws.amazon.com", "organization": true }, + "jest": { + "moduleFileExtensions": [ + "js" + ], + "coverageThreshold": { + "global": { + "branches": 60, + "statements": 80 + } + }, + "collectCoverage": true, + "coverageReporters": [ + "lcov", + "html", + "text-summary" + ] + }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.17.1", - "cdk-build-tools": "1.17.1", - "cfn2ts": "1.17.1", - "pkglint": "1.17.1" + "@aws-cdk/assert": "999.0.0", + "cdk-build-tools": "999.0.0", + "cfn2ts": "999.0.0", + "pkglint": "999.0.0" }, "dependencies": { - "@aws-cdk/core": "1.17.1" + "@aws-cdk/core": "999.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.17.1" + "@aws-cdk/core": "999.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/alexa-ask/test/ask.test.ts b/packages/@aws-cdk/alexa-ask/test/ask.test.ts new file mode 100644 index 0000000000000..e394ef336bfb4 --- /dev/null +++ b/packages/@aws-cdk/alexa-ask/test/ask.test.ts @@ -0,0 +1,6 @@ +import '@aws-cdk/assert/jest'; +import {} from '../lib'; + +test('No tests are specified for this package', () => { + expect(true).toBe(true); +}); diff --git a/packages/@aws-cdk/alexa-ask/test/test.ask.ts b/packages/@aws-cdk/alexa-ask/test/test.ask.ts deleted file mode 100644 index 51db772aeb78f..0000000000000 --- a/packages/@aws-cdk/alexa-ask/test/test.ask.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Test, testCase } from 'nodeunit'; -import {} from '../lib'; - -export = testCase({ - notTested(test: Test) { - test.ok(true, 'No tests are specified for this package.'); - test.done(); - } -}); diff --git a/packages/@aws-cdk/app-delivery/.gitignore b/packages/@aws-cdk/app-delivery/.gitignore index c49007df54187..e83cd3c5e30bb 100644 --- a/packages/@aws-cdk/app-delivery/.gitignore +++ b/packages/@aws-cdk/app-delivery/.gitignore @@ -3,7 +3,7 @@ dist .LAST_BUILD .jsii .nyc_output -.nycrc +nyc.config.js tsconfig.json *.js *.d.ts diff --git a/packages/@aws-cdk/app-delivery/LICENSE b/packages/@aws-cdk/app-delivery/LICENSE index 46c185646b439..b71ec1688783a 100644 --- a/packages/@aws-cdk/app-delivery/LICENSE +++ b/packages/@aws-cdk/app-delivery/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 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. diff --git a/packages/@aws-cdk/app-delivery/NOTICE b/packages/@aws-cdk/app-delivery/NOTICE index 8585168af8b7d..bfccac9a7f69c 100644 --- a/packages/@aws-cdk/app-delivery/NOTICE +++ b/packages/@aws-cdk/app-delivery/NOTICE @@ -1,2 +1,2 @@ AWS Cloud Development Kit (AWS CDK) -Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts index abbb184e25238..8b544fc004c1b 100644 --- a/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts @@ -1,10 +1,10 @@ -import cfn = require('@aws-cdk/aws-cloudformation'); -import codepipeline = require('@aws-cdk/aws-codepipeline'); -import cpactions = require('@aws-cdk/aws-codepipeline-actions'); -import events = require('@aws-cdk/aws-events'); -import iam = require('@aws-cdk/aws-iam'); -import cdk = require('@aws-cdk/core'); -import cxapi = require('@aws-cdk/cx-api'); +import * as cfn from '@aws-cdk/aws-cloudformation'; +import * as codepipeline from '@aws-cdk/aws-codepipeline'; +import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; +import * as events from '@aws-cdk/aws-events'; +import * as iam from '@aws-cdk/aws-iam'; +import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; export interface PipelineDeployStackActionProps { /** diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index c8e907ac84d49..2f5d1de48fd21 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -1,7 +1,7 @@ { "name": "@aws-cdk/app-delivery", "description": "Continuous Integration / Continuous Delivery for CDK Applications", - "version": "1.17.1", + "version": "999.0.0", "main": "lib/index.js", "types": "lib/index.d.ts", "jsii": { @@ -9,8 +9,7 @@ "java": { "maven": { "groupId": "software.amazon.awscdk", - "artifactId": "cdk-app-delivery", - "versionSuffix": ".DEVPREVIEW" + "artifactId": "cdk-app-delivery" }, "package": "software.amazon.awscdk.appdelivery" }, @@ -19,7 +18,6 @@ "packageId": "Amazon.CDK.AppDelivery", "signAssembly": true, "assemblyOriginatorKeyFile": "../../key.snk", - "versionSuffix": "-devpreview", "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" }, "python": { @@ -42,22 +40,24 @@ "compat": "cdk-compat" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.17.1", - "@aws-cdk/aws-codebuild": "1.17.1", - "@aws-cdk/aws-codepipeline": "1.17.1", - "@aws-cdk/aws-codepipeline-actions": "1.17.1", - "@aws-cdk/aws-events": "1.17.1", - "@aws-cdk/aws-iam": "1.17.1", - "@aws-cdk/core": "1.17.1", - "@aws-cdk/cx-api": "1.17.1" + "@aws-cdk/aws-cloudformation": "999.0.0", + "@aws-cdk/aws-codebuild": "999.0.0", + "@aws-cdk/aws-codepipeline": "999.0.0", + "@aws-cdk/aws-codepipeline-actions": "999.0.0", + "@aws-cdk/aws-events": "999.0.0", + "@aws-cdk/aws-iam": "999.0.0", + "@aws-cdk/core": "999.0.0", + "@aws-cdk/cx-api": "999.0.0" }, "devDependencies": { - "@aws-cdk/assert": "1.17.1", - "@aws-cdk/aws-s3": "1.17.1", - "cdk-build-tools": "1.17.1", - "cdk-integ-tools": "1.17.1", - "fast-check": "^1.18.1", - "pkglint": "1.17.1" + "@aws-cdk/assert": "999.0.0", + "@aws-cdk/aws-s3": "999.0.0", + "@types/nodeunit": "^0.0.30", + "cdk-build-tools": "999.0.0", + "cdk-integ-tools": "999.0.0", + "fast-check": "^1.22.2", + "nodeunit": "^0.11.3", + "pkglint": "999.0.0" }, "repository": { "type": "git", @@ -76,14 +76,14 @@ "cdk" ], "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.17.1", - "@aws-cdk/aws-codebuild": "1.17.1", - "@aws-cdk/aws-codepipeline": "1.17.1", - "@aws-cdk/aws-codepipeline-actions": "1.17.1", - "@aws-cdk/aws-events": "1.17.1", - "@aws-cdk/aws-iam": "1.17.1", - "@aws-cdk/core": "1.17.1", - "@aws-cdk/cx-api": "1.17.1" + "@aws-cdk/aws-cloudformation": "999.0.0", + "@aws-cdk/aws-codebuild": "999.0.0", + "@aws-cdk/aws-codepipeline": "999.0.0", + "@aws-cdk/aws-codepipeline-actions": "999.0.0", + "@aws-cdk/aws-events": "999.0.0", + "@aws-cdk/aws-iam": "999.0.0", + "@aws-cdk/core": "999.0.0", + "@aws-cdk/cx-api": "999.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json b/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json index a7889b12487fd..3e5104f23e141 100644 --- a/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json +++ b/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json @@ -419,6 +419,52 @@ "Version": "2012-10-17" } } + }, + "CodePipelineDeployChangeSetRoleDefaultPolicy289820BE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ArtifactBucket7410C9EF", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ArtifactBucket7410C9EF", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodePipelineDeployChangeSetRoleDefaultPolicy289820BE", + "Roles": [ + { + "Ref": "CodePipelineDeployChangeSetRoleF9F2B343" + } + ] + } } } } diff --git a/packages/@aws-cdk/app-delivery/test/integ.cicd.ts b/packages/@aws-cdk/app-delivery/test/integ.cicd.ts index bf26b60ac8aed..9903bdc278278 100644 --- a/packages/@aws-cdk/app-delivery/test/integ.cicd.ts +++ b/packages/@aws-cdk/app-delivery/test/integ.cicd.ts @@ -1,9 +1,9 @@ -import cfn = require('@aws-cdk/aws-cloudformation'); -import codepipeline = require('@aws-cdk/aws-codepipeline'); -import cpactions = require('@aws-cdk/aws-codepipeline-actions'); -import s3 = require('@aws-cdk/aws-s3'); -import cdk = require('@aws-cdk/core'); -import cicd = require('../lib'); +import * as cfn from '@aws-cdk/aws-cloudformation'; +import * as codepipeline from '@aws-cdk/aws-codepipeline'; +import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; +import * as s3 from '@aws-cdk/aws-s3'; +import * as cdk from '@aws-cdk/core'; +import * as cicd from '../lib'; const app = new cdk.App(); diff --git a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts index 98eaceb07669d..60a4e098d3a57 100644 --- a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts @@ -1,15 +1,15 @@ import { expect, haveResource, isSuperObject } from '@aws-cdk/assert'; -import cfn = require('@aws-cdk/aws-cloudformation'); -import codebuild = require('@aws-cdk/aws-codebuild'); -import codepipeline = require('@aws-cdk/aws-codepipeline'); -import cpactions = require('@aws-cdk/aws-codepipeline-actions'); -import events = require('@aws-cdk/aws-events'); -import iam = require('@aws-cdk/aws-iam'); -import s3 = require('@aws-cdk/aws-s3'); -import cdk = require('@aws-cdk/core'); -import cxapi = require('@aws-cdk/cx-api'); -import fc = require('fast-check'); -import nodeunit = require('nodeunit'); +import * as cfn from '@aws-cdk/aws-cloudformation'; +import * as codebuild from '@aws-cdk/aws-codebuild'; +import * as codepipeline from '@aws-cdk/aws-codepipeline'; +import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; +import * as events from '@aws-cdk/aws-events'; +import * as iam from '@aws-cdk/aws-iam'; +import * as s3 from '@aws-cdk/aws-s3'; +import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import * as fc from 'fast-check'; +import * as nodeunit from 'nodeunit'; import { PipelineDeployStackAction } from '../lib/pipeline-deploy-stack-action'; interface SelfUpdatingPipeline { @@ -198,6 +198,49 @@ export = nodeunit.testCase({ PolicyDocument: { Version: '2012-10-17', Statement: [ + { + Action: [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + Effect: "Allow", + Resource: [ + { + "Fn::GetAtt": [ + "CodePipelineArtifactsBucketF1E925CF", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "CodePipelineArtifactsBucketF1E925CF", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + { + Action: [ + "kms:Decrypt", + "kms:DescribeKey", + ], + Effect: "Allow", + Resource: { + "Fn::GetAtt": [ + "CodePipelineArtifactsBucketEncryptionKey85407CB4", + "Arn", + ], + }, + }, { Action: '*', Effect: 'Allow', @@ -272,6 +315,49 @@ export = nodeunit.testCase({ PolicyDocument: { Version: '2012-10-17', Statement: [ + { + Action: [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + Effect: "Allow", + Resource: [ + { + "Fn::GetAtt": [ + "CodePipelineArtifactsBucketF1E925CF", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "CodePipelineArtifactsBucketF1E925CF", + "Arn", + ], + }, + "/*" + ], + ], + }, + ], + }, + { + Action: [ + "kms:Decrypt", + "kms:DescribeKey", + ], + Effect: "Allow", + Resource: { + "Fn::GetAtt": [ + "CodePipelineArtifactsBucketEncryptionKey85407CB4", + "Arn", + ], + }, + }, { Action: [ 'ec2:AuthorizeSecurityGroupEgress', diff --git a/packages/@aws-cdk/assert/.gitignore b/packages/@aws-cdk/assert/.gitignore index 6cff5540e188a..eb142198f6493 100644 --- a/packages/@aws-cdk/assert/.gitignore +++ b/packages/@aws-cdk/assert/.gitignore @@ -7,6 +7,6 @@ dist .LAST_BUILD .nyc_output coverage -.nycrc +nyc.config.js .LAST_PACKAGE -*.snk \ No newline at end of file +*.snk diff --git a/packages/@aws-cdk/assert/LICENSE b/packages/@aws-cdk/assert/LICENSE index 46c185646b439..b71ec1688783a 100644 --- a/packages/@aws-cdk/assert/LICENSE +++ b/packages/@aws-cdk/assert/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 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. diff --git a/packages/@aws-cdk/assert/NOTICE b/packages/@aws-cdk/assert/NOTICE index 8585168af8b7d..bfccac9a7f69c 100644 --- a/packages/@aws-cdk/assert/NOTICE +++ b/packages/@aws-cdk/assert/NOTICE @@ -1,2 +1,2 @@ AWS Cloud Development Kit (AWS CDK) -Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/assert/README.md b/packages/@aws-cdk/assert/README.md index 308873306641a..2657ebdf92cc1 100644 --- a/packages/@aws-cdk/assert/README.md +++ b/packages/@aws-cdk/assert/README.md @@ -75,64 +75,55 @@ Example: ```ts expect(stack).to(haveResource('AWS::CertificateManager::Certificate', { - DomainName: 'test.example.com' + DomainName: 'test.example.com', // Note: some properties omitted here + + ShouldNotExist: ABSENT })); ``` +`ABSENT` is a magic value to assert that a particular key in an object is *not* set (or set to `undefined`). -## Integration tests - -Integration tests are modeled as CDK apps that are deployed by the developers. -If deployment succeeds, the synthesized template is saved in a local file and -"locked". During build, the test app is only synthesized and compared against -the checked-in file to protect against regressions. - -### Setup - -Create any number of files called `integ.*.ts` in your `test` directory. These -should be CDK apps containing a single stack. +### Check number of resources -Add the following to your `package.json`': +If you want to assert that `n` number of resources of a particular type exist, with or without specific properties: -```json -{ - scripts: { - "test": ".... && cdk-integ-assert", - "integ": "cdk-integ" - }, - ... - devDependencies: { - "@aws-cdk/assert": "*", - "aws-cdk": "*" - } -} +```ts +countResources(type, count) +countResourcesLike(type, count, props) ``` -This installs two tools into your scripts: - - * When `npm test` is executed (during build), the `cdk-integ-assert` tool is - invoked. This tool will only synthesize the integration test stacks and - compare them to the .expected files. If the files differ (or do not exist), - the test will fail. - * When `npm run integ` is executed (manually by the developer), the `cdk-integ` - tool is invoked. This tool will actually attempt to deploy the integration - test stacks into the default environment. If it succeeds, the .expected file - will be updated to include the latest synthesized stack. +Example: -The usage of `cdk-integ` is: +```ts +expect(stack).to(countResources('AWS::ApiGateway::Method', 3)); +expect(stack).to(countResourcesLike('AWS::ApiGateway::Method', 1, { + HttpMethod: 'GET', + ResourceId: { + "Ref": "MyResource01234" + } +})); +``` -```bash -cdk-integ [--no-clean] [filters...] +### Check existence of an output +`haveOutput` assertion can be used to check that a stack contains specific output. +Parameters to check against can be: +- `outputName` +- `outputValue` +- `exportName` -# or +If `outputValue` is provided, at least one of `outputName`, `exportName` should be provided as well -npm run integ -- [--no-clean] [filters...] +Example +```ts +expect(synthStack).to(haveOutput({ + outputName: 'TestOutputName', + exportName: 'TestOutputExportName', + outputValue: { + 'Fn::GetAtt': [ + 'TestResource', + 'Arn' + ] + } +})); ``` - - * If `--no-clean` is specified, the integration test stacks will not be cleaned - up. This can be used to perform manual validation on the stacks. - * If filters are specified, each test name is evaluated against each filter. If - the name matches any of the filters, the test is included. Otherwise it is - skipped. - diff --git a/packages/@aws-cdk/assert/jest.ts b/packages/@aws-cdk/assert/jest.ts index 76c72a889c012..11cc8226ea035 100644 --- a/packages/@aws-cdk/assert/jest.ts +++ b/packages/@aws-cdk/assert/jest.ts @@ -1,8 +1,11 @@ -import { Stack } from "@aws-cdk/core"; -import cxapi = require("@aws-cdk/cx-api"); -import { HaveResourceAssertion, ResourcePart } from "./lib/assertions/have-resource"; -import { MatchStyle, matchTemplate } from "./lib/assertions/match-template"; +import * as core from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import { JestFriendlyAssertion } from './lib/assertion'; +import { haveOutput, HaveOutputProperties } from './lib/assertions/have-output'; +import { HaveResourceAssertion, ResourcePart } from './lib/assertions/have-resource'; +import { MatchStyle, matchTemplate } from './lib/assertions/match-template'; import { expect as ourExpect } from './lib/expect'; +import { StackInspector } from './lib/inspector'; declare global { namespace jest { @@ -17,13 +20,15 @@ declare global { toHaveResourceLike(resourceType: string, properties?: any, comparison?: ResourcePart): R; + + toHaveOutput(props: HaveOutputProperties): R; } } } expect.extend({ toMatchTemplate( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, template: any, matchStyle?: MatchStyle) { @@ -44,26 +49,34 @@ expect.extend({ }, toHaveResource( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, resourceType: string, properties?: any, comparison?: ResourcePart) { const assertion = new HaveResourceAssertion(resourceType, properties, comparison, false); - return assertHaveResource(assertion, actual); + return applyAssertion(assertion, actual); }, + toHaveResourceLike( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, resourceType: string, properties?: any, comparison?: ResourcePart) { const assertion = new HaveResourceAssertion(resourceType, properties, comparison, true); - return assertHaveResource(assertion, actual); + return applyAssertion(assertion, actual); + }, + + toHaveOutput( + actual: cxapi.CloudFormationStackArtifact | core.Stack, + props: HaveOutputProperties) { + + return applyAssertion(haveOutput(props), actual); } }); -function assertHaveResource(assertion: HaveResourceAssertion, actual: cxapi.CloudFormationStackArtifact | Stack) { +function applyAssertion(assertion: JestFriendlyAssertion, actual: cxapi.CloudFormationStackArtifact | core.Stack) { const inspector = ourExpect(actual); const pass = assertion.assertUsing(inspector); if (pass) { diff --git a/packages/@aws-cdk/assert/lib/assertion.ts b/packages/@aws-cdk/assert/lib/assertion.ts index d193a6856c27e..57ef3ca759e78 100644 --- a/packages/@aws-cdk/assert/lib/assertion.ts +++ b/packages/@aws-cdk/assert/lib/assertion.ts @@ -20,6 +20,13 @@ export abstract class Assertion { } } +export abstract class JestFriendlyAssertion extends Assertion { + /** + * Generates an error message that can be used by Jest. + */ + public abstract generateErrorMessage(): string; +} + import { AndAssertion } from "./assertions/and-assertion"; function and(left: Assertion, right: Assertion): Assertion { diff --git a/packages/@aws-cdk/assert/lib/assertions/count-resources.ts b/packages/@aws-cdk/assert/lib/assertions/count-resources.ts index 481a72cb0c0dd..52e96a188e220 100644 --- a/packages/@aws-cdk/assert/lib/assertions/count-resources.ts +++ b/packages/@aws-cdk/assert/lib/assertions/count-resources.ts @@ -8,12 +8,22 @@ export function countResources(resourceType: string, count = 1): Assertion { + return new CountResourcesAssertion(resourceType, count, props); +} + class CountResourcesAssertion extends Assertion { private inspected: number = 0; + private readonly props: any; constructor(private readonly resourceType: string, - private readonly count: number) { + private readonly count: number, + props: any = null) { super(); + this.props = props; } public assertUsing(inspector: StackInspector): boolean { @@ -21,8 +31,18 @@ class CountResourcesAssertion extends Assertion { for (const logicalId of Object.keys(inspector.value.Resources || {})) { const resource = inspector.value.Resources[logicalId]; if (resource.Type === this.resourceType) { - counted++; - this.inspected += 1; + if (this.props) { + const propEntries = Object.entries(this.props); + propEntries.forEach(([key, val]) => { + if (resource.Properties && resource.Properties[key] && JSON.stringify(resource.Properties[key]) === JSON.stringify(val)) { + counted++; + this.inspected += 1; + } + }); + } else { + counted++; + this.inspected += 1; + } } } @@ -30,6 +50,6 @@ class CountResourcesAssertion extends Assertion { } public get description(): string { - return `stack only has ${this.inspected} resource of type ${this.resourceType} but we expected to find ${this.count}`; + return `stack only has ${this.inspected} resource of type ${this.resourceType}${this.props ? ' with specified properties' : ''} but we expected to find ${this.count}`; } } diff --git a/packages/@aws-cdk/assert/lib/assertions/have-output.ts b/packages/@aws-cdk/assert/lib/assertions/have-output.ts new file mode 100644 index 0000000000000..36f76b3e573a0 --- /dev/null +++ b/packages/@aws-cdk/assert/lib/assertions/have-output.ts @@ -0,0 +1,116 @@ +import { JestFriendlyAssertion } from '../assertion'; +import { StackInspector } from '../inspector'; + +class HaveOutputAssertion extends JestFriendlyAssertion { + private readonly inspected: InspectionFailure[] = []; + + constructor(private readonly outputName?: string, private readonly exportName?: any, private outputValue?: any) { + super(); + if (!this.outputName && !this.exportName) { + throw new Error('At least one of [outputName, exportName] should be provided'); + } + } + + public get description(): string { + const descriptionPartsArray = new Array(); + + if (this.outputName) { + descriptionPartsArray.push(`name '${this.outputName}'`); + } + if (this.exportName) { + descriptionPartsArray.push(`export name ${JSON.stringify(this.exportName)}`); + } + if (this.outputValue) { + descriptionPartsArray.push(`value ${JSON.stringify(this.outputValue)}`); + } + + return 'output with ' + descriptionPartsArray.join(', '); + } + + public assertUsing(inspector: StackInspector): boolean { + if (!('Outputs' in inspector.value)) { + return false; + } + + for (const [name, props] of Object.entries(inspector.value.Outputs as Record)) { + const mismatchedFields = new Array(); + + if (this.outputName && name !== this.outputName) { + mismatchedFields.push('name'); + } + + if (this.exportName && JSON.stringify(this.exportName) !== JSON.stringify(props.Export?.Name)) { + mismatchedFields.push('export name'); + } + + if (this.outputValue && JSON.stringify(this.outputValue) !== JSON.stringify(props.Value)) { + mismatchedFields.push('value'); + } + + if (mismatchedFields.length === 0) { + return true; + } + + this.inspected.push({ + output: { [name]: props }, + failureReason: `mismatched ${mismatchedFields.join(', ')}`, + }); + } + + return false; + } + + public generateErrorMessage() { + const lines = new Array(); + + lines.push(`None of ${this.inspected.length} outputs matches ${this.description}.`); + + for (const inspected of this.inspected) { + lines.push(`- ${inspected.failureReason} in:`); + lines.push(indent(4, JSON.stringify(inspected.output, null, 2))); + } + + return lines.join('\n'); + } +} + +/** + * Interface for haveOutput function properties + * NOTE that at least one of [outputName, exportName] should be provided + */ +export interface HaveOutputProperties { + /** + * Logical ID of the output + * @default - the logical ID of the output will not be checked + */ + outputName?: string; + /** + * Export name of the output, when it's exported for cross-stack referencing + * @default - the export name is not required and will not be checked + */ + exportName?: any; + /** + * Value of the output; + * @default - the value will not be checked + */ + outputValue?: any; +} + +interface InspectionFailure { + output: any; + failureReason: string; +} + +/** + * An assertion to check whether Output with particular properties is present in a stack + * @param props properties of the Output that is being asserted against. + * Check ``HaveOutputProperties`` interface to get full list of available parameters + */ +export function haveOutput(props: HaveOutputProperties): JestFriendlyAssertion { + return new HaveOutputAssertion(props.outputName, props.exportName, props.outputValue); +} + +function indent(n: number, s: string) { + const prefix = ' '.repeat(n); + return prefix + s.replace(/\n/g, '\n' + prefix); +} diff --git a/packages/@aws-cdk/assert/lib/assertions/have-resource.ts b/packages/@aws-cdk/assert/lib/assertions/have-resource.ts index d6653f3b64ce6..8d9eb68a562f5 100644 --- a/packages/@aws-cdk/assert/lib/assertions/have-resource.ts +++ b/packages/@aws-cdk/assert/lib/assertions/have-resource.ts @@ -1,6 +1,16 @@ -import { Assertion } from "../assertion"; +import { Assertion, JestFriendlyAssertion } from "../assertion"; import { StackInspector } from "../inspector"; +/** + * Magic value to signify that a certain key should be absent from the property bag. + * + * The property is either not present or set to `undefined. + * + * NOTE: `ABSENT` only works with the `haveResource()` and `haveResourceLike()` + * assertions. + */ +export const ABSENT = '{{ABSENT}}'; + /** * An assertion to check whether a resource of a given type and with the given properties exists, disregarding properties * @@ -30,8 +40,8 @@ export function haveResourceLike(resourceType: string, type PropertyPredicate = (props: any, inspection: InspectionFailure) => boolean; -export class HaveResourceAssertion extends Assertion { - private inspected: InspectionFailure[] = []; +export class HaveResourceAssertion extends JestFriendlyAssertion { + private readonly inspected: InspectionFailure[] = []; private readonly part: ResourcePart; private readonly predicate: PropertyPredicate; @@ -117,67 +127,89 @@ export interface InspectionFailure { * * A super-object has the same or more property values, recursing into sub properties if ``allowValueExtension`` is true. */ -export function isSuperObject(superObj: any, obj: any, errors: string[] = [], allowValueExtension: boolean = false): boolean { - if (obj == null) { return true; } - if (Array.isArray(superObj) !== Array.isArray(obj)) { +export function isSuperObject(superObj: any, pattern: any, errors: string[] = [], allowValueExtension: boolean = false): boolean { + if (pattern == null) { return true; } + if (Array.isArray(superObj) !== Array.isArray(pattern)) { errors.push('Array type mismatch'); return false; } if (Array.isArray(superObj)) { - if (obj.length !== superObj.length) { + if (pattern.length !== superObj.length) { errors.push('Array length mismatch'); return false; } // Do isSuperObject comparison for individual objects - for (let i = 0; i < obj.length; i++) { - if (!isSuperObject(superObj[i], obj[i], [], allowValueExtension)) { + for (let i = 0; i < pattern.length; i++) { + if (!isSuperObject(superObj[i], pattern[i], [], allowValueExtension)) { errors.push(`Array element ${i} mismatch`); } } return errors.length === 0; } - if ((typeof superObj === 'object') !== (typeof obj === 'object')) { + if ((typeof superObj === 'object') !== (typeof pattern === 'object')) { errors.push('Object type mismatch'); return false; } - if (typeof obj === 'object') { - for (const key of Object.keys(obj)) { - if (!(key in superObj)) { - errors.push(`Field ${key} missing`); + if (typeof pattern === 'object') { + for (const [patternKey, patternValue] of Object.entries(pattern)) { + if (patternValue === ABSENT) { + if (superObj[patternKey] !== undefined) { errors.push(`Field ${patternKey} present, but shouldn't be`); } + continue; + } + + if (!(patternKey in superObj)) { + errors.push(`Field ${patternKey} missing`); continue; } + const innerErrors = new Array(); const valueMatches = allowValueExtension - ? isSuperObject(superObj[key], obj[key], [], allowValueExtension) - : isStrictlyEqual(superObj[key], obj[key]); + ? isSuperObject(superObj[patternKey], patternValue, innerErrors, allowValueExtension) + : isStrictlyEqual(superObj[patternKey], patternValue, innerErrors); if (!valueMatches) { - errors.push(`Field ${key} mismatch`); + errors.push(`Field ${patternKey} mismatch: ${innerErrors.join(', ')}`); } } return errors.length === 0; } - if (superObj !== obj) { + if (superObj !== pattern) { errors.push('Different values'); } return errors.length === 0; +} + +function isStrictlyEqual(left: any, pattern: any, errors: string[]): boolean { + if (left === pattern) { return true; } + if (typeof left !== typeof pattern) { + errors.push(`${typeof left} !== ${typeof pattern}`); + return false; + } - function isStrictlyEqual(left: any, right: any): boolean { - if (left === right) { return true; } - if (typeof left !== typeof right) { return false; } - if (typeof left === 'object' && typeof right === 'object') { - if (Array.isArray(left) !== Array.isArray(right)) { return false; } - const allKeys = new Set([...Object.keys(left), ...Object.keys(right)]); - for (const key of allKeys) { - if (!isStrictlyEqual(left[key], right[key])) { + if (typeof left === 'object' && typeof pattern === 'object') { + if (Array.isArray(left) !== Array.isArray(pattern)) { return false; } + const allKeys = new Set([...Object.keys(left), ...Object.keys(pattern)]); + for (const key of allKeys) { + if (pattern[key] === ABSENT) { + if (left[key] !== undefined) { + errors.push(`Field ${key} present, but shouldn't be`); return false; } + return true; + } + + const innerErrors = new Array(); + if (!isStrictlyEqual(left[key], pattern[key], innerErrors)) { + errors.push(`${Array.isArray(left) ? 'element ' : ''}${key}: ${innerErrors.join(', ')}`); + return false; } - return true; } - return false; + return true; } + + errors.push(`${left} !== ${pattern}`); + return false; } /** diff --git a/packages/@aws-cdk/assert/lib/assertions/match-template.ts b/packages/@aws-cdk/assert/lib/assertions/match-template.ts index 212f0e40b49e2..ea43980336e9b 100644 --- a/packages/@aws-cdk/assert/lib/assertions/match-template.ts +++ b/packages/@aws-cdk/assert/lib/assertions/match-template.ts @@ -1,4 +1,4 @@ -import cfnDiff = require('@aws-cdk/cloudformation-diff'); +import * as cfnDiff from '@aws-cdk/cloudformation-diff'; import { Assertion } from '../assertion'; import { StackInspector } from '../inspector'; diff --git a/packages/@aws-cdk/assert/lib/expect.ts b/packages/@aws-cdk/assert/lib/expect.ts index 466062c21fa0e..392d374cb52a1 100644 --- a/packages/@aws-cdk/assert/lib/expect.ts +++ b/packages/@aws-cdk/assert/lib/expect.ts @@ -1,5 +1,5 @@ -import cdk = require('@aws-cdk/core'); -import api = require('@aws-cdk/cx-api'); +import * as cdk from '@aws-cdk/core'; +import * as api from '@aws-cdk/cx-api'; import { StackInspector } from './inspector'; import { SynthUtils } from './synth-utils'; diff --git a/packages/@aws-cdk/assert/lib/index.ts b/packages/@aws-cdk/assert/lib/index.ts index b79d93592affc..ff3516dc2f6fd 100644 --- a/packages/@aws-cdk/assert/lib/index.ts +++ b/packages/@aws-cdk/assert/lib/index.ts @@ -4,6 +4,7 @@ export * from './inspector'; export * from './synth-utils'; export * from './assertions/exist'; +export * from './assertions/have-output'; export * from './assertions/have-resource'; export * from './assertions/have-type'; export * from './assertions/match-template'; diff --git a/packages/@aws-cdk/assert/lib/inspector.ts b/packages/@aws-cdk/assert/lib/inspector.ts index a59dd645376d6..8c3a8d0be9240 100644 --- a/packages/@aws-cdk/assert/lib/inspector.ts +++ b/packages/@aws-cdk/assert/lib/inspector.ts @@ -1,4 +1,4 @@ -import api = require('@aws-cdk/cx-api'); +import * as api from '@aws-cdk/cx-api'; import { Assertion, not } from './assertion'; import { MatchStyle, matchTemplate } from './assertions/match-template'; diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index 7d9c142cb37e9..57d21926919b1 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -1,15 +1,15 @@ -import { App, ConstructNode, Stack, SynthesisOptions } from '@aws-cdk/core'; -import cxapi = require('@aws-cdk/cx-api'); -import fs = require('fs'); -import path = require('path'); +import * as core from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import * as fs from 'fs'; +import * as path from 'path'; export class SynthUtils { - public static synthesize(stack: Stack, options: SynthesisOptions = { }): cxapi.CloudFormationStackArtifact { + public static synthesize(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact { // always synthesize against the root (be it an App or whatever) so all artifacts will be included const root = stack.node.root; // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof App ? root.synth() : ConstructNode.synth(root.node, options); + const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options); return assembly.getStackArtifact(stack.artifactId); } @@ -17,7 +17,7 @@ export class SynthUtils { /** * Synthesizes the stack and returns the resulting CloudFormation template. */ - public static toCloudFormation(stack: Stack, options: SynthesisOptions = { }): any { + public static toCloudFormation(stack: core.Stack, options: core.SynthesisOptions = { }): any { const synth = this._synthesizeWithNested(stack, options); if (synth instanceof cxapi.CloudFormationStackArtifact) { return synth.template; @@ -29,7 +29,7 @@ export class SynthUtils { /** * @returns Returns a subset of the synthesized CloudFormation template (only specific resource types). */ - public static subset(stack: Stack, options: SubsetOptions): any { + public static subset(stack: core.Stack, options: SubsetOptions): any { const template = this.toCloudFormation(stack); if (template.Resources) { for (const [key, resource] of Object.entries(template.Resources)) { @@ -49,15 +49,15 @@ export class SynthUtils { * @return CloudFormationStackArtifact for normal stacks or the actual template for nested stacks * @internal */ - public static _synthesizeWithNested(stack: Stack, options: SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { + public static _synthesizeWithNested(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { // always synthesize against the root (be it an App or whatever) so all artifacts will be included const root = stack.node.root; // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof App ? root.synth() : ConstructNode.synth(root.node, options); + const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options); // if this is a nested stack (it has a parent), then just read the template as a string - if (stack.parentStack) { + if (stack.nestedStackParent) { return JSON.parse(fs.readFileSync(path.join(assembly.directory, stack.templateFile)).toString('utf-8')); } diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 987f6bd788899..76aafb2124f92 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/assert", - "version": "1.17.1", + "version": "999.0.0", "description": "An assertion library for use with CDK Apps", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -14,10 +14,13 @@ "build+test+package": "npm run build+test && npm run package", "build+test": "npm run build && npm test" }, - "nyc": { - "statements": 40, - "lines": 40, - "branches": 30 + "jest": { + "coverageThreshold": { + "global": { + "statements": 75, + "branches": 65 + } + } }, "author": { "name": "Amazon Web Services", @@ -26,16 +29,20 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/jest": "^24.0.23", - "cdk-build-tools": "1.17.1", - "pkglint": "1.17.1" + "@types/jest": "^25.1.2", + "cdk-build-tools": "999.0.0", + "jest": "^24.9.0", + "pkglint": "999.0.0", + "ts-jest": "^25.2.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.17.1", - "@aws-cdk/core": "1.17.1", - "@aws-cdk/cx-api": "1.17.1", - "jest": "^24.9.0", - "source-map-support": "^0.5.16" + "@aws-cdk/cloudformation-diff": "999.0.0", + "@aws-cdk/core": "999.0.0", + "@aws-cdk/cx-api": "999.0.0" + }, + "peerDependencies": { + "@aws-cdk/core": "999.0.0", + "jest": "^24.9.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", @@ -51,4 +58,4 @@ "node": ">= 10.3.0" }, "stability": "experimental" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/assert/test/test.assertions.ts b/packages/@aws-cdk/assert/test/assertions.test.ts similarity index 60% rename from packages/@aws-cdk/assert/test/test.assertions.ts rename to packages/@aws-cdk/assert/test/assertions.test.ts index ea0c53a209ed1..d5a7f56132e36 100644 --- a/packages/@aws-cdk/assert/test/test.assertions.ts +++ b/packages/@aws-cdk/assert/test/assertions.test.ts @@ -1,38 +1,34 @@ -import 'source-map-support/register'; +import * as cdk from '@aws-cdk/core'; +import * as cx from '@aws-cdk/cx-api'; -import cdk = require('@aws-cdk/core'); -import cx = require('@aws-cdk/cx-api'); -import { Test } from 'nodeunit'; - -import { Stack } from '@aws-cdk/core'; -import { countResources, exist, expect, haveType, MatchStyle, matchTemplate } from '../lib/index'; +import { countResources, countResourcesLike, exist, expect as cdkExpect, haveType, MatchStyle, matchTemplate } from '../lib/index'; passingExample('expect at to have ', () => { const resourceType = 'Test::Resource'; const synthStack = synthesizedStack(stack => { new TestResource(stack, 'TestResource', { type: resourceType }); }); - expect(synthStack).at('/TestResource').to(haveType(resourceType)); + cdkExpect(synthStack).at('/TestResource').to(haveType(resourceType)); }); passingExample('expect non-synthesized stack at to have ', () => { const resourceType = 'Test::Resource'; const stack = new cdk.Stack(); new TestResource(stack, 'TestResource', { type: resourceType }); - expect(stack).at('/TestResource').to(haveType(resourceType)); + cdkExpect(stack).at('/TestResource').to(haveType(resourceType)); }); passingExample('expect at *not* to have ', () => { const resourceType = 'Test::Resource'; const synthStack = synthesizedStack(stack => { new TestResource(stack, 'TestResource', { type: resourceType }); }); - expect(synthStack).at('/TestResource').notTo(haveType('Foo::Bar')); + cdkExpect(synthStack).at('/TestResource').notTo(haveType('Foo::Bar')); }); passingExample('expect at to exist', () => { const resourceType = 'Test::Resource'; const synthStack = synthesizedStack(stack => { new TestResource(stack, 'TestResource', { type: resourceType }); }); - expect(synthStack).at('/TestResource').to(exist()); + cdkExpect(synthStack).at('/TestResource').to(exist()); }); passingExample('expect to match (exactly)