The cdk-global-parameter is a CDK (AWS Cloud Development Kit) Construct that allows users to create a Systems Manager String Parameter and replicated to additional AWS regions.
npm i cdk-global-parameter --save-devIn your CDK application, you can create a GlobalStringParameter using the following example:
const globalParameter = new GlobalStringParameter(this, 'MyGlobalParameter', {
parameterProps: {
parameterName: '/my/global/parameter',
stringValue: 'my-value',
description: 'A global parameter example',
},
tags: [{ Key: 'key1', Value: 'value1' }],
replicaRegions: ['us-east-1', 'us-west-2', 'ca-central-1'],
});This will create a Systems Manager String Parameter with the specified name, value, and tags in the provided AWS regions.
The GlobalStringParameter construct supports the following configuration options:
parameterProps: StringParameterProps - The properties for the parameter to be created.tags: { [key: string]: string }[]; - Optional tags to be added to the regional replicated string parameter.replicaRegions:string[]- The list of AWS regions where the string parameter should be created.
-
Can I update the parameter value after creation?
Yes, you can update the parameter value by modifying the
stringValueproperty inparameterPropsand redeploying your stack. -
What happens if a parameter with the same name already exists in a region?
The construct will attempt to update the existing parameter with the new value.
-
Can I delete the parameter?
Yes, the construct includes a delete operation that removes the parameter from all specified regions when the stack is destroyed.
I ❤️ contributions!
Please refer to the Contributing Guide