-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from pulumi/lukehoban/stackprops
Support specifying stack properties
- Loading branch information
Showing
6 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: pulumi-cdk-ecscluster | ||
runtime: nodejs | ||
description: ECS Cluster |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as ecs from 'aws-cdk-lib/aws-ecs'; | ||
import * as pulumi from '@pulumi/pulumi'; | ||
import * as pulumicdk from '@pulumi/cdk'; | ||
import * as ec2 from 'aws-cdk-lib/aws-ec2'; | ||
import * as pulumiaws from "@pulumi/aws-native"; | ||
|
||
class ECSClusterStack extends pulumicdk.Stack { | ||
clusterArn: pulumi.Output<string>; | ||
|
||
constructor(id: string, options?: pulumicdk.StackOptions) { | ||
super(id, options); | ||
|
||
const vpc = ec2.Vpc.fromLookup(this, 'MyVpc', { | ||
isDefault: true, | ||
}) | ||
const cluster = new ecs.Cluster(this, 'fargate-service-autoscaling', { vpc }); | ||
|
||
this.clusterArn = this.asOutput(cluster.clusterArn); | ||
|
||
this.synth(); | ||
} | ||
} | ||
|
||
export const clusterArn = pulumiaws.getAccountId().then(account => { | ||
const stack = new ECSClusterStack('teststack', { | ||
props: { | ||
env: { | ||
region: pulumiaws.config.region, | ||
account: account.accountId, | ||
} | ||
} | ||
}); | ||
return stack.clusterArn; | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "pulumi-aws-cdk", | ||
"devDependencies": { | ||
"@types/node": "^10.0.0" | ||
}, | ||
"dependencies": { | ||
"@pulumi/aws": "^4.6.0", | ||
"@pulumi/aws-native": "^0.16.1", | ||
"@pulumi/pulumi": "^3.0.0", | ||
"aws-cdk-lib": "^2.20.0", | ||
"constructs": "^10.0.111" | ||
}, | ||
"peerDependencies": { | ||
"@pulumi/cdk": "^0.0.1" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"outDir": "bin", | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.ts" | ||
] | ||
} |
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
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