Created
October 21, 2021 06:45
-
-
Save mgjam/2bf6a55475b633246f109b7b731dbc58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ExportingStack extends Stack { | |
public readonly bucket: Bucket; | |
constructor(scope: Construct, id: string, props: StackProps) { | |
super(scope, id, props); | |
this.bucket = new Bucket(this, 'ExportedBucket'); | |
} | |
} | |
export interface ImportingStackProps extends StackProps { bucket: Bucket } | |
export class ImportingStack extends Stack { | |
public readonly output: CfnOutput; | |
constructor(scope: Construct, id: string, props: ImportingStackProps) { | |
super(scope, id, props); | |
this.output = new CfnOutput(this, 'bucketDomainName', { | |
value: props.bucket.bucketDomainName | |
}); | |
} | |
} | |
const exportingStack = new ExportingStack(app, 'exp', {}); | |
const importingStack = new ImportingStack(app, 'imp', { | |
bucket: exportingStack.bucket | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment