Skip to content

Instantly share code, notes, and snippets.

@cnunciato
Created May 19, 2022 19:15
Show Gist options
  • Select an option

  • Save cnunciato/05a143fac501f12816c12a79ae312ec0 to your computer and use it in GitHub Desktop.

Select an option

Save cnunciato/05a143fac501f12816c12a79ae312ec0 to your computer and use it in GitHub Desktop.
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
const cluster = new aws.ecs.Cluster("default-cluster");
const lb = new awsx.lb.ApplicationLoadBalancer("nginx-lb", {});
const service = new awsx.ecs.FargateService("my-service", {
cluster: cluster.arn,
desiredCount: 2,
taskDefinitionArgs: {
container: {
image: "nginx:latest",
cpu: 512,
memory: 128,
essential: true,
portMappings: [
{
containerPort: 80,
targetGroup: lb.defaultTargetGroup,
},
],
},
},
});
export const url = lb.loadBalancer.dnsName;
{
"name": "ecs-ts",
"devDependencies": {
"@types/node": "^14"
},
"dependencies": {
"@pulumi/aws": "^5.0.0",
"@pulumi/awsx": "^1.0.0-beta.5",
"@pulumi/pulumi": "^3.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment