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

    stocky-spoon-28903

    06/14/2019, 3:07 PM
    pulumi.export("public_subnet_ids", [sn.id for sn in self.public_subnets])
    for example
    f
    • 2
    • 4
  • c

    colossal-room-15708

    06/22/2019, 10:53 AM
    Are there already good examples / practices around creating reusable python modules for pulumi? In terraform I make my customers almost always write terraform modules so that other teams can just "import" them into their code. In nodejs I would create a custom component that I
    require
    into my
    index.js
    . Does the same work with python programs so I can just
    import
    them into
    __main__.py
    ?
  • l

    little-river-49422

    06/22/2019, 12:50 PM
    yeah, why not. its just python code
  • s

    stocky-spoon-28903

    06/22/2019, 2:21 PM
    @colossal-room-15708 Yes - absolutely. Ultimately our own SDKs are just python packages.
  • s

    stocky-spoon-28903

    06/22/2019, 2:21 PM
    I’ve updated my
    pulumi-aws-vpc
    library to have python support, but haven’t quite finished yet:
  • s

    stocky-spoon-28903

    06/22/2019, 2:21 PM
    https://github.com/jen20/pulumi-aws-vpc/tree/jen20/version-2
  • s

    stocky-spoon-28903

    06/22/2019, 2:22 PM
    That’s probably the most complete example I know of for this right now. I’m planning to expand some of the examples around this kind of pattern soon. If you have specific questions etc that would be useful to guide this!
  • c

    colossal-room-15708

    06/23/2019, 2:21 AM
    Yes, cool, I'll work on a few things today to see if I can get this working as well. 👍
  • c

    colossal-room-15708

    06/23/2019, 3:00 AM
    So, looking at your example @stocky-spoon-28903, I don't need to create a custom component as described here? https://pulumi.io/reference/programming-model/#components
  • c

    colossal-room-15708

    06/23/2019, 3:01 AM
    scratch that, GitHub search didn't show me this one here: https://github.com/jen20/pulumi-aws-vpc/blob/jen20/version-2/python/jen20_pulumi_aws_vpc/vpc.py That's a good example, thanks.
  • c

    colossal-room-15708

    06/23/2019, 4:36 AM
    Why does this here work in one case, but not in the other?
    parameters={
                                                       "bastionHostName": "%s-bastion" % (location),
                                                       "publicIpAddressName": self.pip.name,
                                                       "location": location,
                                                       "bastionServicesVnetName": vnet_name,
                                                       "bastionServicesSubnetName": self.subnet.name
                                                   }
  • c

    colossal-room-15708

    06/23/2019, 4:36 AM
  • c

    colossal-room-15708

    06/23/2019, 4:37 AM
    location
    in both cases is an input param to the component, which is an output from a resource outside of this component
  • c

    colossal-room-15708

    06/23/2019, 4:37 AM
    I guess I'll have to use
    .apply()
    , but to me, not being super deep into python, it seems strange that it works in one, but not the other.
  • c

    colossal-room-15708

    06/23/2019, 4:39 AM
    "bastionHostName": location.apply(lambda location: location + "-bastion"),
    fixed it
  • c

    colossal-room-15708

    06/23/2019, 4:40 AM
    what python concept am I missing here?
  • b

    billowy-laptop-45963

    06/25/2019, 8:05 PM
    when will awsx for python be available?
    👍 2
    w
    • 2
    • 2
  • b

    billowy-laptop-45963

    06/26/2019, 5:41 PM
    Are there any aws lambda examples that are a little more than hello world? What if your lambda function has dependencies? Currently we have a pipeline that builds deployable versioned artifacts that can be deployed with cloudformation. The pipeline handles doing pip installs for any dependencies.
    w
    h
    • 3
    • 8
  • b

    brave-angle-33257

    06/27/2019, 3:45 PM
    in our pipeline i use a docker container to load on top of the code, runs a pip install inside a venv mapped to the local filesystem, then it zips it all up and uses pulumi to deploy the zip
  • b

    brave-angle-33257

    06/27/2019, 3:45 PM
    i have some examples i could share if you’d like, send me a msg
  • l

    little-river-49422

    06/27/2019, 9:09 PM
    why? i just have a container with all the prereqs
  • h

    high-translator-22614

    07/02/2019, 8:18 PM
    is there any documentation describing how pulumi expects the users to handle coroutines and when they're ok to use?
  • h

    high-translator-22614

    07/02/2019, 8:19 PM
    like, for example, can i have a
    ComponentResource
    spawn its sub-resources in a
    Task
    ?
  • h

    high-translator-22614

    07/02/2019, 8:21 PM
    (this is coming up for me a lot because
    route53.get_zone()
    returns an awaitable, not an
    Output
    , so i'm having to write a bunch of utility stuff to manage the async flow while still keeping the structural definitions syncronous)
  • h

    high-translator-22614

    07/02/2019, 9:29 PM
    message has been deleted
  • h

    high-translator-22614

    07/02/2019, 11:31 PM
    I can assume that the answer above about awsx also applies to cloudfx?
    w
    • 2
    • 2
  • h

    high-translator-22614

    07/03/2019, 3:55 PM
    ok, just for kicks, i tried doing the initialization of a
    ComponentResource
    in a coroutine wrapped in a
    Task
    and pulumi just hung
    w
    • 2
    • 6
  • b

    bright-orange-69401

    07/04/2019, 8:22 AM
    Hello ! I'm looking at Dynamic Providers in Pulumi (https://pulumi.io/reference/programming-model/#dynamicproviders) and I see that Python isn't yet supported for this feature. Is there any ETA for that ?
  • h

    high-translator-22614

    07/05/2019, 1:20 AM
    Anyone else having trouble with
    FileArchive
    ? I can't give it a zip (created by 7-zip) or a directory
  • h

    high-translator-22614

    07/05/2019, 1:25 AM
    and
    AssetArchive
    says "expected an archive, but source is not an archive"
Powered by Linen
Title
h

high-translator-22614

07/05/2019, 1:25 AM
and
AssetArchive
says "expected an archive, but source is not an archive"
View count: 1