https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
contribute
  • r

    rough-oil-1458

    09/02/2018, 4:04 PM
    Currently at work, we are using terraform
  • r

    rough-oil-1458

    09/02/2018, 4:04 PM
    and ... HCL != fun
  • r

    rough-oil-1458

    09/02/2018, 4:04 PM
    Drives me insane that I can't just.... have a normal conditional....
  • r

    rough-oil-1458

    09/02/2018, 4:05 PM
    if ( frustrated == true ) { usePulumiInstead } else { keepUsingTerraform }
  • r

    rough-oil-1458

    09/02/2018, 4:06 PM
    can't do that in TF hahahha
    💥 1
  • s

    stocky-spoon-28903

    09/02/2018, 5:31 PM
    At the expense of potentially reopening an old discussion (:p) is there a reason that all of the various repos are separate since they have fairly tight dependencies?
  • c

    creamy-potato-29402

    09/02/2018, 5:32 PM
    I think this is weird too lol
  • c

    creamy-potato-29402

    09/02/2018, 6:28 PM
    @rough-oil-1458 @big-piano-35669 done. https://github.com/pulumi/pulumi-terraform/pull/243
  • c

    creamy-potato-29402

    09/02/2018, 6:28 PM
    review and merge whenever.
  • r

    rough-oil-1458

    09/02/2018, 6:38 PM
    Ahhh n1 🙂
  • r

    rough-oil-1458

    09/02/2018, 6:51 PM
    ❤️ 1
    🚀 2
    👏 1
  • c

    creamy-potato-29402

    09/02/2018, 6:51 PM
    ooooo
  • c

    creamy-potato-29402

    09/02/2018, 6:51 PM
    merged btw
  • r

    rough-oil-1458

    09/02/2018, 6:52 PM
    Can you not console.log datasources?
  • c

    creamy-potato-29402

    09/02/2018, 6:53 PM
    I’m not sure what you mean?
  • r

    rough-oil-1458

    09/02/2018, 6:53 PM
    1 sec, im dumb.
  • r

    rough-oil-1458

    09/02/2018, 6:54 PM
    let datastore = vsphere.getDatastore({
      name: "bdf1000-01",
      datacenterId: "datacenter-21"
    });
    
    console.log(datastore.Id);
  • c

    creamy-potato-29402

    09/02/2018, 6:55 PM
    that’s an
    Output<string>
    , you’ll probably need to do something like
    datastore.Id.apply(console.log)
  • c

    creamy-potato-29402

    09/02/2018, 6:56 PM
    I think
  • r

    rough-oil-1458

    09/02/2018, 7:00 PM
    wasnt a function of datastore
  • r

    rough-oil-1458

    09/02/2018, 7:00 PM
    hmm, I'll read and figure something out
  • r

    rough-oil-1458

    09/02/2018, 7:02 PM
    https://github.com/Smithx10/pulumi-vsphere It's not done, but it's a start
  • r

    rough-oil-1458

    09/02/2018, 7:45 PM
    What is the best way to discover the return values ?
  • r

    rough-oil-1458

    09/02/2018, 7:45 PM
    export declare function getDatacenter(args?: GetDatacenterArgs, opts?: pulumi.InvokeOptions): Promise<GetDatacenterResult>;
    /**
     * A collection of arguments for invoking getDatacenter.
     */
    export interface GetDatacenterArgs {
        /**
         * The name of the datacenter. This can be a name or path.
         * Can be omitted if there is only one datacenter in your inventory.
         */
        readonly name?: string;
    }
    /**
     * A collection of values returned by getDatacenter.
     */
    export interface GetDatacenterResult {
        /**
         * id is the provider-assigned unique ID for this managed resource.
         */
        readonly id: string;
    }
  • r

    rough-oil-1458

    09/02/2018, 7:46 PM
    function getDatastore(args, opts) {
        return pulumi.runtime.invoke("vsphere:index/getDatastore:getDatastore", {
            "datacenterId": args.datacenterId,
            "name": args.name,
        }, opts);
    }
    exports.getDatastore = getDatastore;
  • b

    big-piano-35669

    09/02/2018, 7:46 PM
    Because this returns a promise -- meaning its value arrives asynchronously -- you'll need to
    await
    or
    then
    it.
  • r

    rough-oil-1458

    09/02/2018, 7:46 PM
    ahhhh ok
  • r

    rough-oil-1458

    09/02/2018, 7:46 PM
    That makes sense
  • r

    rough-oil-1458

    09/02/2018, 7:46 PM
    im dumb.
  • b

    big-piano-35669

    09/02/2018, 7:46 PM
    For example:
    let datastore = vsphere.getDatastore({
      name: "bdf1000-01",
      datacenterId: "datacenter-21"
    });
    
    datastore.then(result => console.log(result.id));
Powered by Linen
Title
b

big-piano-35669

09/02/2018, 7:46 PM
For example:
let datastore = vsphere.getDatastore({
  name: "bdf1000-01",
  datacenterId: "datacenter-21"
});

datastore.then(result => console.log(result.id));
View count: 1