Marcus Lagerstedt
Marcus Lagerstedt

Reputation: 438

Cloudformation Parameter to connect fargate

I'm setting up a CloudFormation for a load balancing ECS that will be connected to a Fargate container. How do I make a Parameter in Fargate to be able to choose from my existing Fargate Images.

Using this template. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ecs.html Currently, it uses Ec2 but I want to use Fargate.

  containerDefinitions:
      - name: '${Environment}-{Name}'
        logConfiguration:
          logDriver: awslogs
          options:
            awslogs-group: "$/ecs/{Environment}-{Name}"
            awslogs-region: eu-west-1
            awslogs-stream-prefix: ecs
        portMappings:
        - hostPort: 3000
          protocol: tcp
          containerPort: 3000
        cpu: 256
        memory: 1024
        image: 

I need to assign image based on a parameter

Parameters:
  Name:
    Type: String
    Description: Name the application.
  Environment:
    Type: String
    Description: Environment of the application.
    AllowedValues:
        - prod
        - stage
        - dev

Here I need to add a dropdown menu to choose the Fargate I want, or maybe I'm not doing it correctly.

Upvotes: 1

Views: 104

Answers (1)

Marcin
Marcin

Reputation: 238051

But I would like it to find current repos that exist.

Sadly, that's not possible. CFN simply does not have such functionality. For some resources you can do that using AWS-specific parameter types, but ECR images are not one of those.

Upvotes: 1

Related Questions