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

    mysterious-egg-7415

    11/06/2019, 2:40 AM
    Hi all. I've been working on an integration testing framework for Pulumi code developed in Python: https://github.com/bincyber/pitfall. If you find this project useful, I would love to get your feedback on usability, any bugs encountered, or missing features that you'd like added (eg, support for StackReference).
    🎉 2
    🙌 2
    💯 1
    w
    c
    • 3
    • 3
  • h

    high-morning-18773

    11/07/2019, 12:59 AM
    Looks like when you add an attribute to a cognito pool the pool gets recreated ( all users get deleted this way) . is this how its supposed to work?
  • h

    high-morning-18773

    11/07/2019, 1:02 AM
    here is the code i wrote to create the pool
    appuserpool = aws.cognito.UserPool(
        "app-user-pool-dev",
        name="test-pool-app",
        alias_attributes=["preferred_username"],
        auto_verified_attributes=["email"],
        admin_create_user_config={
            "UnusedAccountValidityDays": 7,
            "AllowAdminCreateUserOnly": True
        },
        schemas=[
            {
                "Name": "email",
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                },
                "DeveloperOnlyAttribute": False,
                "Required": True,
                "AttributeDataType": "String",
                "Mutable": True
            },
            {
                "Name": "userKey",
                "StringAttributeConstraints": {
                    "MinLength": "32",
                    "MaxLength": "32"
                },
                "DeveloperOnlyAttribute": False,
                "Required": False,
                "AttributeDataType": "String",
                "Mutable": True
            },
            {
                "Name": "initialRole",
                "StringAttributeConstraints": {
                    "MinLength": "1",
                    "MaxLength": "256"
                },
                "DeveloperOnlyAttribute": False,
                "Required": False,
                "AttributeDataType": "String",
                "Mutable": True
            }
        ])
    app_client = aws.cognito.UserPoolClient(
        "app_client",
        name="app-app-client",
        generate_secret=True,
        refresh_token_validity=3000,
        user_pool_id=appuserpool.id
    )
  • h

    high-morning-18773

    11/07/2019, 1:02 AM
    first i had initial key when i added initial role pulumi removed and recreated the pool and client key
  • c

    colossal-plastic-46140

    11/08/2019, 3:20 PM
    Hi Folks, I am working on some code to generate what a stack config would look like(for easy importing into pulumi), is it possible to get what the salt/encryption method would be outside of a pulumi program? This way I could import secret configs out of band
    w
    • 2
    • 4
  • h

    high-morning-18773

    11/08/2019, 6:54 PM
    Hello, i have multiple stacks, in a project folder structure is aws/app1 aws/app2 now i want to create some component resource class which can be imported in both stacks. for e.g. network.py ( which configures vpc subnets etc). where should i store that file i know i can store it in a stack and import the file. is it possible to store it at top level in aws/network.py and import that in aws/app1/___main_.py
  • h

    high-morning-18773

    11/10/2019, 10:00 PM
    Answering my own question: I created a python module, installed it with pip and was able to import resources.
  • l

    lemon-planet-35664

    11/13/2019, 5:31 AM
    Hello, newbie here trying to write some unit test similar to this one in python https://www.pulumi.com/blog/testing-your-infrastructure-as-code-with-pulumi/. So i got the test running in pytest and when i tried to assert the output from the s3 bucket that i created, i got a pulumi output object. After some reading it looks like i need to obtain the property using apply but it still doesnt work for me. All i want is to get the id of the s3 bucket that is created :/. Anyone can point me to the right direction?
    w
    m
    • 3
    • 3
  • h

    high-morning-18773

    11/14/2019, 6:21 PM
    not sure what happened but seems like pulumi lost track of rds parameter group
  • h

    high-morning-18773

    11/14/2019, 6:21 PM
    aws:rds:ParameterGroup (testdevapptest):
        error: Plan apply failed: Error creating DB Parameter Group: DBParameterGroupAlreadyExists: Parameter group testdevapprdsparameters already exists
        	status code: 400, request id: xxxxxxx
  • h

    high-morning-18773

    11/14/2019, 6:22 PM
    the parameter group was created when pulumi
    w
    • 2
    • 15
  • b

    better-actor-92669

    11/18/2019, 3:13 PM
    Hi guys. When you set
    pulumi config set gcp:project <your-project-here>
    , how can I then get the value of it?
    config.get("gcp:project")
    doesn't work, even though it is set:
    config:
      gcp:project: some-project-name
    f
    • 2
    • 3
  • m

    mysterious-egg-7415

    11/19/2019, 11:00 PM
    Hi all. Released v0.0.4 of pitfall: https://github.com/bincyber/pitfall/blob/master/CHANGELOG.md. This release includes bug fixes, test helpers for AWS (eg, select a random region for your tests), and more examples (eg, Component Resource, using multiple tests cases with unittest, etc.). As always, your feedback is welcome and appreciated 😁
    ❤️ 4
    👍 4
    🎉 4
    💯 5
  • b

    billowy-laptop-45963

    11/20/2019, 3:57 PM
    what is the state of pulumi's python support vs typescript? Has it caught up?
  • b

    billowy-laptop-45963

    11/20/2019, 4:00 PM
    @mysterious-egg-7415 What does pitfall provide over the regular pulumi integration testing method: https://www.pulumi.com/blog/testing-your-infrastructure-as-code-with-pulumi/#a-basic-integration-test Is the goal to keep everything in python and avoid golang?
    💯 1
    m
    • 2
    • 6
  • b

    billowy-laptop-45963

    11/20/2019, 4:02 PM
    How good is the IDE Intellisense when using python? Do the pulumi libraries have all the appropriate type hints?
  • a

    alert-monitor-28534

    11/22/2019, 8:04 AM
    I'm trying to install "rook-ceph" Helm chart but I think it needs namespace "rook-ceph" and Pulumi creates "rook-ceph-q05648bl" or something like that - how to make it create the namespace without additional ID string?
    from pulumi_kubernetes.core.v1 import Namespace
    from pulumi_kubernetes.helm.v2 import Chart, ChartOpts
    
    ns = Namespace("rook-ceph")
    
    Chart("rook-ceph", ChartOpts(
        "rook-release/rook-ceph",
        version="v1.1.7",
        values={"hostpathRequiresPrivileged": True},
        namespace=ns.metadata["name"]))
  • s

    stocky-spoon-28903

    11/22/2019, 9:53 AM
    Usually this is possible by specifying the name explicitly in options, but I’m not sure about Kubernetes
    w
    a
    • 3
    • 7
  • b

    billowy-laptop-45963

    11/22/2019, 4:20 PM
    Is there a chart somewhere showing feature parity with typescript?
    w
    • 2
    • 1
  • p

    plain-winter-67689

    11/24/2019, 10:46 PM
    Hello I am trying to use Pulumi with GCloud and spanner, I have this setup:
    spanner_instance = spanner.Instance(resource_name='xxx',
                                        num_nodes=1,
                                        project='xxx',
                                        display_name='xxx',
                                        config='regional-europe-west2')
    
    spanner.Database(resource_name='xxx',
                     name='the_database',
                     instance=spanner_instance,
                     project='xxx',
                     ddls=['''CREATE TABLE xxx (
                                id STRING(36) NOT NULL,
                                firstname STRING(100) NOT NULL,
                                lastname STRING(100) NOT NULL
                               ) PRIMARY KEY ()'''])
    It seems that the spanner instance gets created but the database cannot, I am getting this error:
    gcp:spanner:Database (XXX):
        error: Error creating Database: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>
        <html lang=en>
          <meta charset=utf-8>
          <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
          <title>Error 404 (Not Found)!!1</title>
          <style>
            *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(<//www.google.com/images/errors/robot.png>) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(<//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png>) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(<//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png>) no-repeat 0% 0%/100% 100%;-moz-border-image:url(<//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png>) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(<//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png>) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
          </style>
          <a href=<//www.google.com/>><span id=logo aria-label=Google></span></a>
          <p><b>404.</b> <ins>That's an error.</ins>
          <p>The requested URL <code>/v1/projects/XXX/instances/XXX/XXX/databases?alt=json</code> was not found on this server.  <ins>That's all we know.</ins>
    Anyone any tips or ideas? I have tried searching for some example code but the resources seems limited
  • b

    broad-finland-69602

    11/25/2019, 4:13 PM
    Does anybody know if there is a way to have the equivalent of
    .apply(([server, db])
    from TypeScript in Python, instead of
    .apply(lambda args:…)
    or chaining lambdas?
    w
    • 2
    • 2
  • a

    alert-monitor-28534

    11/26/2019, 9:19 AM
    Running `helm install --namespace rook-ceph --name rook-ceph rook-release/rook-ceph`puts
    rook-ceph-operator
    pod to `rook-ceph`namespace, but this Pulumi code puts it in
    default
    namespace and it fails there:
    from pulumi_kubernetes.core.v1 import Namespace
    from pulumi_kubernetes.helm.v2 import Chart, ChartOpts
    
    ns = Namespace("rook-ceph", metadata={"name": "rook-ceph"})
    
    Chart("rook-ceph", ChartOpts(
        "rook-release/rook-ceph",
        version="v1.1.7",
        values={"hostpathRequiresPrivileged": True},
        namespace=ns.metadata["name"]))
    Is there a bug in Pulumi?
    w
    • 2
    • 2
  • a

    alert-monitor-28534

    11/27/2019, 12:04 PM
    I find it funny that the examples here are in some other language than in Python: https://pypi.org/project/pulumi-kubernetes/
    😁 1
    w
    • 2
    • 2
  • c

    clean-engineer-75963

    11/27/2019, 11:41 PM
    I'm trying to use pulumi_aws.ebs.get_volume to fetch a volume. It can't find the volume, so it's raising an Exception, and I can't seem to catch the exception.
    m
    • 2
    • 5
  • b

    bright-orange-69401

    11/28/2019, 10:29 AM
    Is there any doc or example of creating new Pulumi plugins in Python ? I'd be interested in developing a Python provider for a new cloud service
    w
    • 2
    • 1
  • a

    alert-monitor-28534

    11/28/2019, 11:07 AM
    Still continuing on Rook topic, I'd need to create a custom resource for a Ceph cluster but I don't seem to find
    CustomResource
    from Python, I'm trying to create the resource by looking at this example: https://www.pulumi.com/blog/deploy-a-function-app-with-keda/#scaled-object
  • a

    alert-monitor-28534

    11/28/2019, 11:08 AM
    I see there is
    CustomResourceDefinition
    but I'm not sure how to define
    apiVersion
    and `kind`in there 😞
  • a

    alert-monitor-28534

    11/28/2019, 1:25 PM
    Scratch that, found it.
  • a

    alert-monitor-28534

    11/28/2019, 3:14 PM
    I have to run `pulumi up`twice since the `CustomResource`creation fails after using
    Chart
    , how would I make sure that required CRD has been created before Pulumi continues to create the
    CustomResource
    ?
    kubernetes:<http://ceph.rook.io:CephCluster|ceph.rook.io:CephCluster> (ceph-cluster):
        error: creation of resource rook-ceph/ceph-cluster-ko368t5u failed because the Kubernetes API server reported that the apiVersion for this resource does not exist. Verify that any required CRDs have been created: no matches for kind "CephCluster" in version "<http://ceph.rook.io/v1|ceph.rook.io/v1>"
    • 1
    • 1
  • a

    alert-monitor-28534

    11/28/2019, 3:14 PM
    ... or required apiVersion whatever?
Powered by Linen
Title
a

alert-monitor-28534

11/28/2019, 3:14 PM
... or required apiVersion whatever?
View count: 1