I'm trying to use <https://www.pulumi.com/docs/ref...
# aws
q
I'm trying to use https://www.pulumi.com/docs/reference/pkg/aws/iam/rolepolicyattachment/ and I only have a library the exports a role arn vs a role. Any ideas how I can do this or do I have to go back to the library provider and ask them to export the role?
l
The
role
parameter can take the role as a string. Guessing from the Terraform equivalent, that this is the name of the role. The name of the role can be parsed out of the ARN, it's everything from "role/" to the end...
q
Yeah, it seems pretty terrible that I would have to parse the name out of the arn.
Then maybe I use https://www.pulumi.com/docs/reference/pkg/aws/getarn/ and try to figure out what part I need...
👍 1
l
If it's easier than getting another party to update their code? You can't even use Role.get, since it needs an id and a name... 🙄
q
It's probably easier than asking them to change their code. I have to do it now.
l
It's the "resource" part of the arn. It will be "role/<rolename>".
q
Thanks @little-cartoon-10569!
👍 1
Looks like I still need to drop the pulumi -23498 off the end. Maybe I just had an instance vs a role.
It will be the argument to get them to change their code
Wasn't able to make any of it work so far...
the resource didn't work, the resource with -39845 removed didn't work. I was about to beat around the bush with trying to use Role.get() with the resource() but I think it's sort of evident it's likely not going to work
looks like my bad. You need to remove the role/ in front of the string. Removing the trailing instance will not work. Thanks again.
l
Yep, the "role/" isn't part of the name.