Skip to content

Instantly share code, notes, and snippets.

@petrabarus
Created December 22, 2019 15:02
Show Gist options
  • Save petrabarus/75583ff965f94fb0a141cdcd2876e671 to your computer and use it in GitHub Desktop.
Save petrabarus/75583ff965f94fb0a141cdcd2876e671 to your computer and use it in GitHub Desktop.
#!/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