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
  • s

    some-kitchen-64615

    04/21/2020, 9:43 AM
    Hi, Just FYI, https://www.pulumi.com/webinars/pulumi-update-2020-04-29/ form not working, timeout
    t
    b
    • 3
    • 10
  • s

    stale-minister-93676

    04/21/2020, 1:37 PM
    So I'm using the Rancher2 Provider and
    getCluster
    returns a promise. I'm then trying to use
    getProject
    with cluster id via
    cluster.then(cluster => cluster.id)
    however I get an error saying
    Error: Promises cannot be passed in as arguments to a data source call.
    How am I supposed to get around that?
    • 1
    • 1
  • l

    limited-rainbow-51650

    04/21/2020, 4:34 PM
    One thing which is not clear to me in unit testing Pulumi infra is how to mimic an update of existing infra. How can I mimic in a unit test a certain state as starting point, create my infra and validate the proposed change set? Is it possible?
    t
    • 2
    • 2
  • b

    brave-angle-33257

    04/21/2020, 6:31 PM
    did
    getOutputSync
    get removed in pulumi 2.0.0 ??
    r
    g
    • 3
    • 26
  • s

    stale-minister-93676

    04/21/2020, 6:46 PM
    Is there a way to detect a change in code? I need to pass new and old credentials as env to ensure the app reconfigures itself to use the new credentials.
    w
    • 2
    • 5
  • i

    incalculable-church-62932

    04/21/2020, 9:01 PM
    hi guys, are there any plans or talks on opensourcing the Pulumi api?
  • o

    orange-policeman-59119

    04/21/2020, 9:41 PM
    Where is the format of the "import" string documented? e.g.: for a namespaced resource in Kubernetes is it: Given resource $NAME, $KIND, and namespace as $SPACE for readability. Namespaced resources: •
    $NAME
    aka
    istio-citadel
    - the name of the resource •
    $KIND/$NAME
    aka
    deployment.apps/istio-citadel
    - the resource kind and name •
    $SPACE/NAME
    aka
    istio-system/istio-citadel
    - the namespace and name of the resource (omitting the resource kind) Non-namespaced resources: •
    $NAME
    aka
    istio-citadel
    - the name of the resource •
    $KIND/$NAME
    aka
    deployment.apps/istio-citadel
    - the resource kind and name
  • o

    orange-policeman-59119

    04/21/2020, 9:42 PM
    Further, how does that interplay with Helm Charts? Do I declare
    { import: '???' }
    on the chart, or do I use per-yaml resource transformations?
  • o

    orange-policeman-59119

    04/21/2020, 10:58 PM
    Okay, I think I've answered that question by just trying a bunch of things, leaving me with more questions! 1. Is it possible to pass a dynamic (
    Input/Output
    ) value to the
    import
    property? I am able to pass an Input/Output to the
    metadata.name
    and
    metadata.namespace
    into the object args, but I cannot then reference said name and namespace in the
    import
    arg? 2. Is it possible to pass in a value for
    opts: { import: ??? }
    that automatically determines what to import? For Kubernetes resources where the name and namespace are part of the resource itself, that is, for any given object defining
    { metadata: ObjectMeta }
    we can determine the ID deterministically, so having to repeat it seems un-DRY.
  • o

    orange-policeman-59119

    04/21/2020, 10:58 PM
    This is all an XY Problem though, the root problem is: I have a helm chart (ugh) that sometimes hangs (double ugh!) when I try to Pulumi deploy it, and when it hangs it doesn't serialize the state and checkpoints back. This then puts me in a really bad state because I have a bunch of dangling resources that I can't import correctly. How do I handle this?
    r
    w
    • 3
    • 12
  • t

    thousands-byte-82197

    04/22/2020, 9:00 AM
    Are there any plans to create utilities in Pulumi to help with authoring helm charts? It would be amazing to write charts using code rather than YAML + go templates.
    g
    • 2
    • 1
  • m

    mammoth-caravan-51104

    04/22/2020, 11:36 AM
    Hi! After 2.0 update i'm having troubles managing AWS named profiles. Since in new versions eks cluster access is controlled with a named profile (that's a great thing!). Problem is, that in development env I have a named profile and in CI/CD [github action] a default one. When updating from dev machine profile name is stored in the resource description and CICD pipeline is fails, because it's on a default profile. One of the solutions i'm thinking about is to write ~/.aws/credentials on CICD that has a same profile, but that seams like doing something wrong.. am I missing something here, is there some config variable to allow eks access on a default profile in a github action?
    b
    • 2
    • 2
  • s

    steep-angle-29984

    04/22/2020, 11:41 AM
    hi, maybe I missed something, but is there a way to set/import/load config/secret values in bulk? I'm asking because my playground project is getting more and more configuration and secret values and creating a new stack is getting annoying. Or can I maybe copy config/secets from another stack? I also startet to use nested config values. Is there no way to set the whole complex config value from e.g. a JSON string?
    l
    • 2
    • 3
  • s

    stocky-island-3676

    04/22/2020, 2:59 PM
    Just checked policy-packs for the first time. Seems really promising 👍 1. Can you “acknowledge” a CrossGuard-policy,
    enforcementLevel: "advisory"
    , directly at the resource? To get this check out of the list of policy violations. Similar like
    nolint
    flags. 2. How can you check if a value is a secret value, i.e. encrypted in the stack? Just read that secrets are unencrypted in policy-pack checks.
    m
    • 2
    • 6
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:21 PM
    Hello awesome Pulumi guys
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:22 PM
    Just a question, I've loged into the app.pulumi.com with a community account and I wanted to start a new AWS project
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:22 PM
    but I don't see the Golang language in there
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:22 PM
    only typescript, javascript, python
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:23 PM
    How do I choose Golang, is not yet implemented in there?
  • f

    fast-dinner-32080

    04/22/2020, 3:23 PM
    You can create a go project by following the instructions outlined here: https://www.pulumi.com/docs/intro/languages/go/
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:23 PM
    ^^
  • s

    stocky-motorcycle-65008

    04/22/2020, 3:24 PM
    All right, and If I loging to the app.pulumi.com It will be show in there, right?
    s
    • 2
    • 2
  • m

    millions-judge-24978

    04/22/2020, 3:33 PM
    Is this example wrong? https://www.pulumi.com/docs/guides/crosswalk/aws/eks/#configuring-your-eks-cluster-s-networking
    vpc.privateSubnetIds
    and
    vpc.publicSubnetIds
    are promises, can’t just call
    .concat
    g
    b
    • 3
    • 27
  • c

    cool-egg-852

    04/22/2020, 4:29 PM
    Anyone have a clue about
    pulumi config -s LinioIT/pr1234 set --path <http://app.reviewApp.pr|app.reviewApp.pr> 1234
    error: a map was expected for key "pr"
    ?
    • 1
    • 2
  • a

    adventurous-park-10099

    04/22/2020, 9:15 PM
    Hey guys, I’m planning on running Pulumi in a live service in my infrastructure that can be triggered from the UI. Is there any guidance around managing safe
    apply
    termination, recovering from state mismatches, and the like?
    b
    l
    • 3
    • 3
  • m

    mysterious-australia-14256

    04/23/2020, 9:39 AM
    Hi, can I control the auto-naming at all? When I create an azure Resource Group using C# it is taking the name (div-proj-rg) and appending the auto-name straight to it so I end up with div-proj-rgXYZ (where XYZ is the random part). I'd like to force it to stick a - in so I get div-proj-rg-XYZ Cheers Alan
    b
    e
    • 3
    • 6
  • b

    bland-lamp-16797

    04/23/2020, 10:59 AM
    Can I import the state in code like I would with
    terraform_remote_state
    ? so for example, if I would have
    dev/staging
    i would like to import from staging some dev outputs ?
    b
    • 2
    • 3
  • e

    eager-pillow-75917

    04/23/2020, 11:19 AM
    Hi, is there a way to reference resources from another stack in the community version? I am storing my stacks in a GCS bucket.
    r
    • 2
    • 1
  • r

    rhythmic-finland-36256

    04/23/2020, 11:50 AM
    Moving projects / stacks into a new account (pulumi managed backend). Is import/export the way to go? What about secrets?
    g
    • 2
    • 8
  • e

    eager-pillow-75917

    04/23/2020, 12:03 PM
    I am trying to use an output as a value in another resource but keep getting this:
    To get the value of an Output<T> as an Output<string> consider either:
    1: o.apply(v => `prefix${v}suffix`)
    2: pulumi.interpolate `prefix${v}suffix`
    f
    w
    • 3
    • 26
Powered by Linen
Title
e

eager-pillow-75917

04/23/2020, 12:03 PM
I am trying to use an output as a value in another resource but keep getting this:
To get the value of an Output<T> as an Output<string> consider either:
1: o.apply(v => `prefix${v}suffix`)
2: pulumi.interpolate `prefix${v}suffix`
f

faint-motherboard-95438

04/23/2020, 12:14 PM
Hi @eager-pillow-75917, You should provide us a snippet of your code in order to help you with. This error usually means what it says, your are not consuming the
Output
properly.
w

wonderful-dog-9045

04/23/2020, 12:14 PM
that's because the value is not resolved yet (it will be resolved at a later stage).
So if you value is on variable
x
you can manipulate it with with
x.apply(x => doSomethingWithX(x))
e

eager-pillow-75917

04/23/2020, 12:21 PM
Thanks Garik.
But hey, the documentation is wrong, then.
this is basically what I am trying to do…
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
const env = pulumi.getStack();
const infra = new pulumi.StackReference(`acmecorp/infra/${env}`);
const provider = new k8s.Provider("k8s", { kubeconfig: infra.getOutput("kubeConfig") });
const service = new k8s.core.v1.Service(..., { provider: provider });
I got this snippet from https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/#inter-stack-dependencies
If I `
infra.getOutput("kubeConfig")
like it is in the documentation, I get the above error.
w

wonderful-dog-9045

04/23/2020, 12:26 PM
ok, that depends on how you are using the return value of
infra.getOutput()
e

eager-pillow-75917

04/23/2020, 12:27 PM
I had to do something like this to make it work.
const infra = new pulumi.StackReference("acmecorp/infra/${env}");

export const kubeConfig = infra.getOutput("kubeConfig");
let provider;
kubeConfig.apply(clusterNameOutput => {
  bucket = new k8s.Provider("k8s", { kubeconfig: kubeConfig });
});
no it doesnt man
the documentation is just wrong
I am using an output as a value in a new resource just like in the documentation and it just does not work
to be fair, just like a number of other things are also misleading in the docs
w

wonderful-dog-9045

04/23/2020, 12:29 PM
i guess it may be outdated.
f

faint-motherboard-95438

04/23/2020, 12:31 PM
@eager-pillow-75917 if you provide the whole exact code you are using, someone can actually help you on your context. What the doc says works. I have several clusters doing exactly that.
What is the code of your stack exporting the
kubeConfig
?
e

eager-pillow-75917

04/23/2020, 2:10 PM
this is how I did it. (the kubeconfig I was using the same xample as the documentation)
const infra = new pulumi.StackReference("infra-staging");

export const clusterNameOutput = infra.getOutput("stagingClusterName");

clusterNameOutput.apply(clusterNameOutput => {
  const bucket = new gcp.storage.Bucket(`my-test-bucket-${clusterNameOutput}`)
});
but the documentation for inter stack dependency does not say anything about the apply method and only uses getOutput
f

faint-motherboard-95438

04/23/2020, 2:13 PM
@eager-pillow-75917 I would be interested in what’s happening in the stack
infra-staging
exporting your
stagingClusterName
. But there’s already a problem in your code here: you shouldn’t try to use outputs in the name of a component, that should be a static string.
e

eager-pillow-75917

04/23/2020, 2:15 PM
let´s try to abstract the issue here man
that was just the simplest example I could think of
I am dont need a bucket
this is just an exaple
read the first thing I sent this morning
I need to use an output as a value in another resource.
f

faint-motherboard-95438

04/23/2020, 2:28 PM
You know I’m actually trying to help you here, this is a community and we all give our time freely. We don’t work on “abstract”. The doc and examples work. So if you have an issue with your code that’s exactly where the problem resides, not on an “abstract” example of yours. So take it easy “man”. So, on an “asbtract” way of doing things, based on what you provided this morning, giving your
infra-staging
creates a cluster and exports the config like this:
export const { kubeconfig } = cluster
You can then do somewhere else something like this:
const infraStack = new pulumi.StackReference('infra-staging')

const k8sProvider = new k8s.Provider('k8s-provider', {
  kubeconfig: infraStack.getOutput('kubeconfig')
})

const myNamespace = new k8s.core.v1.Namespace('whatever', {}, { provider: k8sProvider })
View count: 2