This message was deleted.
# aws
s
This message was deleted.
l
Not really an AWS question 🙂 Is the problem occurring when you use secret elsewhere? Or in this code, when you use stackReferenceToSecretName?
You've got a type error, and you need to access the value in an Output appropriately. Just need to figure out where.
m
It is in this code, the type error appears when assigning stackReferenceToSecretName to name.
l
Great. Can you add the code where you initialize the variable?
m
Copy code
const coreStackRef = new pulumi.StackReference(
  `name/project/${pulumi.getStack()}`
)

const hasuraCredentialsSecretName = coreStackRef.getOutput(
  "hasuraCredentialsSecretKeyName"
)

const hasuraCredentialsSecret = pulumi.output(
  aws.secretsmanager.getSecret(
    {
      name: hasuraCredentialsSecretName,
    },
    { async: true }
  )
)
l
It should be something like this:
const secretInfo: pulumi.Output<GetSecretResult> = stackReferenceToSecretName.apply((secretName) => aws.secretsmanager.getSecret({ name: secretName });
The apply() will automatically convert the returned Promise<GetSecretResult> into a pulumi.Output<GetSecretResult> for you.
If the secretValue was created in another stack and you want to use it in this stack, you might find that the aws.secretsmanager.SecretVersion.get() static method helps you avoid a little boilerplate code.
m
cool, thanks