Created
May 19, 2022 19:15
-
-
Save cnunciato/05a143fac501f12816c12a79ae312ec0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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; |
This file contains hidden or 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
| { | |
| "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