This message was deleted.
# golang
s
This message was deleted.
b
you can’t convert a
StringOutput
to a string
j
ohh ok, so looks like I’m trying to do something wrong…
thanks!
b
you can only resolve it and then do something with it inside an Apply
what are you trying to do?
j
I’m getting
roleArn
from user and it’s a string. So I’m doing something like:
Copy code
if role.RoleArn == "" { }
to check if there is a RoleArn. If not I’m creating it and adding to one of the policy:
Copy code
data := tmpArn{
		Version: "2012-10-17",
		Statement: []Statement{
			{
				Effect: "Allow",
				Principal: Principal{
					Aws: RoleArn,
				},
				Action: "sts:AssumeRole",
			},
		},
	}
b
although this:
Copy code
if role.RoleArn == "" { }
is wrong, generally
you shouldn’t need to check if something exists with Pulumi
j
why?
btw - thanks for pointing me to those examples, I will need to refactor my code a bit to make it work
b
because Pulumi is declarative, if it doesn’t exist you should create it. if it does exist you should import it