I'm trying to create a CFN to start up a ECS connected to a ECR an a load balancer on top. But now I get this error:
Resource handler returned message: "Invalid request provided: CreateService error: You cannot specify an IAM role for services that require a service linked role. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: b8a77e87-5715-4d43-b58f-a0843dbee15e; Proxy: null)" (RequestToken: c19a676b-893b-8369-a9b5-75c792c18bd0, HandlerErrorCode: InvalidRequest)
My service block that fails in the events is this.
service:
Type: AWS::ECS::Service
DependsOn: ALBListenerHttps
Properties:
Cluster: !Ref 'ECSCluster'
DesiredCount: '1'
LaunchType: FARGATE
LoadBalancers:
- ContainerName: !Sub ${Environment}-${Name}
ContainerPort: '3000'
TargetGroupArn: !Ref 'ECSTG'
Role: 'arn:aws:iam::{My was id}:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS'
TaskDefinition: !Ref 'taskdefinition'
NetworkConfiguration:
AwsvpcConfiguration:
AssignPublicIp: 'ENABLED'
Subnets: !Ref 'SubnetId'