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
general
  • p

    proud-tiger-5743

    09/28/2018, 9:06 PM
    I've done your method before and it works, so how would I do it if I have to bind multiple resources?
  • s

    stocky-spoon-28903

    09/28/2018, 9:06 PM
    It might actually work if you take the JSON.stringify away (though not certain on that)
  • s

    stocky-spoon-28903

    09/28/2018, 9:06 PM
    For multiple variables like that you can use
    pulumi.all
  • s

    stocky-spoon-28903

    09/28/2018, 9:07 PM
    const policy = pulumi.all([thing1.arn, thing2.arn]).apply(([arn1, arn2]) => {
        return ......
    });
  • p

    proud-tiger-5743

    09/28/2018, 9:07 PM
    aha! - That is most useful
  • s

    stocky-spoon-28903

    09/28/2018, 9:08 PM
    There’s also an overload where you can pass an object like this:
  • s

    stocky-spoon-28903

    09/28/2018, 9:09 PM
    const policy = pulumi.all({
        arn1: thing1.arn,
        arn2: thing2.arn
    }).apply(reified => {
        // reified.arn1 and reified.arn2 are unwrapped values here
    });
  • p

    proud-tiger-5743

    09/28/2018, 9:16 PM
    Perfect- thanks @stocky-spoon-28903
  • g

    glamorous-printer-66548

    09/28/2018, 10:04 PM
    Is somewhere a good explanation on how
    .get
    on resources works and where it gets its data from? Does it query information from the state in the current stack, can I query other stacks, does it call the provider APIs to figure out the information? I need to get some info about an existing GKE cluster, similar to what I would do with “data sources” in terraform https://www.terraform.io/docs/providers/google/d/google_container_cluster.html.
  • s

    stocky-spoon-28903

    09/28/2018, 10:06 PM
    @glamorous-printer-66548 All of the terraform data sources are reflected in the form of
    get*
    functions
  • s

    stocky-spoon-28903

    09/28/2018, 10:07 PM
    https://github.com/jen20/pulumi-aws-vpc/blob/master/src/index.ts#L102-L104 is an example (in this case for AWS)
  • g

    glamorous-printer-66548

    09/28/2018, 10:11 PM
    so the equivalent for a gke cluster data source in pulumi would be this? https://pulumi.io/reference/pkg/nodejs/@pulumi/gcp/container/#getCluster
  • s

    stocky-spoon-28903

    09/28/2018, 10:12 PM
    Thats the one
  • g

    glamorous-printer-66548

    09/28/2018, 10:12 PM
    what is the static
    .get
    method on resource classes then for?
  • s

    stocky-spoon-28903

    09/28/2018, 10:12 PM
    Hmm, I don’t know. @big-piano-35669 or @microscopic-florist-22719 likely do
  • i

    incalculable-sundown-82514

    09/28/2018, 10:13 PM
    It’s to refer to a resource that already exists - you can use
    .get
    to get a Resource object representing something that Pulumi didn’t create.
  • i

    incalculable-sundown-82514

    09/28/2018, 10:13 PM
    e.g. created by the cloud console, Terraform, etc.
  • i

    incalculable-sundown-82514

    09/28/2018, 10:13 PM
    Pulumi won’t delete it or modify it in any way, but you can use its properties to create other resources.
  • i

    incalculable-sundown-82514

    09/28/2018, 10:14 PM
    .get
    overlaps a little with TF data sources
    👍 1
  • g

    glamorous-printer-66548

    09/28/2018, 10:17 PM
    is it possible to turn a
    Promise<gcp.container.GetClusterResult>
    into an
    Input<gcp.container.GetClusterResult>
    or
    Output<gcp.container.GetClusterResult>
    so that I can pass subproperties of the result to pulumi resources without manual unwrapping?
    m
    i
    • 3
    • 38
  • f

    full-dress-10026

    09/28/2018, 10:44 PM
    Is there a way to get all stack outputs as a json map?
    m
    b
    • 3
    • 8
  • s

    square-crayon-17656

    09/28/2018, 10:45 PM
    Looking to experiment with pulumi .. seems very promising. Since I am mostly using helm right now I figured I would start with the provided example. https://github.com/pulumi/pulumi-kubernetes/blob/master/examples/helm/index.ts
  • s

    square-crayon-17656

    09/28/2018, 10:47 PM
    of interest to me was the ability to get information back from a chart and possibly use that as a value in other chart install. My use case is with CRD. So I tried to use the getResource as show here as follows: getResource(“kubeless.io/v1beta1”, “kinesis-trigger”); But that results in error TS2345: Argument of type ‘“kubeless.io/v1beta1”’ is not assignable to parameter of type ‘“storage.k8s.io/v1beta1/StorageClassList”’.
    w
    • 2
    • 2
  • s

    square-crayon-17656

    09/28/2018, 10:47 PM
    is there an easier way to get data from the state file? Very familiar with terraform and how their remote state works, figuring pulumi has something equivalent
    c
    b
    • 3
    • 7
  • b

    busy-umbrella-36067

    09/30/2018, 9:28 PM
    man pulumi is fun, its so easy
    😀 7
  • g

    glamorous-printer-66548

    10/01/2018, 3:45 AM
    Hey when reading an existing resource via
    <Resource>.get(...)
    it seems the imported resource info always shows up in the stack diff, even if it hasn’t really changed. I’m seeing this behaviour with GKE clusters and this basically adds multiple hundred lines of noise to each diff. Is this a known limitation or bug, shall I open an issue?
    b
    • 2
    • 1
  • b

    busy-umbrella-36067

    10/01/2018, 5:12 PM
    what system libs does pulumi require? having a hard time getting it running in alpine
  • s

    stocky-spoon-28903

    10/01/2018, 6:03 PM
    Likely DNS and CA roots, what are you seeing?
  • b

    busy-umbrella-36067

    10/01/2018, 6:07 PM
    ~/.pulumi/bin # ls -l
    total 88108
    -rwxr-xr-x    1 root     root      28934167 Oct  1 17:11 pulumi
    -rwxr-xr-x    1 root     root      20417267 Oct  1 17:11 pulumi-language-go
    -rwxr-xr-x    1 root     root      20443010 Oct  1 17:11 pulumi-language-nodejs
    -rwxr-xr-x    1 root     root      20412343 Oct  1 17:11 pulumi-language-python
    -rw-r--r--    1 root     root          2430 Oct  1 17:11 pulumi-language-python-exec
    -rwxr-xr-x    1 root     root            69 Oct  1 17:11 pulumi-resource-pulumi-nodejs
    ~/.pulumi/bin # ./pulumi
    sh: ./pulumi: not found
    ~/.pulumi/bin # ldd ./pulumi
    	/lib64/ld-linux-x86-64.so.2 (0x7f7ce7ae3000)
    	libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f7ce7ae3000)
    	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f7ce7ae3000)
    ~/.pulumi/bin #
  • b

    busy-umbrella-36067

    10/01/2018, 6:08 PM
    trying to get it added into a circleci build, would like to add it to our already alpine based ci image
Powered by Linen
Title
b

busy-umbrella-36067

10/01/2018, 6:08 PM
trying to get it added into a circleci build, would like to add it to our already alpine based ci image
View count: 1