https://pulumi.com logo
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
python
  • n

    nutritious-shampoo-16116

    04/01/2020, 10:59 AM
    ok got it, need to instantiate with the namespace pulumi.Config(namespace)
    ☝️ 1
  • r

    rich-easter-89163

    04/01/2020, 4:43 PM
    i used
    pulumi_aws.get_region()
  • g

    green-morning-1318

    04/02/2020, 1:57 AM
    I think I got my manager excited about Pulumi too... he wrote an article using the Python SDK to create an EKS cluster https://www.cloudjourney.io/articles/devops/eks_pulumi-bs/
    😛ulumipus-8bit: 2
    ❤️ 1
    🎉 3
  • b

    billowy-laptop-45963

    04/03/2020, 6:19 PM
    Are there any good resources to see how pulumi is being used in python in a more advanced way than pulumi/examples?
    h
    • 2
    • 2
  • a

    agreeable-angle-1483

    04/05/2020, 12:21 PM
    I’ve installed Python 3.7 on Debian 9 and then run
    pulumi up
    :
    # pulumi up
    warning: Pulumi will not be able to print a statefile permalink using these credentials. Neither a GoogleAccessID or PrivateKey are available. Try using a GCP Service Account.
    Enter your passphrase to unlock config/secrets
        (set PULUMI_CONFIG_PASSPHRASE to remember):
    Previewing update (<http://dev.bd|dev.bd>):
         Type                 Name                Plan     Info
         pulumi:pulumi:Stack  <http://vpc_network-dev.bd|vpc_network-dev.bd>           1 error; 9 messages
    
    Diagnostics:
      pulumi:pulumi:Stack (<http://vpc_network-dev.bd|vpc_network-dev.bd>):
        error: an unhandled error occurred: Program exited with non-zero exit code: 1
    
        Traceback (most recent call last):
          File "/usr/local/sbin/pulumi-language-python-exec", line 14, in <module>
            import pulumi
          File "/usr/local/lib/python3.5/dist-packages/pulumi/__init__.py", line 25, in <module>
            from .asset import (
          File "/usr/local/lib/python3.5/dist-packages/pulumi/asset.py", line 34
            path: str
                ^
        SyntaxError: invalid syntax
    
    
    warning: A new version of Pulumi is available. To upgrade from version '1.12.0' to '1.14.0', visit <https://pulumi.com/docs/reference/install/> for manual instructions and release notes.
    does anyone knows what’s wrong with it?
  • g

    gray-tailor-20387

    04/06/2020, 2:37 PM
    I'm trying to import a kubernetescluster and nodepool from digitalocean into a pulumi project by adding following argument to the resources:
    opts=pulumi.ResourceOptions (import_= "")
    I have tried extensively but failed to get it to work, what are all the possibilities for inside of import_ ? Once i've got that right, the only thing i can do wrong is have a different configuration in the code compared to the live implementation, right?
  • b

    billowy-laptop-45963

    04/07/2020, 8:04 PM
    I'm creating a library and I have an examples/ directory with examples/example_test.go with
    Dependencies: []string{
    			filepath.Dir(getCwd((t))),
    		},
    in my integration.ProgramTestOptions{}. When I run the go test it doesn't install the library. There is a setup.py and I tested it with a virtualenv and
    pip install .
    Is there anything I need to do for the integration test to install my library?
    f
    • 2
    • 5
  • c

    colossal-room-15708

    04/14/2020, 5:33 AM
    Struggling with Outputs again, I think...
    compute.Extension("{0}install".format(server),
            virtual_machine_id=vm.id,
            publisher="Microsoft.Compute",
            type="CustomScriptExtension",
            type_handler_version="1.9",
            auto_upgrade_minor_version=True,
            settings= json.dumps({'commandToExecute': command_to_execute, 'fileUris': [args.bootstrap_file_name]}),
            protected_settings=json.dumps({'storageAccountName': args.bootstrap_storage_account_name, 'storageAccountKey': args.bootstrap_storage_access_key})
          )
    I'm receiving
    File "/usr/lib/python3.7/json/encoder.py", line 179, in default
            raise TypeError(f'Object of type {o.__class__.__name__} '
        TypeError: Object of type Output is not JSON serializable
        error: an unhandled error occurred: Program exited with non-zero exit code: 1
    I am passing the args in to this component like this:
    combined_output = Output.all(install_scripts_storage_account.name, install_scripts_storage_account.primary_access_key, install_scripts_storage_blob.url)
    bootstrap_storage_account_name = combined_output.apply(lambda lst: lst[0])
    bootstrap_storage_access_key = combined_output.apply(lambda lst: lst[1])
    bootstrap_file_name = combined_output.apply(lambda lst: lst[2])
    Does
    json.dumps()
    not work in this context? If I pass the actual values in, hard code the actual strings, then it works.
    f
    • 2
    • 10
  • w

    white-airport-48392

    04/15/2020, 7:51 AM
    Hi , I am exporting a python object in one stack , by export I mean Stack Output for example say
    {
      "a": "b",
      "c": "d"
    }
    I want to access this as a python Object in another stack , I use StackReference And tried
    infra_props = StackReference("dev")
    
    print(infra_props.get_output("network_config").all().apply(lambda c: json.dumps(c)))
    This still outputs an Output
    Am I doing it wrong ?
    Is there a right way to pass around json stack Outputs from one stack to other
    w
    • 2
    • 1
  • p

    proud-lighter-99544

    04/16/2020, 7:30 PM
    Can anybody point me to a python example of automating building a docker image locally then pushing to ECR like this one? https://www.pulumi.com/blog/managing-containers-on-aws-with-pulumi/. I don’t see a way to do that in the aws_pulumi python API docs
    f
    c
    • 3
    • 5
  • n

    nutritious-shampoo-16116

    04/17/2020, 8:06 AM
    hey python people, is anybody out there debugging stacks without visal studio and without callbacks?
  • n

    nutritious-shampoo-16116

    04/17/2020, 8:06 AM
    I can't find a nice way to debug things other then callbacks
  • b

    billowy-laptop-45963

    04/17/2020, 9:00 PM
    I don't get the purpose of having both ResourceOptions.provider and ResourceOptions.providers. Typescript only has one: provider...
  • r

    rich-easter-89163

    04/20/2020, 8:36 PM
    Sent a small fix for Python3.8 FYI https://github.com/pulumi/pulumi-kubernetes/pull/1079
    👍 1
  • w

    white-airport-48392

    04/22/2020, 5:21 AM
    Can someone point me to an integration testing example other than in go ? , Pulumi 2.0 supports multi language integration testing as per documentation ?
    l
    • 2
    • 10
  • f

    famous-salesmen-28835

    04/22/2020, 5:27 AM
    Hi Team, I have a small query. Like
    pulumi up
    is command line interface which start execution from
    ___main__.py_
    file . But is it any way that I need not to run
    pulumi up
    and with python function call it. Currently I have created a wrapper function which call
    pulumi up
    in background. So I need to know if any python SDK function call is available with some control.
    w
    l
    • 3
    • 2
  • s

    sparse-state-34229

    04/22/2020, 8:08 AM
    what’s the python equivalent of
    cluster.kubeconfig
    here? https://github.com/pulumi/kubernetes-guides/blob/master/aws/03-cluster-configuration/index.ts#L59
    ❓ 1
    b
    • 2
    • 2
  • s

    sparse-state-34229

    04/22/2020, 8:09 AM
    I don’t see it referenced anywhere, even in the typescript api
  • s

    sparse-state-34229

    04/22/2020, 9:44 AM
    here’s another one: where’s the python equivalent of this bit? https://github.com/pulumi/kubernetes-guides/blob/master/aws/03-cluster-configuration/index.ts#L24 same thing, can’t find any documentation these arguments
    b
    • 2
    • 5
  • s

    sparse-state-34229

    04/22/2020, 9:44 AM
    really, wondering where that whole bit is documented, not just
    roleMappings
  • g

    gentle-diamond-70147

    04/22/2020, 3:53 PM
    @sparse-state-34229 that Kubernetes guide is using our
    @pulumi/eks
    module which is a set of higher-level components on top of the low-level AWS resources.
    @pulumi/eks
    is only available for TypeScript and JavaScript currently so that representation of an EKS cluster won't match exactly what you see in Python.
    s
    • 2
    • 17
  • b

    bland-lamp-16797

    04/22/2020, 4:51 PM
    is there a way I can debug python starlark ? ipython for example or any remote debugging? I would like to know why
    dns_name
    of
    pulumi_gcp.dns.ManagedZone
    is class
    pulumi.output.Output
    and how to convert it to
    str()
    so I can use it later
    l
    • 2
    • 8
  • f

    fierce-market-67222

    04/23/2020, 2:06 PM
    Hello, so i have a question i have 5 deployments (each one has cluster ip, lb and so on) and i need to deploy them in a particular order, lets say A before B and B before C and so on… how can i do this using a singel stack …because in the end i dont want to sort and have 5 micro-stacks…just for 1 cluster …for now i use a singlen entrypoint file where i call them. Im not sure if i can use depends_on for this and also not sure how to implement it. Thank you for any help
    ❓ 1
    b
    f
    s
    • 4
    • 8
  • h

    high-orange-18933

    04/25/2020, 4:25 PM
    Hi guys, I want to create multiple GCE VMs using Pulumi. I can run the for loop to create multiple VMs but how do i export all the created VM's information. so basically "how do i export multiple VM's information after they are created ?" At the moment, pulumi is showing the information for last VM.
    w
    f
    • 3
    • 23
  • e

    eager-vase-43200

    04/26/2020, 7:45 AM
    Hello everyone. I learnt about pulumi recently and would like to switch over from terraform. I am a developer who happens to also manage infrastructure. So, I hope that answers why pulumi. I just started working on mmigrating my gcp -> gke infrastructure management from terraform to pulumi using python sdk. The first problem I ran into this evening is that, I use two different gcp service accounts for terrform backend state management and infrastructure management. Looks like I can not do that in pulumi or can I? Today
    w
    • 2
    • 2
  • b

    billions-glass-17089

    04/26/2020, 6:00 PM
    is there a way to get the stack name at run time?
    • 1
    • 1
  • v

    victorious-helmet-11068

    04/28/2020, 6:44 AM
    hi there. I’m looking for something like the typescript crosswalk for aws vpc, but in python. When we usually create a vpc, we follow the best practice already implemented in the crosswalk.
    💯 2
  • v

    victorious-helmet-11068

    04/28/2020, 6:44 AM
    May be someone can share code/links? thanks
  • s

    sparse-state-34229

    04/28/2020, 6:46 AM
    i don’t think it exists yet unfortunately
  • s

    sparse-state-34229

    04/28/2020, 6:47 AM
    most of the api is similar though
Powered by Linen
Title
s

sparse-state-34229

04/28/2020, 6:47 AM
most of the api is similar though
View count: 1