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

    high-translator-22614

    07/05/2019, 1:57 AM
    oh, that might just be a
    BucketObject
    thing?
  • h

    high-translator-22614

    07/05/2019, 2:52 AM
    given an
    ResourceOptions
    or
    Resource
    , can I get the provider that would be used? I want to get the current aws region for a given component resource
  • i

    icy-dress-83371

    07/08/2019, 7:05 PM
    Anyone have any github link for Python version of Azure vm's, including load balancers, etc. Looking for an example to get started with, something like https://github.com/pulumi/pulumi-azure/tree/master/examples/loadbalancer but for python
  • h

    high-translator-22614

    07/08/2019, 7:25 PM
    tbh, i've been using a lot of JS examples. thankfully, they largely translate
  • h

    high-translator-22614

    07/08/2019, 7:25 PM
    the bigger problem is that pulumi-cloud and pulumi-awsx aren't available in python
  • h

    high-translator-22614

    07/08/2019, 7:32 PM
    like, all of the existing libraries are automatically generated from terraform code? so for the most part you just have to translate the names
  • n

    nutritious-microphone-86225

    07/09/2019, 7:46 AM
    Hi Folks, does anyone have idea on how to read value of Output in python (as string) ? E.g. I want to read assigned Ip address from an instance. As per docs this feature is not ready but maybe there is an option to use .apply in some way to read the value
  • n

    nutritious-microphone-86225

    07/09/2019, 7:46 AM
    https://github.com/pulumi/pulumi/issues/2366
  • h

    high-translator-22614

    07/10/2019, 1:00 AM
    await myout.future()
    w
    • 2
    • 12
  • h

    high-translator-22614

    07/10/2019, 1:01 AM
    i also like using
    .apply()
    as a decorator
  • c

    colossal-room-15708

    07/10/2019, 2:49 AM
    How do I get the output of this
    org
    object here?
    org = organizations.Organization("org", 
      feature_set="ALL"
    )
    
    roots=org.roots.apply(
        lambda roots: roots[0].id
      )
    
    print(roots)
    pulumi up
    gives me:
    Diagnostics:
      pulumi:pulumi:Stack (aws-scaffolding-dev):
        <pulumi.output.Output object at 0x7f599c0624e0>
  • h

    high-translator-22614

    07/10/2019, 2:57 AM
    just hand it to whatever needs it
  • h

    high-translator-22614

    07/10/2019, 2:58 AM
    pulumi internally resolves `Output`s and coroutines if it finds them in stuff
    c
    • 2
    • 17
  • b

    brief-school-94535

    07/11/2019, 11:24 AM
    My pulumi app just stopped working and throwing out
    panic errors
    when deploying a GKE cluster to GCP. My code hasn't changed and has been working for months. The errors are pointing to some golang/terraform resource issues. I've filed an issue in GitHub here: https://github.com/pulumi/pulumi/issues/2922 @white-balloon-205 any thoughts?
    w
    • 2
    • 1
  • l

    little-river-49422

    07/11/2019, 1:51 PM
    crappyform strikes again xD
  • n

    nutritious-microphone-86225

    07/12/2019, 9:26 AM
    Hi Guys, is there any way in Python to wait until some resources are created and only after they are create to continue on with Python app ?
  • l

    little-river-49422

    07/12/2019, 11:31 AM
    pulumi would do that on its own if one resource depends on the output of another resource
  • n

    nutritious-microphone-86225

    07/12/2019, 12:35 PM
    right but it is between resources
  • h

    high-translator-22614

    07/12/2019, 3:34 PM
    why? what's the use case?
  • h

    high-translator-22614

    07/12/2019, 3:39 PM
    i mean, you could write yourself a
    Gate
    that takes a pile of resources and waits on them all, and then other things can depend on the gate, but that means that anything after the gate will indirectly depend on anything before the gate
  • n

    nutritious-microphone-86225

    07/12/2019, 4:05 PM
    Any sample with example impl ? Use case - create a VM, wait for External IP allocation by GCP, then continue python script where it’s main task will be to provision VM via this external IP
  • h

    high-translator-22614

    07/12/2019, 4:06 PM
    pulumi is all async, so you don't need to block the whole script waiting for resource creation
  • h

    high-translator-22614

    07/12/2019, 4:07 PM
    you could pretty easily make a polling routine that runs in the background, although correctly handling dependencies in this case isn't something that's well documented
  • s

    stocky-spoon-28903

    07/12/2019, 4:10 PM
    @nutritious-microphone-86225 If there is no natural dependency, you can specify an array of depenencies as
    depends_on
    in the
    ResourceOptions
    for the resource you want to wait
  • f

    future-traffic-93788

    07/12/2019, 11:45 PM
    got a silly question, was playing with pulumi. How do I go about having a custom class to bake in settings for a resource
  • f

    future-traffic-93788

    07/12/2019, 11:45 PM
    i.e.
    class NginxService(Service):
    
        def __init__(self, service_app_name):
            app_labels = {
                "app": service_app_name
            }
    
            metadata = {
                           "labels": deployment.spec["template"]["metadata"]["labels"],
                       },
            spec = {
                "type": "ClusterIP",
                "ports": [{"port": 80, "target_port": 80, "protocol": "TCP"}],
                "selector": app_labels,
            }
            super(NginxService, self).__init__(service_app_name, metadata=metadata, spec=spec)
  • f

    future-traffic-93788

    07/12/2019, 11:45 PM
    this gives a
    ValueError: Unexpected type
    when Pulumi is converting to protobuf
  • h

    high-translator-22614

    07/12/2019, 11:50 PM
    I would use a factory over subclassing
  • f

    future-traffic-93788

    07/12/2019, 11:50 PM
    is that the only approach?
  • h

    high-translator-22614

    07/12/2019, 11:51 PM
    I assume
    Service
    is a pulumi-provided resource?
Powered by Linen
Title
h

high-translator-22614

07/12/2019, 11:51 PM
I assume
Service
is a pulumi-provided resource?
View count: 1