Skip to content

Commit

Permalink
Add required properties to container-aws-* templates
Browse files Browse the repository at this point in the history
  • Loading branch information
cnunciato committed Nov 27, 2023
1 parent b1d907e commit c83f001
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions container-aws-csharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
{
Container = new Awsx.Ecs.Inputs.TaskDefinitionContainerDefinitionArgs
{
Name = "app",
Image = image.ImageUri,
Cpu = cpu,
Memory = memory,
Expand Down
1 change: 1 addition & 0 deletions container-aws-go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func main() {
AssignPublicIp: pulumi.Bool(true),
TaskDefinitionArgs: &ecsx.FargateServiceTaskDefinitionArgs{
Container: &ecsx.TaskDefinitionContainerDefinitionArgs{
Name: pulumi.String("app"),
Image: image.ImageUri,
Cpu: pulumi.Int(cpu),
Memory: pulumi.Int(memory),
Expand Down
3 changes: 2 additions & 1 deletion container-aws-python/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
image = awsx.ecr.Image(
"image",
repository_url=repo.url,
path="./app")
context="./app")

# Deploy an ECS Service on Fargate to host the application container
service = awsx.ecs.FargateService(
Expand All @@ -31,6 +31,7 @@
assign_public_ip=True,
task_definition_args=awsx.ecs.FargateServiceTaskDefinitionArgs(
container=awsx.ecs.TaskDefinitionContainerDefinitionArgs(
name="app",
image=image.image_uri,
cpu=cpu,
memory=memory,
Expand Down
9 changes: 8 additions & 1 deletion container-aws-yaml/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,28 @@ config:
default: 128

resources:

# An ECS cluster to deploy into
cluster:
type: aws:ecs:Cluster

# An ALB to serve the container endpoint to the internet
loadbalancer:
type: awsx:lb:ApplicationLoadBalancer

# An ECR repository to store our application's container image
repo:
type: awsx:ecr:Repository
properties:
forceDelete: true

# Build and publish our application's container image from ./app to the ECR repository
image:
type: awsx:ecr:Image
properties:
repositoryUrl: ${repo.url}
path: ./app
context: ./app

# Deploy an ECS Service on Fargate to host the application container
service:
type: awsx:ecs:FargateService
Expand All @@ -51,6 +56,7 @@ resources:
assignPublicIp: true
taskDefinitionArgs:
container:
name: app
image: ${image.imageUri}
cpu: ${cpu}
memory: ${memory}
Expand All @@ -60,5 +66,6 @@ resources:
targetGroup: ${loadbalancer.defaultTargetGroup}

outputs:

# The URL at which the container's HTTP endpoint will be available
url: http://${loadbalancer.loadBalancer.dnsName}

0 comments on commit c83f001

Please sign in to comment.