diff --git a/.gitattributes b/.gitattributes index 3f9b96c9c..390f8142c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,6 +19,7 @@ /.github/workflows/release-awscommunity-account-alternatecontact.yml linguist-generated /.github/workflows/release-awscommunity-cloudfront-s3website-module.yml linguist-generated /.github/workflows/release-awscommunity-dynamodb-item.yml linguist-generated +/.github/workflows/release-awscommunity-resource-lookup.yml linguist-generated /.github/workflows/release-awscommunity-s3-bucket-module.yml linguist-generated /.github/workflows/release-awscommunity-s3-deletebucketcontents.yml linguist-generated /.github/workflows/release-awscommunity-time-offset.yml linguist-generated diff --git a/.github/workflows/build-individual.yml b/.github/workflows/build-individual.yml index 8182891cb..fa354c6d4 100644 --- a/.github/workflows/build-individual.yml +++ b/.github/workflows/build-individual.yml @@ -115,6 +115,16 @@ jobs: - run: yarn build:awscommunity-dynamodb-item container: image: jsii/superchain:1-buster-slim-node16 + awscommunity-resource-lookup: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + - run: yarn install + - run: yarn build:awscommunity-resource-lookup + container: + image: jsii/superchain:1-buster-slim-node16 awscommunity-s3-bucket-module: runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/release-awscommunity-resource-lookup.yml b/.github/workflows/release-awscommunity-resource-lookup.yml new file mode 100644 index 000000000..66d9f02b1 --- /dev/null +++ b/.github/workflows/release-awscommunity-resource-lookup.yml @@ -0,0 +1,136 @@ +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + +name: release-awscommunity-resource-lookup +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" + - run: yarn install + - name: build:awscommunity-resource-lookup + run: npx projen build:awscommunity-resource-lookup + - run: mv packages/@cdk-cloudformation/awscommunity-resource-lookup/dist . + - name: Upload artifact + if: always() + uses: actions/upload-artifact@v2.1.1 + with: + name: build-artifact + path: dist + container: + image: jsii/superchain:1-buster-slim-node16 + release_npm: + name: Publish to npm + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifact + path: dist + - name: Restore build artifact permissions + run: cd dist && setfacl --restore=permissions-backup.acl + continue-on-error: true + - name: Release + env: + NPM_DIST_TAG: latest + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx -p publib@latest publib-npm + release_maven: + name: Publish to Maven Central + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11.x + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifact + path: dist + - name: Restore build artifact permissions + run: cd dist && setfacl --restore=permissions-backup.acl + continue-on-error: true + - name: Release + env: + MAVEN_ENDPOINT: https://s01.oss.sonatype.org + MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_STAGING_PROFILE_ID: ${{ secrets.MAVEN_STAGING_PROFILE_ID }} + run: npx -p publib@latest publib-maven + release_nuget: + name: Publish to NuGet Gallery + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: 3.x + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifact + path: dist + - name: Restore build artifact permissions + run: cd dist && setfacl --restore=permissions-backup.acl + continue-on-error: true + - name: Release + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + run: npx -p publib@latest publib-nuget + release_pypi: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifact + path: dist + - name: Restore build artifact permissions + run: cd dist && setfacl --restore=permissions-backup.acl + continue-on-error: true + - name: Release + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: npx -p publib@latest publib-pypi diff --git a/.gitignore b/.gitignore index 195bc4031..596f7615d 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,9 @@ junit.xml /packages/@cdk-cloudformation/awscommunity-dynamodb-item/dist/ /packages/@cdk-cloudformation/awscommunity-dynamodb-item/lib/ !/.github/workflows/release-awscommunity-dynamodb-item.yml +/packages/@cdk-cloudformation/awscommunity-resource-lookup/dist/ +/packages/@cdk-cloudformation/awscommunity-resource-lookup/lib/ +!/.github/workflows/release-awscommunity-resource-lookup.yml /packages/@cdk-cloudformation/awscommunity-s3-bucket-module/dist/ /packages/@cdk-cloudformation/awscommunity-s3-bucket-module/lib/ !/.github/workflows/release-awscommunity-s3-bucket-module.yml diff --git a/.mergify.yml b/.mergify.yml index c63b9c9f2..3b2bf4a65 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -18,6 +18,7 @@ queue_rules: - status-success=awscommunity-account-alternatecontact - status-success=awscommunity-cloudfront-s3website-module - status-success=awscommunity-dynamodb-item + - status-success=awscommunity-resource-lookup - status-success=awscommunity-s3-bucket-module - status-success=awscommunity-s3-deletebucketcontents - status-success=awscommunity-time-offset @@ -195,6 +196,7 @@ pull_request_rules: - status-success=awscommunity-account-alternatecontact - status-success=awscommunity-cloudfront-s3website-module - status-success=awscommunity-dynamodb-item + - status-success=awscommunity-resource-lookup - status-success=awscommunity-s3-bucket-module - status-success=awscommunity-s3-deletebucketcontents - status-success=awscommunity-time-offset diff --git a/.projen/files.json b/.projen/files.json index 131825b86..942a382d4 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -18,6 +18,7 @@ ".github/workflows/release-awscommunity-account-alternatecontact.yml", ".github/workflows/release-awscommunity-cloudfront-s3website-module.yml", ".github/workflows/release-awscommunity-dynamodb-item.yml", + ".github/workflows/release-awscommunity-resource-lookup.yml", ".github/workflows/release-awscommunity-s3-bucket-module.yml", ".github/workflows/release-awscommunity-s3-deletebucketcontents.yml", ".github/workflows/release-awscommunity-time-offset.yml", diff --git a/.projen/tasks.json b/.projen/tasks.json index ce061d594..536fd3606 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -156,6 +156,18 @@ } ] }, + "build:awscommunity-resource-lookup": { + "name": "build:awscommunity-resource-lookup", + "description": "build awscommunity-resource-lookup", + "steps": [ + { + "spawn": "compile:awscommunity-resource-lookup" + }, + { + "spawn": "package:awscommunity-resource-lookup" + } + ] + }, "build:awscommunity-s3-bucket-module": { "name": "build:awscommunity-s3-bucket-module", "description": "build awscommunity-s3-bucket-module", @@ -2142,6 +2154,16 @@ ], "cwd": "packages/@cdk-cloudformation/awscommunity-dynamodb-item" }, + "compile:awscommunity-resource-lookup": { + "name": "compile:awscommunity-resource-lookup", + "description": "compile awscommunity-resource-lookup with JSII", + "steps": [ + { + "exec": "jsii" + } + ], + "cwd": "packages/@cdk-cloudformation/awscommunity-resource-lookup" + }, "compile:awscommunity-s3-bucket-module": { "name": "compile:awscommunity-s3-bucket-module", "description": "compile awscommunity-s3-bucket-module with JSII", @@ -3814,6 +3836,16 @@ ], "cwd": "packages/@cdk-cloudformation/awscommunity-dynamodb-item" }, + "package:awscommunity-resource-lookup": { + "name": "package:awscommunity-resource-lookup", + "description": "produce multi-language packaging for awscommunity-resource-lookup", + "steps": [ + { + "exec": "jsii-pacmak --no-npmignore" + } + ], + "cwd": "packages/@cdk-cloudformation/awscommunity-resource-lookup" + }, "package:awscommunity-s3-bucket-module": { "name": "package:awscommunity-s3-bucket-module", "description": "produce multi-language packaging for awscommunity-s3-bucket-module", diff --git a/README.md b/README.md index 39a024a98..0ca296130 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ that version from your package manager. -Release status for 162 libraries: +Release status for 163 libraries: * [![alexa-ask-skill](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-alexa-ask-skill.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-alexa-ask-skill.yml) * [![aqua-enterprise-enforcer](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-aqua-enterprise-enforcer.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-aqua-enterprise-enforcer.yml) @@ -59,6 +59,7 @@ Release status for 162 libraries: * [![awscommunity-account-alternatecontact](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-account-alternatecontact.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-account-alternatecontact.yml) * [![awscommunity-cloudfront-s3website-module](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-cloudfront-s3website-module.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-cloudfront-s3website-module.yml) * [![awscommunity-dynamodb-item](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-dynamodb-item.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-dynamodb-item.yml) +* [![awscommunity-resource-lookup](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-resource-lookup.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-resource-lookup.yml) * [![awscommunity-s3-bucket-module](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-s3-bucket-module.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-s3-bucket-module.yml) * [![awscommunity-s3-deletebucketcontents](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-s3-deletebucketcontents.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-s3-deletebucketcontents.yml) * [![awscommunity-time-offset](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-time-offset.yml/badge.svg)](https://github.com/cdklabs/cdk-cloudformation/actions/workflows/release-awscommunity-time-offset.yml) diff --git a/package.json b/package.json index 7608eb523..089c99110 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build:awscommunity-account-alternatecontact": "npx projen build:awscommunity-account-alternatecontact", "build:awscommunity-cloudfront-s3website-module": "npx projen build:awscommunity-cloudfront-s3website-module", "build:awscommunity-dynamodb-item": "npx projen build:awscommunity-dynamodb-item", + "build:awscommunity-resource-lookup": "npx projen build:awscommunity-resource-lookup", "build:awscommunity-s3-bucket-module": "npx projen build:awscommunity-s3-bucket-module", "build:awscommunity-s3-deletebucketcontents": "npx projen build:awscommunity-s3-deletebucketcontents", "build:awscommunity-time-offset": "npx projen build:awscommunity-time-offset", @@ -179,6 +180,7 @@ "compile:awscommunity-account-alternatecontact": "npx projen compile:awscommunity-account-alternatecontact", "compile:awscommunity-cloudfront-s3website-module": "npx projen compile:awscommunity-cloudfront-s3website-module", "compile:awscommunity-dynamodb-item": "npx projen compile:awscommunity-dynamodb-item", + "compile:awscommunity-resource-lookup": "npx projen compile:awscommunity-resource-lookup", "compile:awscommunity-s3-bucket-module": "npx projen compile:awscommunity-s3-bucket-module", "compile:awscommunity-s3-deletebucketcontents": "npx projen compile:awscommunity-s3-deletebucketcontents", "compile:awscommunity-time-offset": "npx projen compile:awscommunity-time-offset", @@ -345,6 +347,7 @@ "package:awscommunity-account-alternatecontact": "npx projen package:awscommunity-account-alternatecontact", "package:awscommunity-cloudfront-s3website-module": "npx projen package:awscommunity-cloudfront-s3website-module", "package:awscommunity-dynamodb-item": "npx projen package:awscommunity-dynamodb-item", + "package:awscommunity-resource-lookup": "npx projen package:awscommunity-resource-lookup", "package:awscommunity-s3-bucket-module": "npx projen package:awscommunity-s3-bucket-module", "package:awscommunity-s3-deletebucketcontents": "npx projen package:awscommunity-s3-deletebucketcontents", "package:awscommunity-time-offset": "npx projen package:awscommunity-time-offset", diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/.gitignore b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.gitignore new file mode 100644 index 000000000..3c26cd33e --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.gitignore @@ -0,0 +1,15 @@ +# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/LICENSE +!/README.md +!/package.json +/.jsii +/lib/ +/tsconfig.json +/dist/ +tsconfig.tsbuildinfo +!/.npmignore diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/.npmignore b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.npmignore new file mode 100644 index 000000000..23f1be049 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.npmignore @@ -0,0 +1,8 @@ +# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +.projen +dist +src +test +tsconfig.tsbuildinfo +!.jsii +!.jsii.gz diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/.projen/files.json b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.projen/files.json new file mode 100644 index 000000000..e100c0f27 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.projen/files.json @@ -0,0 +1,13 @@ +{ + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "LICENSE", + "package.json", + "README.md" + ], + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." +} diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/.projen/tasks.json b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.projen/tasks.json new file mode 100644 index 000000000..559cf5025 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/.projen/tasks.json @@ -0,0 +1,56 @@ +{ + "tasks": { + "build": { + "name": "build", + "description": "Full release build", + "steps": [ + { + "spawn": "pre-compile" + }, + { + "spawn": "compile" + }, + { + "spawn": "post-compile" + }, + { + "spawn": "test" + }, + { + "spawn": "package" + } + ] + }, + "compile": { + "name": "compile", + "description": "Only compile" + }, + "default": { + "name": "default", + "description": "Synthesize project files", + "steps": [ + { + "exec": "npx projen default", + "cwd": "../../.." + } + ] + }, + "package": { + "name": "package", + "description": "Creates the distribution package" + }, + "post-compile": { + "name": "post-compile", + "description": "Runs after successful compilation" + }, + "pre-compile": { + "name": "pre-compile", + "description": "Prepare the project for compilation" + }, + "test": { + "name": "test", + "description": "Run tests" + } + }, + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." +} diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/LICENSE b/packages/@cdk-cloudformation/awscommunity-resource-lookup/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/LICENSE @@ -0,0 +1,202 @@ + + 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 [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/README.md b/packages/@cdk-cloudformation/awscommunity-resource-lookup/README.md new file mode 100644 index 000000000..350eff961 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/README.md @@ -0,0 +1,50 @@ +# awscommunity-resource-lookup + +> AWS CDK [L1 construct] and data structures for the [AWS CloudFormation Registry] type `AwsCommunity::Resource::Lookup` v1.0.0. + +[L1 construct]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html +[AWS CloudFormation Registry]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html + +## Description + +This resource uses the `ListResources` and `GetResource` actions of AWS Cloud Control API to perform a lookup of a resource of a given type (such as, `AWS::EC2::VPC`) in your AWS account -and current region if you are using a regional AWS service- based on a query you specify. If only one match is found, this resource returns the primary identifier of the resource (in the `AWS::EC2::VPC` example, the ID of the VPC), that you can then consume by referencing it in your template with the `Fn::GetAtt` intrinsic function. Note: as this resource type uses Cloud Control API, you can specify resource type search targets -like `AWS::EC2::VPC`- that are supported by Cloud Control API; for more information, see `Determining if a resource type supports Cloud Control API`: https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-types.html#resource-types-determine-support . + +## References + +* [Documentation](https://github.com/aws-cloudformation/community-registry-extensions/blob/main/resources/Resource_Lookup/README.md) +* [Source](https://github.com/aws-cloudformation/community-registry-extensions/tree/main/resources/Resource_Lookup) + +## Usage + +In order to use this library, you will need to activate this AWS CloudFormation Registry type in your account. You can do this via the AWS Management Console or using the [AWS CLI](https://aws.amazon.com/cli/) using the following command: + +```sh +aws cloudformation activate-type \ + --type-name AwsCommunity::Resource::Lookup \ + --publisher-id c830e97710da0c9954d80ba8df021e5439e7134b \ + --type RESOURCE \ + --execution-role-arn ROLE-ARN +``` + +Alternatively: + +```sh +aws cloudformation activate-type \ + --public-type-arn arn:aws:cloudformation:us-east-1::type/resource/c830e97710da0c9954d80ba8df021e5439e7134b/AwsCommunity-Resource-Lookup \ + --execution-role-arn ROLE-ARN +``` + +You can find more information about activating this type in the [AWS CloudFormation documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html). + +## Feedback + +This library is auto-generated and published to all supported programming languages by the [cdklabs/cdk-cloudformation] project based on the API schema published for `AwsCommunity::Resource::Lookup`. + +* Issues related to this generated library should be [reported here](https://github.com/cdklabs/cdk-cloudformation/issues/new?title=Issue+with+%40cdk-cloudformation%2Fawscommunity-resource-lookup+v1.0.0). +* Issues related to `AwsCommunity::Resource::Lookup` should be reported to the [publisher](https://github.com/aws-cloudformation/community-registry-extensions/blob/main/resources/Resource_Lookup/README.md). + +[cdklabs/cdk-cloudformation]: https://github.com/cdklabs/cdk-cloudformation + +## License + +Distributed under the Apache-2.0 License. diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/package.json b/packages/@cdk-cloudformation/awscommunity-resource-lookup/package.json new file mode 100644 index 000000000..8f5cb7501 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/package.json @@ -0,0 +1,73 @@ +{ + "name": "@cdk-cloudformation/awscommunity-resource-lookup", + "description": "This resource uses the `ListResources` and `GetResource` actions of AWS Cloud Control API to perform a lookup of a resource of a given type (such as, `AWS::EC2::VPC`) in your AWS account -and current region if you are using a regional AWS service- based on a query you specify. If only one match is found, this resource returns the primary identifier of the resource (in the `AWS::EC2::VPC` example, the ID of the VPC), that you can then consume by referencing it in your template with the `Fn::GetAtt` intrinsic function. Note: as this resource type uses Cloud Control API, you can specify resource type search targets -like `AWS::EC2::VPC`- that are supported by Cloud Control API; for more information, see `Determining if a resource type supports Cloud Control API`: https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-types.html#resource-types-determine-support .", + "version": "1.0.0-alpha.7", + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "keywords": [ + "cdk", + "awscdk", + "aws-cdk", + "cloudformation", + "cfn", + "extensions", + "constructs", + "cfn-resources", + "cloudformation-registry", + "l1", + "awscommunity", + "resource", + "lookup" + ], + "homepage": "https://github.com/aws-cloudformation/community-registry-extensions/blob/main/resources/Resource_Lookup/README.md", + "repository": { + "type": "git", + "url": "https://github.com/cdklabs/cdk-cloudformation.git", + "directory": "packages/@cdk-cloudformation/awscommunity-resource-lookup" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "publishConfig": { + "access": "public" + }, + "jsii": { + "outdir": "dist", + "targets": { + "java": { + "package": "io.github.cdklabs.cdk_cloudformation.awscommunity_resource_lookup", + "maven": { + "groupId": "io.github.cdklabs.cdk_cloudformation", + "artifactId": "awscommunity-resource-lookup" + } + }, + "python": { + "distName": "cdk-cloudformation-awscommunity-resource-lookup", + "module": "cdk_cloudformation_awscommunity_resource_lookup" + }, + "dotnet": { + "namespace": "CdkCloudFormation.AwsCommunityResourceLookup", + "packageId": "CdkCloudFormation.AwsCommunityResourceLookup" + } + }, + "tsc": { + "outDir": "lib", + "rootDir": "src", + "types": [ + "node" + ] + } + }, + "peerDependencies": { + "aws-cdk-lib": "^2.81.0", + "constructs": "^10.2.36" + }, + "devDependencies": { + "aws-cdk-lib": "2.81.0", + "constructs": "10.2.36" + }, + "license": "Apache-2.0", + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." +} diff --git a/packages/@cdk-cloudformation/awscommunity-resource-lookup/src/index.ts b/packages/@cdk-cloudformation/awscommunity-resource-lookup/src/index.ts new file mode 100644 index 000000000..68074f2d7 --- /dev/null +++ b/packages/@cdk-cloudformation/awscommunity-resource-lookup/src/index.ts @@ -0,0 +1,119 @@ +// Generated by cdk-import +import * as cdk from 'aws-cdk-lib'; +import * as constructs from 'constructs'; + +/** + * This resource uses the `ListResources` and `GetResource` actions of AWS Cloud Control API to perform a lookup of a resource of a given type (such as, `AWS::EC2::VPC`) in your AWS account -and current region if you are using a regional AWS service- based on a query you specify. If only one match is found, this resource returns the primary identifier of the resource (in the `AWS::EC2::VPC` example, the ID of the VPC), that you can then consume by referencing it in your template with the `Fn::GetAtt` intrinsic function. Note: as this resource type uses Cloud Control API, you can specify resource type search targets -like `AWS::EC2::VPC`- that are supported by Cloud Control API; for more information, see `Determining if a resource type supports Cloud Control API`: https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-types.html#resource-types-determine-support . + * + * @schema CfnLookupProps + */ +export interface CfnLookupProps { + /** + * The resource type name you wish to use for the lookup operation. + * + * @schema CfnLookupProps#TypeName + */ + readonly typeName: string; + + /** + * A query, in JMESPath (https://jmespath.org/) format, to perform the resource lookup; for example: `Tags[?Key == 'Owner' && Value == 'test-only']`. When you specify a new value on resource updates (for example, when you update the stack that describes this resource), a new lookup will be performed. + * + * @schema CfnLookupProps#JmesPathQuery + */ + readonly jmesPathQuery: string; + + /** + * The Amazon Resource Name (ARN) of the IAM role you wish to use for performing resource lookup operations in your AWS account on your behalf; for example: `arn:aws:iam::111122223333:role/my-example-role`. The role whose ARN you specify for this property is passed to AWS Cloud Control API's `ListResources` and `GetResource` actions when this resource type calls them on your behalf against resource type targets (such as, `AWS::EC2::VPC`). As for the role, for example, you could create an IAM role whose `Service` `Principal` is `cloudformation.amazonaws.com` in the trust policy, and whose policy is e.g., a `ReadOnlyAccess` AWS managed policy, or another managed policy you choose, or your own policy, depending on which permissions you require. + * + * @schema CfnLookupProps#ResourceLookupRoleArn + */ + readonly resourceLookupRoleArn: string; + + /** + * The model of the resource you're using: this additional information is required if you're using a resource type shown in the `Resources that require additional information` page (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-list.html#resource-operations-list-containers). Specify the required properties using the JSON format; for example, to specify `LoadBalancerArn` and its ARN value for `AWS::ElasticLoadBalancingV2::Listener` (that you specify in the `TypeName` property): `{"LoadBalancerArn": "REPLACE_WITH_YOUR_LOAD_BALANCER_ARN"}`. + * + * @schema CfnLookupProps#ResourceModel + */ + readonly resourceModel?: string; + + /** + * Optional, numeric integer value (such as `1`, `2`), that you can specify to induce a new search on e.g., stack updates without modifying the value for `JmesPathQuery`. Specify a value that is different from the previous one to induce the update; note that either adding this property to the resource if not present before an update, or removing it if previously added to the resource, will yield the same effect of changing the property value and will induce an update. + * + * @schema CfnLookupProps#LookupSerialNumber + */ + readonly lookupSerialNumber?: string; + + /** + * Optional key-value pairs object (such as, `Env: Dev`, `Name: Test`) to associate to the AWS Systems Manager Parameter Store parameter resource, that the implementation of this resource type creates in your account to persist the lookup result. + * + * @schema CfnLookupProps#Tags + */ + readonly tags?: any; + +} + +/** + * Converts an object of type 'CfnLookupProps' to JSON representation. + */ +/* eslint-disable max-len, quote-props */ +export function toJson_CfnLookupProps(obj: CfnLookupProps | undefined): Record | undefined { + if (obj === undefined) { return undefined; } + const result = { + 'TypeName': obj.typeName, + 'JmesPathQuery': obj.jmesPathQuery, + 'ResourceLookupRoleArn': obj.resourceLookupRoleArn, + 'ResourceModel': obj.resourceModel, + 'LookupSerialNumber': obj.lookupSerialNumber, + 'Tags': obj.tags, + }; + // filter undefined values + return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); +} +/* eslint-enable max-len, quote-props */ + + +/** + * A CloudFormation `AwsCommunity::Resource::Lookup` + * + * @cloudformationResource AwsCommunity::Resource::Lookup + * @stability external + * @link https://github.com/aws-cloudformation/community-registry-extensions/tree/main/resources/Resource_Lookup + */ +export class CfnLookup extends cdk.CfnResource { + /** + * The CloudFormation resource type name for this resource class. + */ + public static readonly CFN_RESOURCE_TYPE_NAME = "AwsCommunity::Resource::Lookup"; + + /** + * Resource props. + */ + public readonly props: CfnLookupProps; + + /** + * Attribute `AwsCommunity::Resource::Lookup.ResourceIdentifier` + * @link https://github.com/aws-cloudformation/community-registry-extensions/tree/main/resources/Resource_Lookup + */ + public readonly attrResourceIdentifier: string; + /** + * Attribute `AwsCommunity::Resource::Lookup.ResourceLookupId` + * @link https://github.com/aws-cloudformation/community-registry-extensions/tree/main/resources/Resource_Lookup + */ + public readonly attrResourceLookupId: string; + + /** + * Create a new `AwsCommunity::Resource::Lookup`. + * + * @param scope - scope in which this resource is defined + * @param id - scoped id of the resource + * @param props - resource properties + */ + constructor(scope: constructs.Construct, id: string, props: CfnLookupProps) { + super(scope, id, { type: CfnLookup.CFN_RESOURCE_TYPE_NAME, properties: toJson_CfnLookupProps(props)! }); + + this.props = props; + + this.attrResourceIdentifier = cdk.Token.asString(this.getAtt('ResourceIdentifier')); + this.attrResourceLookupId = cdk.Token.asString(this.getAtt('ResourceLookupId')); + } +} \ No newline at end of file diff --git a/registry/types/awscommunity-resource-lookup.json b/registry/types/awscommunity-resource-lookup.json new file mode 100644 index 000000000..6b1a93cfe --- /dev/null +++ b/registry/types/awscommunity-resource-lookup.json @@ -0,0 +1,17 @@ +{ + "Arn": "arn:aws:cloudformation:us-east-1::type/resource/c830e97710da0c9954d80ba8df021e5439e7134b/AwsCommunity-Resource-Lookup", + "Type": "RESOURCE", + "TypeName": "AwsCommunity::Resource::Lookup", + "Description": "This resource uses the `ListResources` and `GetResource` actions of AWS Cloud Control API to perform a lookup of a resource of a given type (such as, `AWS::EC2::VPC`) in your AWS account -and current region if you are using a regional AWS service- based on a query you specify. If only one match is found, this resource returns the primary identifier of the resource (in the `AWS::EC2::VPC` example, the ID of the VPC), that you can then consume by referencing it in your template with the `Fn::GetAtt` intrinsic function. Note: as this resource type uses Cloud Control API, you can specify resource type search targets -like `AWS::EC2::VPC`- that are supported by Cloud Control API; for more information, see `Determining if a resource type supports Cloud Control API`: https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-types.html#resource-types-determine-support .", + "Schema": "{\n \"typeName\": \"AwsCommunity::Resource::Lookup\",\n \"description\": \"This resource uses the `ListResources` and `GetResource` actions of AWS Cloud Control API to perform a lookup of a resource of a given type (such as, `AWS::EC2::VPC`) in your AWS account -and current region if you are using a regional AWS service- based on a query you specify. If only one match is found, this resource returns the primary identifier of the resource (in the `AWS::EC2::VPC` example, the ID of the VPC), that you can then consume by referencing it in your template with the `Fn::GetAtt` intrinsic function. Note: as this resource type uses Cloud Control API, you can specify resource type search targets -like `AWS::EC2::VPC`- that are supported by Cloud Control API; for more information, see `Determining if a resource type supports Cloud Control API`: https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-types.html#resource-types-determine-support .\",\n \"sourceUrl\": \"https://github.com/aws-cloudformation/community-registry-extensions/tree/main/resources/Resource_Lookup\",\n \"documentationUrl\": \"https://github.com/aws-cloudformation/community-registry-extensions/blob/main/resources/Resource_Lookup/README.md\",\n \"properties\": {\n \"TypeName\": {\n \"description\": \"The resource type name you wish to use for the lookup operation.\",\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$\"\n },\n \"JmesPathQuery\": {\n \"description\": \"A query, in JMESPath (https://jmespath.org/) format, to perform the resource lookup; for example: `Tags[?Key == 'Owner' && Value == 'test-only']`. When you specify a new value on resource updates (for example, when you update the stack that describes this resource), a new lookup will be performed.\",\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 4096\n },\n \"ResourceLookupRoleArn\": {\n \"description\": \"The Amazon Resource Name (ARN) of the IAM role you wish to use for performing resource lookup operations in your AWS account on your behalf; for example: `arn:aws:iam::111122223333:role/my-example-role`. The role whose ARN you specify for this property is passed to AWS Cloud Control API's `ListResources` and `GetResource` actions when this resource type calls them on your behalf against resource type targets (such as, `AWS::EC2::VPC`). As for the role, for example, you could create an IAM role whose `Service` `Principal` is `cloudformation.amazonaws.com` in the trust policy, and whose policy is e.g., a `ReadOnlyAccess` AWS managed policy, or another managed policy you choose, or your own policy, depending on which permissions you require.\",\n \"type\": \"string\",\n \"pattern\": \"^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\\\\/[\\\\w+=,.@-]{1,64}$\"\n },\n \"ResourceModel\": {\n \"description\": \"The model of the resource you're using: this additional information is required if you're using a resource type shown in the `Resources that require additional information` page (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-list.html#resource-operations-list-containers). Specify the required properties using the JSON format; for example, to specify `LoadBalancerArn` and its ARN value for `AWS::ElasticLoadBalancingV2::Listener` (that you specify in the `TypeName` property): `{\\\"LoadBalancerArn\\\": \\\"REPLACE_WITH_YOUR_LOAD_BALANCER_ARN\\\"}`.\",\n \"type\": \"string\",\n \"pattern\": \"^[\\\\s\\\\S]*$\"\n },\n \"LookupSerialNumber\": {\n \"description\": \"Optional, numeric integer value (such as `1`, `2`), that you can specify to induce a new search on e.g., stack updates without modifying the value for `JmesPathQuery`. Specify a value that is different from the previous one to induce the update; note that either adding this property to the resource if not present before an update, or removing it if previously added to the resource, will yield the same effect of changing the property value and will induce an update.\",\n \"type\": \"string\",\n \"pattern\": \"^[0-9]*$\"\n },\n \"Tags\": {\n \"type\": \"object\",\n \"description\": \"Optional key-value pairs object (such as, `Env: Dev`, `Name: Test`) to associate to the AWS Systems Manager Parameter Store parameter resource, that the implementation of this resource type creates in your account to persist the lookup result.\",\n \"patternProperties\": {\n \"^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false\n },\n \"ResourceLookupId\": {\n \"description\": \"When this resource type finds only one match as the result of a lookup operation, it then creates an AWS Systems Manager Parameter Store parameter resource in your account and current region to persist the lookup result for subsequent use (for example, when its `Read` handler is invoked). `ResourceLookupId` holds the name of the Parameter Store parameter; for example: `/CloudFormation/AwsCommunity/Resource/Lookup/resource-lookup-id-11112222-3333-aaaa-bbbb-ccccddddeeee`.\",\n \"type\": \"string\"\n },\n \"ResourceIdentifier\": {\n \"description\": \"The resource identifier. For example, the ID of a VPC if you looked up an `AWS::EC2::VPC` resource type for which only one match was found.\",\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"JmesPathQuery\",\n \"ResourceLookupRoleArn\",\n \"TypeName\"\n ],\n \"readOnlyProperties\": [\n \"/properties/ResourceIdentifier\",\n \"/properties/ResourceLookupId\"\n ],\n \"writeOnlyProperties\": [\n \"/properties/JmesPathQuery\",\n \"/properties/ResourceLookupRoleArn\",\n \"/properties/ResourceModel\",\n \"/properties/LookupSerialNumber\"\n ],\n \"primaryIdentifier\": [\n \"/properties/ResourceLookupId\"\n ],\n \"createOnlyProperties\": [\n \"/properties/JmesPathQuery\",\n \"/properties/ResourceLookupRoleArn\",\n \"/properties/ResourceModel\",\n \"/properties/TypeName\",\n \"/properties/LookupSerialNumber\"\n ],\n \"tagging\": {\n \"taggable\": true,\n \"tagOnCreate\": true,\n \"tagUpdatable\": true,\n \"cloudFormationSystemTags\": false,\n \"tagProperty\": \"/properties/Tags\"\n },\n \"handlers\": {\n \"create\": {\n \"permissions\": [\n \"cloudformation:GetResource\",\n \"cloudformation:ListResources\",\n \"iam:PassRole\",\n \"ssm:AddTagsToResource\",\n \"ssm:GetParameter\",\n \"ssm:PutParameter\"\n ]\n },\n \"update\": {\n \"permissions\": [\n \"ssm:AddTagsToResource\",\n \"ssm:AddTagsToResource\",\n \"ssm:GetParameter\",\n \"ssm:RemoveTagsFromResource\"\n ]\n },\n \"read\": {\n \"permissions\": [\n \"ssm:GetParameter\",\n \"ssm:GetParameters\",\n \"ssm:ListTagsForResource\"\n ]\n },\n \"delete\": {\n \"permissions\": [\n \"ssm:DeleteParameter\"\n ]\n },\n \"list\": {\n \"permissions\": [\n \"ssm:DescribeParameters\"\n ]\n }\n }\n}\n", + "ProvisioningType": "FULLY_MUTABLE", + "DeprecatedStatus": "LIVE", + "RequiredActivatedTypes": [], + "Visibility": "PUBLIC", + "SourceUrl": "https://github.com/aws-cloudformation/community-registry-extensions/tree/main/resources/Resource_Lookup", + "DocumentationUrl": "https://github.com/aws-cloudformation/community-registry-extensions/blob/main/resources/Resource_Lookup/README.md", + "TimeCreated": "2023-05-23T17:42:52.665Z", + "PublisherId": "c830e97710da0c9954d80ba8df021e5439e7134b", + "LatestPublicVersion": "1.0.0", + "IsActivated": false +} \ No newline at end of file