https://pulumi.com logo
Title
p

plain-parrot-21984

03/24/2023, 12:21 PM
The following state machine definition fails with a schema validation error. The resource Arn provided is incorrect. I can see, that instead of the Arn, the resource element contains a memory address:
"Resource": "{0xc0001a6b60}"
. Looking at the example on https://www.pulumi.com/registry/packages/aws-native/api-docs/stepfunctions/statemachine/ the DefinitionString should be a string as the name implies. I chose to define the state in a separate variable first, because hard coding the Arn like in the example isn't really feasible. How can I supply the correct Arn to the definition instead of the memory address?
I might add, that when I
ctx.Export("pingFunctionArn", pingFunction.Arn)
I get the correct Arn of the pingFunction ...
Just figured it out (by trial & error 😅). By replacing
pingStateMachineDefinition := fmt.Sprintf
with
pingStateMachineDefinition := pulumi.Sprintf
it works :ham-dance:
s

salmon-gold-74709

03/27/2023, 11:22 AM
Read up on Pulumi Outputs, this is all about the output being effectively a promise (in JS terms)
p

plain-parrot-21984

03/27/2023, 11:29 AM
However, this was more about using the correct type. I added the bit with the export only to show that I can retrieve the correct value.