cdk-stack-resource-rename
Project description
StackResourceRenamer
A CDK aspect, StackResourceRenamer renames CDK stack name and stack's subordinate resources' custom physical names, so that a CDK stack can be used to create multiple stacks in same AWS environment without confliction.
Sample
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
app = core.App()
stack = core.Stack(app, "my-stack")
alias = stack.node.try_get_context("alias")
if alias !== undefined:
# if alias is defined, rename stack and resources' custom names
# with the "rename" function/method.
StackResourceRenamer.rename(stack,
rename=(origName, _)=>{
return origName+'-'+alias;
}
)
# resources in stack
bucket = s3.Bucket(stack, "bucket",
bucket_name="my-bucket"
)
To create multiple stacks:
cdk -c alias=a1 deploy
will create a stack: my-stack-a1 with my-bucket-a1.
To create more stacks: my-stack-a2 / my-bucket-a2, my-stack-a3 / my-bucket-a3:
cdk -c alias=a2 deploy
cdk -c alias=a3 deploy
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
Close
Hashes for cdk-stack-resource-rename-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dc1c7ddcdba325b721a786352e4a33e66605e22e373f7b6e928f5425455d63e |
|
MD5 | a64898b6a2c23b0bff02a3d799435950 |
|
BLAKE2b-256 | afd383a4cb968a25555b1dd3a44009982920d7e56ed87300e3f17fde7780ade8 |
Close
Hashes for cdk_stack_resource_rename-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64772a40de92475ea3a7f412f6e429df697a9819a87052fa7efde89b01511122 |
|
MD5 | 24f49c277529a7074b693d8f1f781370 |
|
BLAKE2b-256 | 1685d943ab6a660b03dcc26d7148b6ffebfff3aaffd631d8b84de4eb5dfd0d82 |