Creates a Secret and replicates it across the given regions. Requires a [ReplicatedKey](../replicated-key/readme.md) be passed in.
Project description
@reapit-cdk/replicated-secret
Creates a Secret and replicates it across the given regions. Requires a ReplicatedKey be passed in.
Package Installation:
yarn add --dev @reapit-cdk/replicated-secret
# or
npm install @reapit-cdk/replicated-secret --save-dev
Usage
import { Stack, App } from 'aws-cdk-lib'
import { Function, Runtime, Code } from 'aws-cdk-lib/aws-lambda'
import { ReplicatedKey } from '@reapit-cdk/replicated-key'
import { ReplicatedSecret } from '@reapit-cdk/replicated-secret'
const app = new App()
const stack = new Stack(app, 'stack-name', {
env: {
region: 'us-east-1', // region must be specified
},
})
const replicatedKey = new ReplicatedKey(stack, 'key', {
replicaRegions: ['af-south-1', 'cn-north-1'],
})
const replicatedSecret = new ReplicatedSecret(stack, 'secret', {
replicaRegions: ['af-south-1', 'cn-north-1'],
replicatedKey,
})
const lambda = new Function(stack, 'lambda', {
runtime: Runtime.NODEJS_18_X,
handler: 'lambda.handler',
code: Code.fromInline('export const handler = () => {}'),
environment: {
usSecretArn: replicatedSecret.getRegionalSecret('us-east-1').secretArn,
afSecretArn: replicatedSecret.getRegionalSecret('af-south-1').secretArn,
cnSecretArn: replicatedSecret.getRegionalSecret('cn-north-1').secretArn,
},
})
replicatedSecret.grantWrite(lambda)
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 reapit-cdk.replicated-secret-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec26c47d3f82c2077ed055a9fe3c91154b4831820f4912e5ab6ffb487f53570d |
|
MD5 | c70d00f7fc2aa9f8085febc53d07d9de |
|
BLAKE2b-256 | d5749ea7fc5f1a1dd7047f4545685de9354dcc3745817ab9fb62da9ba279ffc1 |
Close
Hashes for reapit_cdk.replicated_secret-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4186e1237217fde13f1748ffb9ee193a2f82d792712d4b5576b9d06fcc7f2ad7 |
|
MD5 | 779288087f0c5df12dae06964c3a755f |
|
BLAKE2b-256 | 973c5ce7bceef6a264ba263eb4b72ce280596660ba58644016c0c38819499256 |