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

    echoing-dawn-86996

    01/05/2021, 2:51 PM
    I'm trying to create log based metrics using this: https://www.pulumi.com/docs/reference/pkg/gcp/logging/metric/ I can't seem to find where the Args classes are coming from. I mean such as:
    MetricBucketOptionsArgs
    MetricMetricDescriptorArgs
    MetricMetricDescriptorLabelArgs
    g
    • 2
    • 1
  • a

    average-school-38756

    01/09/2021, 9:41 PM
    i'm attempting to split a stack into two stacks. For the most part, using the
    _import
    option is working well. One case which is not working is trying to use an existing AWS Lambda function. There is some difference detected in the
    code
    property:
    +   pulumi:pulumi:Stack              hello-dev                     create     1 error
    ...
     =   ├─ aws:lambda:Function           exampleLambda                 import     [diff: +code]; 1 warning
    ...
    aws:lambda:Function (exampleLambda):
        warning: inputs to import do not match the existing resource; importing this resource will fail
    Original code looks like this:
    lambda_.Function("exampleLambda",
        role=lambda_role.arn,
        runtime="python3.7",
        handler='hello.handler',
        code=pulumi.AssetArchive({
            '.': pulumi.FileArchive('./hello')
        })
    )
    State looks like this:
    {
      "4dabf18193072939515e22adb298388d": "0def7320c3a5731c473e5ecbe6d01bc7",
      "assets": {
        ".": {
          "4dabf18193072939515e22adb298388d": "0def7320c3a5731c473e5ecbe6d01bc7",
          "hash": "935cf7f6edab4c54246b65708d75c720b7e47142e4c0d70ed8e7803ec63b4883",
          "path": "./hello"
        }
      },
      "hash": "935cf7f6edab4c54246b65708d75c720b7e47142e4c0d70ed8e7803ec63b4883"
    }
    How can i detect and address the difference detected when
    pulumi up
    is run?
    $ pulumi preview --diff
    ...
    warning: inputs to import do not match the existing resource; importing this resource will fail
        = aws:lambda/function:Function: (import)
            [id=exampleLambda-2775aa5]
            [urn=urn:pulumi:dev::hello::aws:lambda/function:Function::exampleLambda]
            [provider=urn:pulumi:dev::hello::pulumi:providers:aws::default_3_20_0::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
          + code: archive(assets:935cf7f) {
          +     ".": archive(assets:935cf7f) {
                }
            }
    • 1
    • 1
  • e

    echoing-dawn-86996

    01/10/2021, 12:51 PM
    Hey guys! I have a weird issue where
    delete_before_replace=True
    is simply not working. Here is how I do it:
    compute.Instance(
        f"{name}-{zone}",
        # More instance config here
        opts=ResourceOptions(delete_before_replace=True)
    )
    However, pulumi simply ignores it. Each time the resource changes (the name changes), it first creates the new resource, and then deletes the old one. What am I missing here?
    g
    • 2
    • 9
  • f

    flat-appointment-64705

    01/12/2021, 11:17 AM
    Hi there. Need some help managing AKS with pulumi in Python. Ik keep getting the browser sign in when I want to deploy. or preview the cluster.
    • 1
    • 1
  • f

    flat-appointment-64705

    01/12/2021, 11:18 AM
    Untitled
  • j

    jolly-camera-35709

    01/14/2021, 6:55 AM
    Hi guys, I'm trying to get the value of an output from another stack and set it as the value of another variable but couldn't make it work, any suggestion? This is code snippet
  • j

    jolly-camera-35709

    01/14/2021, 6:55 AM
    db_server_fqdn = db_stack.get_output("db_server_fqdn")
    db_server_fqdn_value = db_server_fqdn.apply(lambda db_server_fqdn: db_server_fqdn)
  • j

    jolly-camera-35709

    01/14/2021, 6:56 AM
    I expected a string in db_server_fqdn_value, but when I print it out, it is still <pulumi.output.Output object at 0x7fc00d128da0>
  • b

    brief-wolf-79064

    01/15/2021, 12:19 AM
    Hello, I'm getting an issue when creating an EKS cluster and adding a namespace to it:
    cluster = eks.Cluster('my-cluster')
    namespace = k8s.core.v1.Namespace(
      'foo',
      metadata=dict(name='foo'),
      opts=pulumi.ResourceOptions(provider=cluster.provider)
    )
  • b

    brief-wolf-79064

    01/15/2021, 12:20 AM
    when doing
    pulumi-up
    I get an exception that
    AttributeError: 'str' object has no attribute 'urn'
  • b

    brief-wolf-79064

    01/15/2021, 12:21 AM
    seems like when cluster.provider resolves pulumi is expecting it to be an object of some kind with a urn, but it comes back as a uuid apparently (doing
    cluster.provider.apply(print)
  • a

    agreeable-notebook-88887

    01/15/2021, 6:17 PM
    @here can someone help answer @jolly-camera-35709’s question? I have the same issue. I cannot seem to get the actual string value from a StackReference output.
    b
    w
    • 3
    • 10
  • f

    future-hydrogen-91224

    01/15/2021, 8:37 PM
    Hi - Quite new to Pulumi but not to Python. Trying out examples, logged into pulumi, and when calling pulumi new it tries to create the base project in virtual env. Is it possible to create w/o in a venv? I am installing the pulumi python libs in a virtual machine to begin with and prefer not to work in venv. Perhaps there is a way to call pulumi new w/o venv?
    m
    w
    • 3
    • 5
  • f

    future-hydrogen-91224

    01/15/2021, 8:42 PM
    Thanks for your help!
  • b

    brash-noon-26580

    01/15/2021, 9:47 PM
    Hello! I am new to Pulumi and Python. I'm attempting to implement unit testing but I'm running into an error while running my test
    pulumi.config.ConfigMissingError: Missing required configuration variable 'project:BILLING_ACCOUNT'
        please set a value using the command `pulumi config set project:BILLING_ACCOUNT <value>`
    Could someone point me in the correct direction on the best way to handle this?
    c
    g
    • 3
    • 4
  • b

    bland-lamp-16797

    01/20/2021, 5:07 PM
    did something change in pulumi lib that I
    service_object = pulumi_kubernetes.core.v1.Service.get('whatever')
    returns almost empty Service? All the sudden,
    service_object.status
    is None and I can't figure out why?
    g
    b
    • 3
    • 12
  • h

    helpful-rain-41425

    01/21/2021, 2:32 AM
    Hi all, new to Pulumi & not that great at Python. I am trying to build a few things using azure-nextgen provider and I am having trouble with creating a storage account, then retrieving its account key:
    import pulumi
    from pulumi_azure_nextgen.containerinstance import latest as containerinstance
    from pulumi_azure_nextgen.resources import latest as resources
    from pulumi_azure_nextgen.storage import latest as storage
    
    app_name = "tigstack"
    
    resource_group = resources.ResourceGroup("resourceGroup",
        resource_group_name="rg-syd-dev-{0}".format(app_name),
        location="australiaeast")
    
    account = storage.StorageAccount("storageAccount",
        account_name="grafana",
        resource_group_name=resource_group.name,
        location=resource_group.location,
        sku=storage.SkuArgs(
            name="Standard_LRS"
        ),
        kind="StorageV2")
    
    file_share = storage.FileShare("smbFileShare",
        account_name=account.name,
        enabled_protocols="SMB",
        resource_group_name=resource_group.name,
        share_name="tigstack")
    
    storageAccountKeys = pulumi.Output.all(resource_group.name, account.name).apply(
            lambda args: storage.list_storage_account_keys(args))
    I came up with that where I want to refer to storageAccountKeys later in the code but it doesn't seem to work - i think I don't understand the output.all that well
    w
    • 2
    • 2
  • m

    millions-toddler-84466

    01/25/2021, 6:11 PM
    Is there any good example of a monolith pulumi app? with files split into folders
    w
    • 2
    • 2
  • a

    average-school-38756

    01/26/2021, 3:17 AM
    is there a way to import an existing Docker image? i see that
    pulumi_docker.Image
    doesn't have an "id" value anymore, and using the full
    image_name
    value for
    pulumi.ResourceOptions(import_="")
    still results in a "create" rather than "import" for
    pulumi up
  • c

    chilly-receptionist-94436

    01/26/2021, 8:38 PM
    Just want to be sure that not all of examples in javascript are available in python? I can find quite a lot of examples in javascript, but not in python. Is there any easy way to find same examples in python?
    c
    b
    • 3
    • 12
  • s

    stocky-hair-65085

    01/27/2021, 1:04 PM
    Hi everyone, since upgrading my local installation yesterday, I get an error when trying to deploy. This happing pretty consistently over several local versions of the used providers, pulumi cli and python versions. Has anyone experienced the same problem so far?
    Unbenannt
    n
    • 2
    • 2
  • s

    stocky-hair-65085

    01/28/2021, 2:33 PM
    Hi everyone, is there a general way to generate structured text in pulumi? I have an application running in a Kubernetes container. This application wants it's configuration as a yaml file. The yaml structure needs some input from other pulumi resources (Database Parameters, ...). My current implementation is like this: • Pass all the needed resource outputs to
    Output.all()
    • In a python lambda create a dict with the needed structure. and dump it using
    yaml.dump
    . • This string is passed to Kubernetes Secret which is mounted into the needed pod. I'm not fully happy with this approach because the numbered arguments in the lambda of
    Output.all()
    are error-prone when you have more than a few resources.
    b
    q
    r
    • 4
    • 4
  • s

    sparse-state-34229

    01/31/2021, 8:49 AM
    Can anyone point me to docs on resource lifecycle? Specifically
    create_before_destroy
    . Can't find anything on the site or slack search
    b
    • 2
    • 5
  • e

    elegant-carpet-82808

    02/03/2021, 1:48 AM
    Anyone around here spend any time with the python bindings for the pulumi-azuredevops provider? It seems like either the repository api docs are out of date, or potentially a minor issue with the tfgen bindings w.r.t. Optional parameters.
    c
    • 2
    • 6
  • m

    mysterious-area-77666

    02/09/2021, 8:16 PM
    Anyone pretty familiar with the Vault package and more specifically
    pkiSecret
    ?
    b
    • 2
    • 20
  • r

    red-match-15116

    02/09/2021, 8:25 PM
    message has been deleted
    🙌 1
  • q

    quaint-tailor-52411

    02/10/2021, 9:18 PM
    testing out the next gen azure python sdk. launched a vm. then deleted it from the console. upon running
    pulumi up
    was expecting it to relaunch a vm. but the state diff doesn’t seem to have detected it
  • q

    quaint-tailor-52411

    02/10/2021, 9:21 PM
    had to do a
    refresh
    — is this expected?
    r
    • 2
    • 2
  • i

    incalculable-dream-27508

    02/11/2021, 3:23 PM
    I have a (very abbreviated)
    sec_rule_api = openstack.networking.SecGroupRule(
      "name",
      __opts__=pulumi.ResourceOptions(provider=REGIONS[dc]),
      delete_before_replace=True)
    and with the last line added now I'm getting
    error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/home/user/.pulumi/bin/pulumi-language-python-exec", line 85, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib64/python3.9/asyncio/base_events.py", line 642, in run_until_complete
        return future.result()
      File "/home/user/.local/share/virtualenvs/pulumi-openotp-xju7YdsB/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 83, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/home/user/.local/share/virtualenvs/pulumi-openotp-xju7YdsB/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 35, in run_pulumi_func
        func()
      File "/home/user/.local/share/virtualenvs/pulumi-openotp-xju7YdsB/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 83, in <lambda>
        await run_pulumi_func(lambda: Stack(func))
      File "/home/user/.local/share/virtualenvs/pulumi-openotp-xju7YdsB/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 106, in __init__
        func()
      File "/home/user/.pulumi/bin/pulumi-language-python-exec", line 84, in <lambda>
        coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
      File "/usr/lib64/python3.9/runpy.py", line 285, in run_path
        return _run_code(code, mod_globals, init_globals,
      File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "./__main__.py", line 190, in <module>
        sec_rule_api = openstack.networking.SecGroupRule(
    TypeError: __init__() got an unexpected keyword argument 'delete_before_replace'
    
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
    According to my reading of https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions this should work, right?
  • i

    incalculable-dream-27508

    02/11/2021, 3:40 PM
    Ah, no, I wasn't using it right. It should have been
    sec_rule_api = openstack.networking.SecGroupRule(
      "name",
      __opts__=pulumi.ResourceOptions(provider=REGIONS[dc],
            delete_before_replace=True))
Powered by Linen
Title
i

incalculable-dream-27508

02/11/2021, 3:40 PM
Ah, no, I wasn't using it right. It should have been
sec_rule_api = openstack.networking.SecGroupRule(
  "name",
  __opts__=pulumi.ResourceOptions(provider=REGIONS[dc],
        delete_before_replace=True))
View count: 1