This message was deleted.
s
This message was deleted.
l
The ID needed for import is described at the bottom of each resource's doc page. For Role, it is the role's name. https://www.pulumi.com/docs/reference/pkg/aws/iam/role/#import
r
That was a little bit confusing too, I ended up trying to run the command
pulumi import aws:iam/role:Role <role name> <role name again>
. Then it worked. Thanks for the advice!!
👍 1
l
Just be aware that the provider "name" and the Pulumi "name" aren't the same.
Pulumi name is the first argument to the constructor, and it's not sent to the provider at all. It's essentially the address of the resource in the state.
The provider "name" is the parameter "name" in the args.
So you'd have something like this, in TypeScript:
Copy code
const myRole = new aws.iam.Role("rdsServiceRole", {
  name: "AWSServiceRoleForRDS",
  // ...
}, { import: "AWSServiceRoleForRDS" });
r
"provider name" -> that was the association I was misusing in my head, now everything's fitting. Thank you again!