cdk-stack-resource-rename
Project description
StackResourceRenamer
A CDK aspect, 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:
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 with my-bucket-a2, my-stack-a3 with 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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ee1e009e0fb18fa109afcd9719bd0bc482686c2f956afa9dd03d831f41146b5 |
|
MD5 | be69104d14290a8f2810e832fb9a1d6a |
|
BLAKE2b-256 | 0857656c22984a86b0fca1414706176f16494e7d32ef6708b4bf917380d63df7 |
Close
Hashes for cdk_stack_resource_rename-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0d2e0e6942156bc880c90e2dc262bb58264a35d0fdf5e5b6054742dd593a02b |
|
MD5 | 5885697c99b59fb726b4766ecef25906 |
|
BLAKE2b-256 | 25f64962c7569d5c5f88ee5b108b95705ac420bcb263ba35f0f4f9c5092c5e63 |