ECS

Creating a task and associated service with minimal parameters

resources:
  - type: aws_ecs_task_definition
    name: my-task
    props:
      family: my-task-family
      cpu: "1024"
      memory: "2048"
      network_mode: awsvpc
      requires_compatibilities:
        - FARGATE
      container_definitions:
        - name: my-container
          image: nginx:latest
          port_mappings:
            - container_port: 80
              protocol: tcp
  - type: aws_ecs_service
    name: my-service
    props:
      cluster: my-existing-cluster
      task_definition: "ref:my-task"
      desired_count: 1
      launch_type: FARGATE
      network_configuration:
        awsvpc_configuration:
          subnets:
            - subnet-12345678
          security_groups:
            - sg-12345678
          assign_public_ip: ENABLED

Example price for above configuration

Last updated

Was this helpful?