diff --git a/container-aws-csharp/Program.cs b/container-aws-csharp/Program.cs index d687b454b..634bfc750 100644 --- a/container-aws-csharp/Program.cs +++ b/container-aws-csharp/Program.cs @@ -22,6 +22,7 @@ { RepositoryUrl = repo.Url, Context = "./app", + Playform = "linux/amd64", }); var service = new Awsx.Ecs.FargateService("service", new() @@ -32,6 +33,7 @@ { Container = new Awsx.Ecs.Inputs.TaskDefinitionContainerDefinitionArgs { + Name = "app", Image = image.ImageUri, Cpu = cpu, Memory = memory, diff --git a/container-aws-go/main.go b/container-aws-go/main.go index 6457e6626..d476847b7 100644 --- a/container-aws-go/main.go +++ b/container-aws-go/main.go @@ -50,6 +50,7 @@ func main() { image, err := ecrx.NewImage(ctx, "image", &ecr.ImageArgs{ RepositoryUrl: repo.Url, Context: pulumi.String("./app"), + Platform: pulumi.String("linux/amd64"), }) if err != nil { return err @@ -61,6 +62,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), diff --git a/container-aws-python/__main__.py b/container-aws-python/__main__.py index 7e4f4e45f..4532df3dc 100644 --- a/container-aws-python/__main__.py +++ b/container-aws-python/__main__.py @@ -22,7 +22,8 @@ image = awsx.ecr.Image( "image", repository_url=repo.url, - path="./app") + context="./app", + platform="linux/amd64") # Deploy an ECS Service on Fargate to host the application container service = awsx.ecs.FargateService( @@ -31,6 +32,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, diff --git a/container-aws-typescript/index.ts b/container-aws-typescript/index.ts index ceeee3b2a..d4715cf14 100644 --- a/container-aws-typescript/index.ts +++ b/container-aws-typescript/index.ts @@ -22,6 +22,7 @@ const repo = new awsx.ecr.Repository("repo", { const image = new awsx.ecr.Image("image", { repositoryUrl: repo.url, context: "./app", + platform: "linux/amd64", }); // Deploy an ECS Service on Fargate to host the application container diff --git a/container-aws-yaml/Pulumi.yaml b/container-aws-yaml/Pulumi.yaml index 48676f851..280fb5933 100644 --- a/container-aws-yaml/Pulumi.yaml +++ b/container-aws-yaml/Pulumi.yaml @@ -26,23 +26,29 @@ 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 + platform: linux/amd64 + # Deploy an ECS Service on Fargate to host the application container service: type: awsx:ecs:FargateService @@ -51,6 +57,7 @@ resources: assignPublicIp: true taskDefinitionArgs: container: + name: app image: ${image.imageUri} cpu: ${cpu} memory: ${memory} @@ -60,5 +67,6 @@ resources: targetGroup: ${loadbalancer.defaultTargetGroup} outputs: + # The URL at which the container's HTTP endpoint will be available url: http://${loadbalancer.loadBalancer.dnsName}