Skip to content

nickwillan/cdk-global-parameter

Repository files navigation

CDK Global Parameter

State: GA Maintainer: Nick Willan AWS: CDK Construct Test Coverage

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.

Table of Contents

Installation

npm i cdk-global-parameter --save-dev

Usage

In 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.

Configuration Options

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.

FAQs

  1. Can I update the parameter value after creation?

    Yes, you can update the parameter value by modifying the stringValue property in parameterProps and redeploying your stack.

  2. 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.

  3. 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.

Contributing

I ❤️ contributions!

Please refer to the Contributing Guide

About

A CDK Construct that replicates Parameters to multiple regions

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •