I have a follow up for the above question. I am ab...
# python
a
I have a follow up for the above question. I am able to save a secret on AWS , I am trying to retrieve the newly saved secret using pulumi's get_secret() function. Now the function expects either arn or name in string and I am not able to convert to the arn to string , here is my code
pwd = aws.secretsmanager.get_secret(arn=secret_obj.arn.apply(lambda arn: arn))
saw online that Output<T> would need to be converted using .apply() which is what I am trying to do with a lambda that returns the arn but that doesnt seem to be doing it
b
you can’t convert an
Output<T>
to a string. So
pwd
will always be an
Output<T>
You need to use the string inside the apply
Copy code
aws.secretsmanager.get_secret(arn=secret_obj.arn.apply(
  lambda arn: // you can use arn as a string inside here, but you can't convert it to a variable outside the function
))
a
Thank you