https://pulumi.com logo
Title
c

creamy-window-21036

10/04/2022, 4:50 PM
Hi everyone, I need help to understand to use resource which is like already present in aws.
import pulumi
import pulumi_aws as aws
import pulumi_eks as eks

role1 = aws.iam.Role("ways to retrieve it if it is already present in aws")
role2 = aws.iam.Role("ways to retrieve it if it is already present in aws")

cluster = eks.Cluster(...,instance_roles=[role1, role2],...)
I tried to 1. aws.iam.Role.get() 2. aws.iam.getRole() 3. aws.iam.Role("some_role", opt=pulumi.ResourceOption(import_="some_role")) But nothing worked for me Thanks in advance 🙂
b

billowy-army-68599

10/04/2022, 4:58 PM
aws.iam.GetRole
should work, what didn’t work?
c

creamy-window-21036

10/04/2022, 5:05 PM
it returns GetRoleResult type of object which I am unable to use it in eks.Cluster
b

billowy-army-68599

10/04/2022, 5:09 PM
aws.iam.GetRoleOutput
aws.iam.get_role_output I think in python
c

creamy-window-21036

10/04/2022, 5:22 PM
any sort of example you can give