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

    victorious-helmet-11068

    04/28/2020, 6:49 AM
    mhmhm.. I think I’ll mix languages in our pipeline deploy. Really don’t want to reinvent the wheel 😄
    👍 1
    f
    • 2
    • 1
  • w

    worried-plastic-45846

    04/28/2020, 6:20 PM
    Hello, When creating a lambda from a local zip file, I can pass the hash of my file in the parameter
    source_code_hash
    . This way, the lambda is updated when my zip file changed. When creating a lambda from a zip hosted on an S3 Bucket, how can I calculate the hash of the remote file?
    c
    • 2
    • 2
  • g

    gray-tailor-20387

    04/29/2020, 10:38 AM
    Anyone here succesfully imported existing resources into pulumi? Right now i'm using this attribute once to read the existing resource from the cloud.
    opts= pulumi.ResourceOptions(id= 'id_of_the_fm'),
    Then i comment out the line and try to add all attributes to be the same to the current state. (can't add some like status= 'active'). Up until now i keep getting a replacement of my resource, which i don't want when importing running vm's. Thanks in advance for reading.
    w
    • 2
    • 1
  • s

    sparse-state-34229

    04/29/2020, 3:59 PM
    haven’t done it but what you’re describing doesn’t match https://www.pulumi.com/docs/guides/adopting/import/
  • s

    stocky-businessperson-72617

    04/30/2020, 5:51 PM
    Do Pulumi has pagerduty Api, so we can create pagerduty service, integration from Pulumi?
    g
    • 2
    • 1
  • a

    agreeable-angle-1483

    05/02/2020, 7:00 PM
    anyone has an idea?
    s
    • 2
    • 2
  • g

    gray-tailor-20387

    05/04/2020, 9:16 AM
    How do I trasnform a pulumi.Output[str] to a str? Would like to manipulate and use the stringvalue in my code
  • g

    gray-tailor-20387

    05/04/2020, 9:22 AM
    Think it's with
    __getattribute__
    from the Output class
  • n

    nutritious-shampoo-16116

    05/04/2020, 10:53 AM
    @gray-tailor-20387 you can use .apply() to the output attribute you want to use and pass a callback (or a lambda)
    👍 1
  • n

    nutritious-shampoo-16116

    05/07/2020, 10:05 AM
    is there anybody that is unit testing stacks? I started today but I am flooded with deprecation warnings?
    w
    • 2
    • 5
  • e

    echoing-breakfast-73834

    05/08/2020, 7:12 PM
    Does anybody have issues with pylint complaining about
    no-member
    on all ids? Intellisense works just fine but pylint doesn't like it
    👍 1
    w
    • 2
    • 1
  • g

    gray-tailor-20387

    05/10/2020, 1:56 PM
    Does anyone know a prettier way to write this?
    private_network_1.__getattribute__('id').apply(lambda id : id + '')
    Basically need the string value, but only getting it by applying lambda above
  • s

    sparse-state-34229

    05/10/2020, 7:40 PM
    i think
    private_network_1.apply(lambda network: str(network.id))
    or something similar?
    g
    • 2
    • 2
  • s

    sparse-state-34229

    05/10/2020, 7:44 PM
    more generally, you probably would want to use
    getattr()
    over
    ___getattribute___()
    👍 1
    g
    • 2
    • 3
  • h

    hallowed-scooter-54575

    05/10/2020, 9:13 PM
    Hello .. I'm just getting started working with Pulumi in Python. I'm just trying to create an S3 bucket website per the tutorial https://www.pulumi.com/docs/tutorials/aws/s3-website/ but porting to Python. But as soon as I do
    site_bucket = s3.Bucket('my-site-name', website={'indexDocument': 'index.html'})
    and
    pulumi up
    (which succeeds)
    pulumi up
    won't work again
    Diagnostics:
      aws:s3:Bucket (my-site-name):
        error: preparing urn:pulumi:my-site-name::my-site-name::aws:s3/bucket:Bucket::my-site-name's old property state: expected string or JSON map; got <nil>
    ... anybody see what I'm missing here?
  • h

    hallowed-scooter-54575

    05/10/2020, 10:51 PM
    found a workaround .. downgrade to
    pulumi-aws==2.2.0
    .. the break seems to be in 2.3 https://pulumi-community.slack.com/archives/CRH5ENVDX/p1588874105127500
  • b

    bland-lamp-16797

    05/11/2020, 2:02 PM
    I think get_output is little misleading here. I'm getting Output class even if I put fake name output. I'm still figuring out why I can't print output from another stack 😞
    n
    w
    s
    • 4
    • 18
  • g

    gray-tailor-20387

    05/12/2020, 9:41 AM
    Hey everyone, I tried adding the pulumi-docker package to my existing python project: added following line to requirements.txt:
    pulumi-docker>=2.0.0,<3.0.0
    Then I installed requirements:
    pip3 install -r requirements.txt
    It seemed to find and install the package fine, and
    pip3 list
    shows "pulumi-docker 2.1.0" but now when i try to use
    import pulumi_docker as dock
    I get following error:
    ModuleNotFoundError: No module named 'pulumi_docker'
    I feel like I'm missing something stupid, does anyone know what? edit: I work in a venv like the website suggested
    b
    g
    • 3
    • 6
  • g

    gray-tailor-20387

    05/12/2020, 9:51 PM
    I've just messed with the pulumi-docker library, my initial hope was to create a cloud vm with docker installed /w Pulumi and then also with pulumi specify the container and command to run in docker on that vm. So far I've got the impression that's not possible, am I right? Going to bed right now, won't answer 'till tomorrow, thanks in advance for reading.
    g
    • 2
    • 1
  • c

    chilly-hairdresser-56259

    05/13/2020, 8:01 PM
    Hello, I am building out a/n AWS VPC with Pulumi and am seeing a strange issue with how pulumi "thinks" Network Acl Rules need to be replaced, specifically it states that the change is in the Rule action, however the Rule Actions are statically assigned. An example would be the following. 
    
    acl_rules = [
        {
            "resource_name": "privateInboundDynamic",
            "egress": "True",
            "from_port": "1024",
            "to_port":"65535",
            "protocol": "6",
            "cidr_block": "0.0.0.0/0",
            "rule_number": "10",
            "network_acl_id": privateACL.id,
            "rule_action": "Allow"
        },
        {
            "resource_name": "privateOutboundUdpDns",
            "egress": "True",
            "from_port": "53",
            "to_port":"53",
            "protocol": "17",
            "cidr_block": "0.0.0.0/0",
            "network_acl_id": privateACL.id,
            "rule_number": "20",
            "rule_action": "Allow"
        }
    ]
    
    for x in range(0, len(acl_rules)):  
        print("[INFO] DEBUG -> %s" % str(acl_rules[x]))
        aws.ec2.NetworkAclRule(
            resource_name=acl_rules[x]['resource_name'], 
            cidr_block=acl_rules[x]['cidr_block'], 
            egress=acl_rules[x]['egress'], 
            from_port=acl_rules[x]['from_port'], 
            network_acl_id=acl_rules[x]['network_acl_id'], 
            protocol=acl_rules[x]['protocol'], 
            rule_action=acl_rules[x]['rule_action'], 
            rule_number=acl_rules[x]['rule_number'], 
            to_port=acl_rules[x]['to_port']
        )
    
    Review Of changes with plum preview:
    +-  ├─ aws:ec2:NetworkAclRule  publicOutboundDynamic     replace     [diff: ~ruleAction]
    g
    • 2
    • 9
  • w

    white-balloon-205

    05/14/2020, 4:14 PM
    Cross-posting here as this will likely be of interest to all the #python users in this channel! https://pulumi-community.slack.com/archives/CB36DSVSA/p1589472786196600
    📝 1
    👍 2
    💯 3
    c
    • 2
    • 3
  • c

    chilly-hairdresser-56259

    05/15/2020, 7:16 PM
    Anyone running into issues with iam.SamlProvider.Id? In the docs it states it returns the arn, I also have tried, iam.SamlProvider.arn. The error is that is it an invalid/malformed Principal ID for the Federated Identity. EDIT: I assume the issue is that "federated_identity" is a class object instead of an actual string. Not sure how to get around this.
    main.py
    f
    • 2
    • 20
  • b

    bulky-match-1583

    05/20/2020, 5:33 PM
    Beginners question. I'm trying to get a gcp project
  • b

    bulky-match-1583

    05/20/2020, 5:34 PM
    filter = 'project_id:{} AND labels.somelabel:true AND lifecycleState:ACTIVE'.format(project.project_id)
    gcp_project = gcp.projects.get_project(filter=filter)
  • b

    bulky-match-1583

    05/20/2020, 5:34 PM
    this doesn't work as project.project_id is not a string
  • s

    sparse-state-34229

    05/20/2020, 5:34 PM
    it’s an
    Output
    ?
  • b

    bulky-match-1583

    05/20/2020, 5:35 PM
    i'v also tried filter = pulumi.Input.concat("project_id:", project.project_id, " AND labels.cspaas:true AND lifecycleState:ACTIVE")
  • b

    bulky-match-1583

    05/20/2020, 5:35 PM
    but its also doesn't work as filter expects to be a string
  • b

    bulky-match-1583

    05/20/2020, 5:35 PM
    how can i get the string value from project.project_id?
  • s

    sparse-state-34229

    05/20/2020, 5:36 PM
    message has been deleted
    👍 1
Powered by Linen
Title
s

sparse-state-34229

05/20/2020, 5:36 PM
message has been deleted
👍 1
View count: 1