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

    little-river-49422

    03/16/2019, 7:39 AM
    redis_connstr = redis.apply(
            lambda redis: "{}.<http://redis.cache.windows.net:6380,password={},ssl=True,abortConnect=False%22.format(|redis.cache.windows.net:6380,password={},ssl=True,abortConnect=False".format(>
                BRANCH, redis)
        )
    and then I use redis_connstr to assign a value to a dict, and it works, i get a real string as a value in the dict
  • p

    proud-artist-4864

    03/16/2019, 8:16 AM
    yup, that would return another “Output” that gets resolved when you pass it as an Input to another pulumi function. Output has __get_item__ and __get_attr__ defined, but not the magic functions that make it an iterable.
  • p

    proud-artist-4864

    03/16/2019, 8:16 AM
    But when you get the dict, are you retrieving the value outside of another pulumi Resource?
  • p

    proud-artist-4864

    03/16/2019, 8:16 AM
    I’m experimenting now 😄
  • p

    proud-artist-4864

    03/16/2019, 8:25 AM
    Hmm, looking at the source for output.apply, it applies the function during pulumi update but not sure I can translate an Oyutput that is a list into a list of Outputs… and even then, not sure how to iterate that list because it will still be awaitable, so needs to be accessed by an async def…
  • p

    proud-artist-4864

    03/16/2019, 8:25 AM
    It’s confusing 😄
  • l

    little-river-49422

    03/16/2019, 11:12 AM
    no, not retrieving the value outside another pulumi resource
  • p

    proud-artist-4864

    03/16/2019, 11:35 AM
    Yup, that’s what I want though 🙂 I wonder if I make a custom resource that takes them as an input… then it should be called when they resolve. Hmmmm… 🙂
  • a

    alert-monitor-28534

    03/20/2019, 6:50 AM
    How can I define more than one
    allowed_address_pairs
    for an Openstack port? This only uses the latest `ip_address`:
    allowed_address_pairs=[{'ip_address': config.kube_service_addresses,
                           'ip_address': config.kube_pods_subnet}]
    w
    s
    • 3
    • 5
  • b

    brief-school-94535

    03/21/2019, 3:38 PM
    does anyone have working GCP GKE python example I could take a look at?
    g
    • 2
    • 4
  • b

    brief-school-94535

    03/21/2019, 8:39 PM
    Getting error
    Traceback (most recent call last):
      File “test.py”, line 6, in <module>
        print(conf.require(‘name’))
      File “/Users/angel/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pulumi/config.py”, line 126, in require
        raise ConfigMissingError(self.full_key(key))
    pulumi.config.ConfigMissingError: Missing required configuration variable ‘dev:name’
        please set a value using the command ‘pulumi config set dev:name <value>’
    -.py
  • b

    brief-school-94535

    03/21/2019, 8:40 PM
    this is the yaml fie that has the config data
    Pulumi_dev_yaml.yaml
  • b

    brief-school-94535

    03/21/2019, 8:42 PM
    the python app is not seeing the name key from my config yaml file
  • i

    incalculable-sundown-82514

    03/21/2019, 8:43 PM
    I don’t see a
    dev:name
    config key in the yaml?
  • b

    brief-school-94535

    03/21/2019, 8:44 PM
    yeah it’s in my yaml
  • i

    incalculable-sundown-82514

    03/21/2019, 8:44 PM
    oh, slack expanded it away
  • i

    incalculable-sundown-82514

    03/21/2019, 8:45 PM
    what’s the output of
    pulumi config
    ?
  • b

    brief-school-94535

    03/21/2019, 8:45 PM
    KEY VALUE name dev gcp:credentials ./cicd_demo_gcp_creds.json gcp:project cicd-workshops gcp:region us-east1 gcp:zone us-east1-b
  • i

    incalculable-sundown-82514

    03/21/2019, 8:46 PM
    did you add this config by editing the yaml or by using
    pulumi config set
    ?
  • b

    brief-school-94535

    03/21/2019, 8:46 PM
    I’ve done both
  • b

    brief-school-94535

    03/21/2019, 8:46 PM
    but added it by file most recently
  • i

    incalculable-sundown-82514

    03/21/2019, 8:47 PM
    hmm
  • i

    incalculable-sundown-82514

    03/21/2019, 8:47 PM
    can you try running
    pulumi config set dev:name dev
    again, then? and then
    pulumi config
    ?
  • b

    brief-school-94535

    03/21/2019, 8:47 PM
    done KEY VALUE name dev gcp:credentials ./cicd_demo_gcp_creds.json gcp:project cicd-workshops gcp:region us-east1 gcp:zone us-east1-b
  • i

    incalculable-sundown-82514

    03/21/2019, 8:48 PM
    huh, that’s weird!
  • i

    incalculable-sundown-82514

    03/21/2019, 8:48 PM
    is your stack or project named
    dev
    ?
  • b

    brief-school-94535

    03/21/2019, 8:48 PM
    yes
  • i

    incalculable-sundown-82514

    03/21/2019, 8:49 PM
    ah, that’s probably it then - you can leave off the
    dev
    namespace in
    pulumi.Config
    if it’s the same as your stack/project.
  • i

    incalculable-sundown-82514

    03/21/2019, 8:49 PM
    conf = pulumi.Config()
  • b

    brief-school-94535

    03/21/2019, 8:49 PM
    Traceback (most recent call last): File “test.py”, line 2, in <module> conf = pulumi.Config() TypeError: __init__() missing 1 required positional argument: ‘name’
Powered by Linen
Title
b

brief-school-94535

03/21/2019, 8:49 PM
Traceback (most recent call last): File “test.py”, line 2, in <module> conf = pulumi.Config() TypeError: __init__() missing 1 required positional argument: ‘name’
View count: 1