Skip to content

Instantly share code, notes, and snippets.

@axelhodler
Created February 23, 2021 16:22
Show Gist options
  • Save axelhodler/4948573416264ee1919988712dadf382 to your computer and use it in GitHub Desktop.
Save axelhodler/4948573416264ee1919988712dadf382 to your computer and use it in GitHub Desktop.
Adding ApplicationLoadBalancedFargateService
import * as cdk from '@aws-cdk/core';
import * as ecr from '@aws-cdk/aws-ecr';
import * as ecs from '@aws-cdk/aws-ecs';
import {ApplicationLoadBalancedFargateService} from "@aws-cdk/aws-ecs-patterns";
export class CdktestsStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const repository = new ecr.Repository(this, 'test-repository', {
repositoryName: `test`
});
new ApplicationLoadBalancedFargateService(this, 'test-fargate', {
taskImageOptions: {
image: ecs.ContainerImage.fromEcrRepository(repository, 'latest')
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment