https://pulumi.com logo
s

steep-toddler-98503

06/06/2019, 11:37 PM
Calling [toJSON] on an [Output<T>] is not supported. To get the value of an Output as a JSON value or JSON string consider either: 1: o.apply(v => v.toJSON()) 2: o.apply(v => JSON.stringify(v)) See https://pulumi.io/help/outputs for more details. This function may throw in a future version of @pulumi/pulumi.
f

full-dress-10026

06/06/2019, 11:41 PM
You need to call
JSON.stringify
within the
apply
function.
Copy code
anOutput.apply(unwrappedOutput => {
    JSON.stringify({
        a: unwrappedOutput
    })
});
s

steep-toddler-98503

06/07/2019, 3:27 PM
i tried your suggest but i got the same error, i have the following code:
i tried your suggest but i got the same error, i have the following code: ASG_Creation = new aws.autoscaling.Group(parameters.ASG_Name, { name: parameters.ASG_Name, vpcZoneIdentifiers: parameters.Subnets_ids, maxSize: parameters.max_instances, desiredCapacity: parameters.min_instances, . . . } This method return some arguments like name and arn. I used your suggest with the following code: const ASG_Name= ` name ASG ${ASG_Creation.name.apply(name => { JSON.stringify({ a: name }) })}
f

full-dress-10026

06/07/2019, 3:55 PM
Are you trying to use that in string interpolation ?
s

steep-toddler-98503

06/07/2019, 4:08 PM
yes
i tried with pulumi interpolation but i got the same error
f

full-dress-10026

06/07/2019, 4:09 PM
Right -- you'll need to use
Copy code
pulumi.interpolate``
s

steep-toddler-98503

06/07/2019, 4:10 PM
i will try
no, i am get the same error,
i don't know what happens
i used concat and interpolate but i have the same output