Allows you to share values between stack across regions and accounts.
Project description
@reapit-cdk/cross-region-stack-export
Allows you to share values between stack across regions and accounts.
Package Installation:
yarn add --dev @reapit-cdk/cross-region-stack-export
# or
npm install @reapit-cdk/cross-region-stack-export --save-dev
Usage
import { CfnOutput, Stack, App } from 'aws-cdk-lib'
import { CrossRegionStackExport } from '@reapit-cdk/cross-region-stack-export'
import { Bucket } from 'aws-cdk-lib/aws-s3'
const app = new App()
const euStack = new Stack(app, 'stack-eu', {
env: {
account: '11111111',
region: 'eu-west-1',
},
})
const exporter = new CrossRegionStackExport(euStack, 'exporter')
exporter.setValue('thing', 'avalue')
const bucket = new Bucket(euStack, 'bucket')
exporter.setValue('bucketArn', bucket.bucketArn)
const usStack = new Stack(app, 'stack-us', {
env: {
account: '2222222222',
region: 'us-east-1',
},
})
const importer = exporter.getImporter(usStack, 'eu-importer')
const euThing = importer.getValue('thing')
const euBucket = Bucket.fromBucketArn(usStack, 'eu-bucket', importer.getValue('bucketArn'))
new CfnOutput(usStack, 'euThing', {
value: euThing,
})
new CfnOutput(usStack, 'euBucketName', {
value: euBucket.bucketName,
})
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.cross-region-stack-export-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b690d44bc330ed0139094eed692e5b2c9511c8a38195a369fe2a5d282232cbd |
|
MD5 | 5cab5caf6c77ef9747410f766e8e5ba3 |
|
BLAKE2b-256 | 81686782530f634da04f3720ec9c9f27617c71b0ad6625e123c5cc7a0d6229a7 |
Close
Hashes for reapit_cdk.cross_region_stack_export-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7976f8fc410653a0d5aae78afb5356d80e2e396f216331fdcab12953ebe5a8e0 |
|
MD5 | 88743b7650638eb03000f8eede5e8d05 |
|
BLAKE2b-256 | 4e4949684a696caa98a18c48ac3f81c0aa07e18a83d7787a1011d3a01c89786b |