I still can't work out how to import an ECS servic...
# aws
p
I still can't work out how to import an ECS service into the aws-native provider, see https://pulumi-community.slack.com/archives/CRH5ENVDX/p1689701859092919 So I guess I shall switch to the aws-classic provider. It's not helping my case that we shouldn't use Terraform or Cloudformation to constantly have to explain that not only is there an apparent bug with a pulumi provider but that I can't find any help to resolve the issue.
s
Hey Michael, sorry you’re running into an issue. I’ve contacted our AWS Native provider team internally to see if I can get some additional information for you. You’re probably already aware, but the AWS Native provider doesn’t (currently) have the same breadth of coverage as the AWS Classic provider, and so it’s possible you may need to use a combination of AWS Native and AWS Classic in your Pulumi programs (this is not uncommon and is fully supported).
p
Thanks Scott, much appreciated I am, indeed, doing that, but the aws-native one seemed to work fine for ECS services. it's just this import that's stumping me.
s
Gotcha. As soon as I get some more information from the AWS Native provider team, I’ll update you here.
p
any news on this, I ran into it again today
I found a confusing but potentially helpful part of the help text on the
pulumi import
cli.
Copy code
--properties strings                    The property names to use for the import in the format name1,name2
I say potentially helpful as the error above also talk about properties, but I've no idea how to use it as there are no examples in any of the docs I can find. Does anyone know what this flag is for and what strings I'm meant to pass it? I tried:
pulumi import --provider urn:pulumi:test-ecs-recorder::infra-ecs-recorder::pulumi:providers:aws-native::test-ecs-recorder-nativeProvider -s test-ecs-recorder --properties ServiceArn,Cluster aws-native:ecs:Service recorder arn:aws:ecs:us-east-1:#####:service/Test/recorder,Test
but that gives the same error as above. Are there good docs for the CLI somewhere I'm missing?
I never received a reply to this and am running into it again today. Can anyone help?
g
I'd suggest trying the imports with aws classic. Although deploying things with native worked, imports can be slightly different in my experience
p
So import it with classic and then switch them from one provider to another?
s
I don’t think that will work (the provider is in the URN for the resource).
p
I'm wondering if there's been any update from the aws-native team on this issue? I'm trying to import another ECS service and running in to the
api error ValidationException: Identifier ... is not valid for identifier [/properties/ServiceArn, /properties/Cluster]
I've been asking the Pulumi AI but all its suggestions e.g. `
Copy code
pulumi import aws-native:ecs:Service ld-relay "Production:ld-relay"
Copy code
pulumi import aws-native:ecs:Service ld-relay arn:aws:ecs:<region>:<account-id>:cluster/<cluster-name>/<service-name>
and a number of variations thereon give the above error. I'd really like imports to work in aws-native
e
Hi Michael, do you have it tracked in https://github.com/pulumi/pulumi-aws-native I can bump it so we take another look? Thanks
p
I haven't added it there, yet, I wasn't sure if it was a bug or just a lack of documentation, but I guess in either case I can add it there. I'll do so later today.
e
Thank you! That helps a lot
c
I figured this out after having a similar problem, according to https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html you need to specify multiple identifiers using the pipe delimiter, so your example would be
pulumi import aws-native:ecs:Service ld-relay "<service-arn>|<cluster>"
g
fyi @polite-napkin-90098 @salmon-account-74572