Created
December 22, 2019 15:02
-
-
Save petrabarus/75583ff965f94fb0a141cdcd2876e671 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
#!/usr/bin/env node | |
import 'source-map-support/register'; | |
import cdk = require('@aws-cdk/core'); | |
import ecs = require("@aws-cdk/aws-ecs"); | |
import ecsPatterns = require("@aws-cdk/aws-ecs-patterns"); | |
export class WebStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
this.createECSCluster(); | |
} | |
createECSCluster() { | |
const ecsCluster = new ecs.Cluster(this, 'ecsCluster'); | |
new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Service', { | |
cluster: ecsCluster, | |
taskImageOptions: { | |
image: ecs.ContainerImage.fromAsset('.') | |
}, | |
}); | |
} | |
} | |
const app = new cdk.App(); | |
new WebStack(app, 'WebStack'); | |
app.synth(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment