Skip to content

Instantly share code, notes, and snippets.

@petrabarus
Created Dec 22, 2019
Embed
What would you like to do?
#!/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