sparse-intern-71089
09/28/2018, 10:17 PMmicroscopic-florist-22719
Promise<T> is directly assignable to an Input<T>.microscopic-florist-22719
Input<T>, as Input<T> is defined as the union of T | Input<T> | Output<T>glamorous-printer-66548
09/28/2018, 10:23 PMglamorous-printer-66548
09/28/2018, 10:23 PMconst clusterResult = gcp.container.getCluster({name: 'my-custer'})
new my.Resource('foo', {
clusterEndPoint: clusterResult.endpoint
})glamorous-printer-66548
09/28/2018, 10:24 PMclusterResult would be a regular pulumi resource i could tap into the subproperties without unwrapping.glamorous-printer-66548
09/28/2018, 10:25 PMPromise I first would have to unwrap it via .then in order to get a subproperty.incalculable-sundown-82514
09/28/2018, 10:33 PM.get over data sources - .get does give you a regular pulumi resourceglamorous-printer-66548
09/28/2018, 10:39 PMglamorous-printer-66548
09/28/2018, 10:39 PMglamorous-printer-66548
09/28/2018, 10:39 PMglamorous-printer-66548
09/28/2018, 10:39 PMgsutil mb <gs://pulumi-experiment-bucket>glamorous-printer-66548
09/28/2018, 10:40 PMimport * as gcp from '@pulumi/gcp';
const myBucket = gcp.storage.Bucket.get('my-bucket', 'pulumi-experiment-bucket');glamorous-printer-66548
09/28/2018, 10:40 PMPreviewing changes:
Type Name Plan Info
+ pulumi:pulumi:Stack pulumi-query-experiments-christian-experiments create
>- └─ gcp:storage:Bucket my-bucket read 1 error
Diagnostics:
gcp:storage:Bucket: my-bucket
error: Preview failed: refreshing urn:pulumi:christian-experiments::pulumi-query-experiments::gcp:storage/bucket:Bucket::my-bucket: Error reading Storage Bucket "": googleapi: Error 400: Required parameter: project, required
error: an error occurred while advancing the previewglamorous-printer-66548
09/28/2018, 10:40 PMpulumi config set gcp:project my-projectglamorous-printer-66548
09/28/2018, 10:42 PMimport * as gcp from '@pulumi/gcp';
const myBucket = gcp.storage.Bucket.get(
'my-bucket',
'pulumi-experiment-bucket',
{ project: 'my-project', name: 'pulumi-experiment-bucket' }
);incalculable-sundown-82514
09/28/2018, 10:42 PMglamorous-printer-66548
09/28/2018, 10:42 PMincalculable-sundown-82514
09/28/2018, 10:44 PMincalculable-sundown-82514
09/28/2018, 10:44 PMglamorous-printer-66548
09/28/2018, 10:48 PMimport * as gcp from '@pulumi/gcp';
const myBucket = gcp.storage.Bucket.get(
'my-bucket',
'pulumi-experiment-bucket'
);
but THIS works:
import * as gcp from '@pulumi/gcp';
const myBucket = gcp.storage.Bucket.get(
'my-bucket',
'pulumi-experiment-bucket',
{ name: 'pulumi-experiment-bucket' }
);glamorous-printer-66548
09/28/2018, 10:49 PMname to the third param)?incalculable-sundown-82514
09/28/2018, 10:49 PM.get is actually an ID, which uniquely identifies the bucket - it may not be the same as the name of the bucket itself.glamorous-printer-66548
09/28/2018, 10:50 PMglamorous-printer-66548
09/28/2018, 10:51 PMglamorous-printer-66548
09/28/2018, 10:51 PMglamorous-printer-66548
09/28/2018, 10:55 PMname and now pulumi fails with:
Previewing changes:
Type Name Plan Info
+ pulumi:pulumi:Stack pulumi-query-experiments-christian-experiments create
>- └─ gcp:storage:Bucket my-bucket read 1 error
Diagnostics:
gcp:storage:Bucket: my-bucket
error: Preview failed: reading resource urn:pulumi:christian-experiments::pulumi-query-experiments::gcp:storage/bucket:Bucket::my-bucket yielded an unexpected ID;expected pulumi-experiment-bucket-foo, got pulumi-experiment-bucket
error: an error occurred while advancing the previewglamorous-printer-66548
09/28/2018, 10:55 PMname property for the lookup but then tries to match that name with the manually provided id and complains if they don’t match.incalculable-sundown-82514
09/28/2018, 10:57 PMincalculable-sundown-82514
09/28/2018, 10:57 PMglamorous-printer-66548
09/28/2018, 10:58 PMname property at all, because the id is assumed to be name anyways.glamorous-printer-66548
09/28/2018, 11:00 PMmicroscopic-florist-22719
microscopic-florist-22719
microscopic-florist-22719
glamorous-printer-66548
09/28/2018, 11:03 PMmicroscopic-florist-22719
glamorous-printer-66548
09/28/2018, 11:36 PMmicroscopic-florist-22719