Skip to content

IAM error when deploying LoadBalancedFargateService #1279

@PaulMaddox

Description

@PaulMaddox

Given the following:

// Create a default VPC (with public/private subnets and 10.0.0.0/16 CIDR range)
const vpc = new ec2.VpcNetwork(this, 'VPC');

// Create an ECS cluster
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });

// Add EC2 instances to the cluster (inc. auto-scaling and container draining)
const asg = cluster.addDefaultAutoScalingGroupCapacity({
    instanceCount: 2,
    maxCapacity: 10,
    instanceType: new ec2.InstanceType('m4.large'),
})

// Create an example nginx service
const nginx = new ecs.LoadBalancedFargateService(this, 'Nginx', {
    cluster,
    image: ecs.ContainerImage.fromDockerHub('nginx:latest'),
})

I get the following error on cdk deploy:

Fargate requires task definition to have execution role ARN to support log driver awslogs. (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID: 86141580-f78e-11e8-88ae-198b4970816c)

This feels like something that should be setup as part of the default experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecsRelated to Amazon Elastic ContainerbugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions