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

    boundless-airport-99052

    02/25/2020, 8:32 AM
    Hello, Today, I’m able to publish pulumi component in a private npm repository in order to reuse them in several pulumi projects, and it works like a charm (thanks pulumi team). As the component are in typescript, we can only reuse them in pulumi typescript project. In a big organisation, we would be able to let some team works in other languages like python. Is there a way to share component for a multi-language use ? May be by generating them ?
    t
    b
    • 3
    • 5
  • l

    limited-rainbow-51650

    02/25/2020, 11:03 AM
    I am trying to re-parent a resource into a custom component. The old parent is the stack (which is the implicit root). On my resource, which is now inside the
    pulumi.ComponentResource
    subclass, I add these custom resource options:
    parent: this,
    aliases: [{ parent: pulumi.getStack() }]
    However, I still see a
    create
    and
    delete
    as separate lines in my Pulumi preview. How can I make this work?
    • 1
    • 2
  • c

    colossal-plastic-46140

    02/25/2020, 2:09 PM
    Hi, What is the expected behavior of an
    pulumi.config.require_object("config")
    if the
    config
    object has data that was deemed a secret. I am trying to understand if
    require_object
    automatically translates the portion of the object into a secret that was set by using pulumi config set --secret. FWIW it seems to mask the secret in pulumi preview, but when writing the state file it seems to be showing keys in plain text.
    w
    • 2
    • 3
  • g

    great-fireman-56191

    02/25/2020, 3:46 PM
    @early-intern-90238 please check your inbox
  • s

    salmon-needle-46218

    02/25/2020, 9:47 PM
    👋 hi all
    👋 1
    🎉 2
    b
    • 2
    • 1
  • r

    ripe-lighter-13633

    02/25/2020, 10:05 PM
    I’m banging my head against the wall.. I’m trying to get value interpolation working but nothing seems to work… I read the https://www.pulumi.com/docs/intro/concepts/programming-model/ a bunch of times… and I still don’t understand why I can’t get values showing up. I tried using
    .all().apply()
    ,
    .output()
    ,
    .interpolate()
    , … idk what to do..
    Untitled.ts
  • c

    calm-quill-21760

    02/25/2020, 10:06 PM
    @ripe-lighter-13633 try putting the "push" inside the apply() clause. Make your mToPush just a variable and ignore the return of .all(). Either that, or you may need to "return" a value from the apply().
  • r

    ripe-lighter-13633

    02/25/2020, 10:07 PM
    I had that previously and it still didn’t work
  • c

    calm-quill-21760

    02/25/2020, 10:08 PM
    I edited my message. Not sure if you saw the update?
  • r

    ripe-lighter-13633

    02/25/2020, 10:10 PM
    after putting .push() inside apply, I get an empty results
  • r

    ripe-lighter-13633

    02/25/2020, 10:11 PM
    probably because it’s all happening async
  • c

    calm-quill-21760

    02/25/2020, 10:11 PM
    Can you paste in that revised snippet?
  • r

    ripe-lighter-13633

    02/25/2020, 10:11 PM
    Untitled
  • r

    ripe-lighter-13633

    02/25/2020, 10:12 PM
    resulting in
    "apiVersion: v1\nkind: List\nitems:\n\n"
  • c

    calm-quill-21760

    02/25/2020, 10:13 PM
    I'm new to Pulumi as well, but yes, it looks like it's a result of the async behavior. Any reason you can't pull up the code from results.map inside that apply() clause?
  • r

    ripe-lighter-13633

    02/25/2020, 10:14 PM
    because it’s really hard to do that
  • c

    calm-quill-21760

    02/25/2020, 10:14 PM
    Getting at generated values in Pulumi can be really tricky. @white-balloon-205 pointed out that with some refactoring, it's possible to write code that doesn't rely on the apply clauses at all.
  • r

    ripe-lighter-13633

    02/25/2020, 10:15 PM
    I can’t get either interpreted or interpolated values in the above snippet to work
  • r

    ripe-lighter-13633

    02/25/2020, 10:16 PM
    ¯\_(ツ)_/¯
  • r

    ripe-lighter-13633

    02/25/2020, 10:19 PM
    @white-balloon-205, could you please review my snippet?
  • c

    calm-quill-21760

    02/25/2020, 10:23 PM
    What about something like this?
    import * as aws from "@pulumi/aws";
    import * as pulumi from "@pulumi/pulumi";
    
    
    export function generateMachinesYaml(
        masters: aws.ec2.Instance[],
        workers: aws.ec2.Instance[]
    ) {
        let results: any[] = [];
        for (let i = 0; i < masters.length; i++) {
            const m = masters[i];
            pulumi
                .all([m.id, m.publicIp, m.privateIp])
                .apply(([id, publicIp, privateIp]) =>
                    results.push({
                        id,
                        publicIp,
                        privateIp,
                        label: "master"
                    })
                );
        }
        let listItems: string[] = [];
        for (let i = 0; i < workers.length; i++) {
            const m = workers[i];
            pulumi
                .all([m.id, m.publicIp, m.privateIp])
                .apply(([id, publicIp, privateIp]) =>
                    listItems.push(
                        `- apiVersion: <http://cluster.k8s.io/v1alpha1|cluster.k8s.io/v1alpha1>
      kind: Machine
      metadata:
        name: $id}
        namespace: weavek8sops
        labels:
          set: "worker"
      spec:
        versions:
          kubelet: 1.14.1
          controlPlane: 1.14.1
        providerSpec:
          value:
            apiVersion: baremetalproviderspec/v1alpha1
            kind: BareMetalMachineProviderSpec
            public:
              address: ${publicIp}
              port: 22
            private:
              address: ${privateIp}
              port: 22`
                    ))
                .apply(() => {
                    // listItems = listItems.join("\n");
                    const yaml =
                        `apiVersion: v1
    kind: List
    items: ${listItems}`;
                    return yaml;
                });
        }
    }
    w
    r
    • 3
    • 17
  • b

    billowy-laptop-45963

    02/25/2020, 10:30 PM
    I have an aws / ts stack that I last updated a month ago and now it wants to do delete a bunch of my role attachments. Was anything changed that might've caused this? I have a decent amount of .apply / .then programming going on so I'm wondering if something changed in a way which makes that invalid...
    w
    c
    • 3
    • 8
  • c

    calm-quill-21760

    02/25/2020, 10:38 PM
    @billowy-laptop-45963 the preview mode should give you an idea what's going to be changed. That can lead you towards the section where the code may have changed.
  • c

    calm-quill-21760

    02/25/2020, 10:39 PM
    Because resources can complete at different times, order isn't guaranteed, and that can cause changes (such as the same routes now being applied in a different order).
  • s

    salmon-account-74572

    02/26/2020, 12:05 AM
    Is there a way to have the
    pulumi
    CLI tool not check for and report on newer versions?
    w
    • 2
    • 2
  • d

    dazzling-area-7593

    02/26/2020, 2:42 AM
    What is the best way to refactor code where some resource name change?
    w
    • 2
    • 2
  • d

    dazzling-area-7593

    02/26/2020, 2:42 AM
    Also, how do I find the URN of resources. Some resources don’t show the URN in the Pulumi console.
    m
    • 2
    • 4
  • g

    great-fireman-56191

    02/26/2020, 8:13 AM
    @white-balloon-205 please check your inbox, thank you.
    b
    • 2
    • 1
  • b

    boundless-airport-99052

    02/26/2020, 10:22 AM
    Hi Pulumi team. Are you aware that examples have disappeared on documentation (at least for typescript/azure) since this commit : https://github.com/pulumi/docs/commit/7b515e0bd6c50d55102634ccf043634f1622c8a3#diff-78672af2fbbf340a6926b7629ea1627d ?
    t
    • 2
    • 2
  • s

    sticky-lighter-73941

    02/26/2020, 10:29 AM
    Hi guys ! I have a cluster deployed on Azure (Aks) vía Pulumi , but for some reason Pulumi keeps applying the configuration without any ‘Pulumi up’ action trigger. Do you have an idea what is happening? Check the image , this just happened out of nothing :(
    b
    • 2
    • 7
Powered by Linen
Title
s

sticky-lighter-73941

02/26/2020, 10:29 AM
Hi guys ! I have a cluster deployed on Azure (Aks) vía Pulumi , but for some reason Pulumi keeps applying the configuration without any ‘Pulumi up’ action trigger. Do you have an idea what is happening? Check the image , this just happened out of nothing :(
b

broad-helmet-79436

02/26/2020, 12:03 PM
pretty sure pulumi can’t do anything without being explicitly run. Could it possibly be one of these? 1. Do you have a (possibly misconfigured) trigger running
pulumi up
on some kind of build server? 2. Do you have a forgotten terminal running
pulumi watch
? 3. Did you pipe the output from
pulumi up
to another program, such as
pulumi up | less
? Pulumi auto-accepts changes in non-interactive environments (this will change in v2)
s

sticky-lighter-73941

02/26/2020, 12:39 PM
Hi @dry-raincoat-51244 thanks for your reply. Indeed it’s very strange, regarding the options mentioned. #2 and #3 are possible: I did pipe the output to another program and used the Pulumi Watch but that was long time ago ( in December). Is it possible that could be the case ? If so what ca I do ?
b

broad-helmet-79436

02/26/2020, 1:11 PM
I dunno, to be honest. If Pulumi created the resources then I guess you can remove the resources you don’t want from your code (comment them out or something) and run
pulumi preview
to see what will happen?
here’s a link to the piping issue https://github.com/pulumi/pulumi/issues/3435
not 100 % sure if it’s published yet or if it’s going to be published in Pulumi 2.0.0 to be honest
s

sticky-lighter-73941

02/26/2020, 1:27 PM
Thanks ! I’ll have a look
b

broad-helmet-79436

02/26/2020, 1:28 PM
good luck 🙂
👍 1
View count: 1