chilly-photographer-60932
02/21/2019, 5:05 PMexports
from pulumi
object especially string and write it to a bucket for other API’s to consume.
{ IstioIngressIPAddress:
Output {
__pulumiOutput: true,
isKnown: Promise { <pending> },
resources: [Function],
promise: [Function],
apply: [Function],
get: [Function] },
IdentityIngressIPAddress:
Output {
__pulumiOutput: true,
isKnown: Promise { <pending> },
resources: [Function],
promise: [Function],
apply: [Function],
get: [Function] },
ExternalNATIPAddress: '[object Object]' }
I am trying to serialize using JSON.stringify
. How do I get a proper serialized json object?brainy-magician-83981
02/21/2019, 5:49 PMchilly-photographer-60932
02/21/2019, 6:31 PMbrainy-magician-83981
02/21/2019, 6:53 PMpulumi stack output --json > output.json
https://pulumi.io/reference/programming-model.html#stack-outputschilly-photographer-60932
02/21/2019, 6:58 PMcreamy-potato-29402
02/21/2019, 7:38 PMchilly-photographer-60932
02/21/2019, 7:39 PMcreamy-potato-29402
02/21/2019, 7:39 PMchilly-photographer-60932
02/21/2019, 7:41 PMimport * as pulumi from '@pulumi/pulumi';
import * as gcp from '@pulumi/gcp';
// Create a GCP resource (Storage Bucket)
const bucket = new gcp.storage.Bucket('my-bucket');
// Export the DNS name of the bucket
export const bucketName = bucket.url;
console.log(pulumi.output(bucket).apply(s => s));
bucket
pulumi:pulumi:Stack (testingpulumioutput-dev):
Output {
__pulumiOutput: true,
isKnown: Promise { <pending> },
resources: [Function],
promise: [Function],
apply: [Function],
get: [Function] }
creamy-potato-29402
02/21/2019, 8:41 PMchilly-photographer-60932
02/21/2019, 8:45 PMcreamy-potato-29402
02/22/2019, 3:38 AM.url
?
export const bucketName = bucket.url;
console.log(pulumi.output(bucket).apply(s => s));
pulumi.output
returns an Output<Bucket>
, which is what is getting printed above. That is not what you want, right?s
is of type Bucket
, right?apply(s => s)
Bucket
type, where should you put the console.log