https://pulumi.com logo
#aws
Title
# aws
c

cuddly-smartphone-15267

12/06/2020, 12:13 PM
i'm trying to set up an ECS cluster and getting an error:
error creating capacity provider: ClientException: ECS Service Linked Role does not exist. Please create a Service linked role for ECS and try again.
My code is pretty much based on this example: https://github.com/pulumi/examples/blob/aws-ecs-conatiner-instances-automation/aws-py-ecs-instances-autoapi/py-ecs-instance/__main__.py i don't see where I would be setting up a service linked role in this code workflow. would it be something similar to lines 36-57 above?
b

billowy-army-68599

12/07/2020, 2:09 AM
hey, sorry for the delay. in a lot of examples we don't add the service linked roles because they usually exist in the account. If you're using a brand new account, they may not exist
A good practice is to have a separate, distinct project that manages service linked roles
c

cuddly-smartphone-15267

12/07/2020, 3:00 AM
hey Jaxx, thanks for getting back to me.. ok thank you for that info - i was just about to come back and update this thread. I 'solved' it by creating it in my stack:
Copy code
var ecsServiceLinkedRole = new ServiceLinkedRole("ecsServiceLinkedRole", new ServiceLinkedRoleArgs
        {
            AwsServiceName = "<http://ecs.amazonaws.com|ecs.amazonaws.com>",
        });
but i'll take your advice on board and look to set up a separate project.. i'm thinking that for things like the VPC and subnet, they should prob be in a separate project too
b

billowy-army-68599

12/07/2020, 3:23 AM
that's good practice, and one I follow myself
👍 1