A construct library that model Construct Hub instances.
Project description
Construct Hub
This project maintains a AWS Cloud Development Kit construct library that can be used to deploy instances of the Construct Hub in any AWS Account.
Development
The test/devapp
directory includes an AWS CDK app designed for deploying the
construct hub into a development account. This app is also used as a golden
snapshot, so every time the construct changes, you'll see its snapshot updated.
To bootstrap your developer account, use the following command:
CDK_NEW_BOOTSTRAP=1 npx cdk bootstrap aws://ACCOUNT/REGION
Use the following tasks to work with the dev app. It will always work with the currently configured CLI account/region:
yarn dev:synth
- synthesize intotest/devapp/cdk.out
yarn dev:deploy
- deploy to the current environmentyarn dev:diff
- diff against the current environment
Testing
To run all tests, run yarn test
.
Unit tests are implemented using jest.
Integration tests are implemented as small CDK applications under files called
.integ.ts
. For each integration test, you can use the following tasks:
integ:xxx:deploy
- deploys the integration test to your personal development account and stores the output under a.cdkout
directory which is committed to the repository.integ:xxx:assert
- runs duringyarn test
and compares the synthesized output of the test to the one in.cdkout
.integ:xxx:snapshot
- synthesizes the app and updates the snapshot without actually deploying the stack (generally not recommended)integ:xxx:destroy
- can be used to delete the integration test app (called bydeploy
as well)
To deploy integration test apps, you'll need to configure your environment with
AWS credentials as well as set AWS_REGION
to refer to the region you wish to
use.
Integration tests use "triggers" which are lambda functions that are executed
during deployment and are used to make assertions about the deployed resources.
Triggers are automatically generated for all files named trigger.xxx.lambda.ts
(for example, trigger.prune-test.lambda.ts
) and can just be added to the
integration test stack with the relevant dependencies. See the deny-list
integration test as an example.
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for construct_hub-0.1.126-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2bf441f1088f3d64ba93d3340d1efa42863ee3e8917603e460e979f47d8e3f8 |
|
MD5 | 4f888aea18a1175d06fc8e28cdb2b852 |
|
BLAKE2b-256 | 5af03b9f38f0d6e7ee25494ee7615bf621b63203c63f96f4cc91ebd41043ec7b |