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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fd8d16fa3ff5bb4f8a8eff7f93211b6b863d4072ba012e012596df5eec8da6a |
|
MD5 | 87346f86000e780f5745aa78bb4f0bd9 |
|
BLAKE2b-256 | 0e948a738debc264868d5145648a628ba9271bee22199246169dae7bdb627dba |
Close
Hashes for reapit_cdk.cross_region_stack_export-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2d29fb09a4f2b43a31826192e1056d6c7b55d12c1ea07deb8238ed4152ae103 |
|
MD5 | 26d37d44dfaa39b2de6e707df86f9635 |
|
BLAKE2b-256 | 1d63ed044082e03a3fc7984f34e911fe7512dcf70fc986b0983ab566d74b97db |