Created
May 7, 2020 10:08
-
-
Save patrobinson/312b3fb955758cd19528b89b4b757605 to your computer and use it in GitHub Desktop.
Replicate unable to lookup VPC in CDK
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
import * as core from "@aws-cdk/core"; | |
import * as ec2 from "@aws-cdk/aws-ec2"; | |
export class MyStack extends core.Stack { | |
constructor(scope: core.Construct, id: string, props: core.StackProps) { | |
super(scope, id, props); | |
console.log(ec2.Vpc.fromLookup(this, "Vpc1", { isDefault: true }).vpcId); | |
} | |
} | |
const app = new core.App(); | |
const stack = new MyStack(app, "App", {env: {region: "us-east-1", account: "012345678910"}}); |
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
{ | |
"name": "foo", | |
"version": "0.0.0", | |
"author": "Patrick Robinson @patrobinson", | |
"dependencies": { | |
"@aws-cdk/aws-ec2": "^1.37.0", | |
"@aws-cdk/core": "^1.37.0", | |
"aws-cdk": "^1.37.0", | |
"tslib": "^1.11.2", | |
"typescript": "^3.8.3" | |
} | |
} |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"declaration": true, | |
"esModuleInterop": true, | |
"importHelpers": true, | |
"module": "commonjs", | |
"outDir": "lib", | |
"resolveJsonModule": true, | |
"rootDir": "src", | |
"strict": true, | |
"target": "es2018" | |
}, | |
"include": [ | |
"src/**/*" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment