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
general
  • g

    gentle-diamond-70147

    05/05/2019, 3:59 PM
    @glamorous-printer-14057 Per https://cloud.google.com/sql/docs/mysql/private-ip, it seems that is the way private access is implemented by GCP...
    Private services access is implemented as a VPC peering connection between your VPC network and the Google services VPC network where your Cloud SQL instance resides.
    g
    g
    • 3
    • 2
  • s

    shy-army-45455

    05/06/2019, 4:45 AM
    Trying to import an output from one stack into another and then convert it to a string to be used in an child_process.exec command string. I've tried getting the output using stack.getOutput and then converting to string with val.apply(v =>
    ${v}
    ), but to not avail. Any tips?
  • d

    dry-garden-50738

    05/06/2019, 7:00 AM
    Has anybody else successfully used InversifyJS with pulumi lambdas? I haven’t been able to get it to work due to the native function limitation with serialisation.
  • d

    dry-garden-50738

    05/06/2019, 7:00 AM
    https://github.com/pulumi/pulumi/issues/2704
  • c

    cold-coat-35200

    05/06/2019, 11:48 AM
    hi, I have a weird issue with ignoreChanges, there's a resource in a ComponentResource class:
    const vpc = new aws.ec2.Vpc(
          vpcName,
          {
            cidrBlock: cidrBlock,
            enableDnsHostnames: true,
            enableDnsSupport: true,
            tags: Object.assign(
              {
                Name: vpcName
              },
              args.resourceTags
            )
          },
          { parent: this }
        )
    if I change this to
    const vpc = new aws.ec2.Vpc(
          vpcName,
          {
            cidrBlock: cidrBlock,
            enableDnsHostnames: true,
            enableDnsSupport: true,
            tags: {
              Name: vpcName
            }
          },
          { parent: this, ignoreChanges: ['tags'] }
        )
    and trying to update the stack, I got an error:
    aws:ec2:Vpc (dlv-sbx-vpc):
        error: aws:ec2/vpc:Vpc resource 'dlv-sbx-vpc' has a problem: tags (kubernetes): '' expected type 'string', got unconvertible type 'map[string]interface {}'
     
      pulumi:pulumi:Stack (dliver-dlv-sbx):
        error: Running program '/home/ncsibra/dev/prmrgt-infra/pulumi/dliver' failed with an unhandled exception:
        Error: invocation of aws:ec2/getVpc:getVpc returned an error: transport is closing
            at monitor.invoke (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/@pulumi/pulumi/runtime/invoke.js:74:33)
            at Object.onReceiveStatus (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:1205:9)
            at InterceptingListener._callNext (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:568:42)
            at InterceptingListener.onReceiveStatus (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:618:8)
            at callback (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:845:24)
    This resource has a tag, added by EKS, something like
    <http://kubernetes.io/cluster/dlv-sbx-cluster-eks-197239a|kubernetes.io/cluster/dlv-sbx-cluster-eks-197239a>: shared
    , this tag not exist in pulumi code, because vpc created first, then EKS, so unable to add it from pulumi, but after a refresh, pulumi tries to remove that, but that would cause problems with resources handled by kubernetes. So I tried to add ignoreChanges, but looks like it want to do something with the tags anyway and unable to parse it.
    c
    b
    w
    • 4
    • 4
  • t

    tall-librarian-49374

    05/06/2019, 2:33 PM
    Any reason why pulumi/azure v0.18.1 package is not in npm yet?
    s
    w
    • 3
    • 3
  • m

    melodic-kilobyte-405

    05/06/2019, 2:49 PM
    Hi 👋
  • m

    melodic-kilobyte-405

    05/06/2019, 2:49 PM
    Just wonder where I can find example code for deploying a
    golang
    function to
    GCF
  • m

    melodic-kilobyte-405

    05/06/2019, 2:50 PM
    Using
    Typescript
    preferrably
    t
    g
    • 3
    • 7
  • b

    bitter-planet-74603

    05/06/2019, 4:27 PM
    Is there an example of what goes in here https://pulumi.io/reference/pkg/nodejs/@pulumi/gcp/cloudfunctions/#Function-eventTrigger trying to have the trigger be from google's pubsub?
    r
    • 2
    • 2
  • b

    brave-angle-33257

    05/06/2019, 8:16 PM
    i’ve now gotten this error 3 times in the last couple days:
    Diagnostics:
      pulumi:pulumi:Stack (compute-studio-compute-studio-b-stage-eus2):
        error: transport is closing
    is this the host having networking issues? or could this be pulumi related? not seeing any other obvious signs of networking trouble on the host
    w
    t
    • 3
    • 16
  • f

    fierce-dinner-20116

    05/06/2019, 10:06 PM
    Hi, could the homebrew formula be updated to 0.17.10?
    g
    • 2
    • 2
  • p

    proud-tiger-5743

    05/07/2019, 12:22 AM
    Is there an elegant way to reference the AWS SDK in a Lambda callback function? Such as
    const ingestFunction = new aws.lambda.CallbackFunction("processor", {
      role: lambdaRole,
      callback: async event => {
        const s3 = new aws.sdk.S3({ apiVersion: "2006-03-01" });
        const foo = s3.listBuckets((err, data) => {
          return data;
        });
        console.log(foo);
      }
    });
    That function, when run just dumps a huge AWS response object
    t
    w
    • 3
    • 3
  • p

    proud-tiger-5743

    05/07/2019, 12:31 AM
    If I change it to this
    const ingestFunction = new aws.lambda.CallbackFunction("ingestProcessor", {
      role: lambdaRole,
      callback: async event => {
        const AWS = require("aws-sdk");
        const s3 = new AWS.S3({ apiVersion: "2006-03-01" });
        s3.listBuckets((err, data) => {
          console.log(data.Buckets);
        });
      }
    });
    It doesn't log anything - I saw this example - https://github.com/pulumi/examples/blob/master/aws-ts-apigateway/index.ts#L24 - and thought you could reference the SDK that way...but maybe I misunderstood that piece
    w
    • 2
    • 1
  • s

    shy-army-45455

    05/07/2019, 2:02 AM
    I've tried a few different things, but still can't seem to correctly convert an output from another stack into a string using stack.getOutput + val.apply(v =>
    ${v}
    ). Are there any examples on how to do this? I need to get the pure string value so I can use it in a subsequent child_process.exec call.
    w
    • 2
    • 2
  • m

    millions-judge-24978

    05/07/2019, 2:41 AM
    I'm trying to use the new
    pulumi login gs://...
    and running into this error whenever I try to do my first
    pulumi preview
    for the stack:
    error: Could not get signed url for stack location: blob (code=Unknown): to use SignedURL, you must call OpenBucket with a valid Options.GoogleAccessID and exactly one of Options.PrivateKey or Options.SignBytes
    Anyone gotten the GCP bucket state to work yet?
  • f

    future-morning-96441

    05/07/2019, 9:36 AM
    Hi, I'm working on a proof of concept to use Pulumi in our project (AWS, Event Sourced). I'm getting an error on
    pulumi up
    , but I don't really know where to go from there:
    run pulumi up -s dev
    Previewing update (dev):
    
        pulumi:pulumi:Stack reventless-examples-dev running 
        reventless:CommandTopic CustomerCommandTopic  
        aws:sqs:Queue CustomerCommandTopicQueue  
        aws:sns:Topic CustomerCommandTopicTopic  
        pulumi:pulumi:Stack reventless-examples-dev  (node:5748) ExperimentalWarning: queueMicrotask() is experimental.
        aws:sqs:QueueEventSubscription CustomerAggregateSubscription  
        aws:sns:TopicSubscription CustomerCommandTopicSubscription  
        aws:iam:Role CustomerAggregateSubscription  
        aws:iam:RolePolicyAttachment CustomerAggregateSubscription-7cd09230  
        aws:iam:RolePolicyAttachment CustomerAggregateSubscription-32be53a2  
        pulumi:pulumi:Stack reventless-examples-dev  Error: failed to register new resource CustomerAggregateSubscription [aws:lambda/function:Function]: 2 UNKNOWN: failed to compute asset hash: asset path 'node_modules/reventless' is a directory; try using an archive
        pulumi:pulumi:Stack reventless-examples-dev      at Object.registerResource (/home/chris/Projects/reventless-examples/node_modules/reventless/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/runtime/resource.js:114:27)
    The setup is as following: The first project (called "reventless") contains some `componentResource`s (pure javascript) and is versioned in a private git repository. Reventless is required by the second project, stated in
    package.json
    (private repo with access token). This seems to work. Troubles arise, when I use
    npm link
    to develop both projects together. Is there some known issue regarding linked node modules?
    w
    • 2
    • 3
  • b

    better-rainbow-14549

    05/07/2019, 9:51 AM
    i've never had linked modules working either - when pulumi rebuilds the project it ignores the links and uses the filesystem instead
  • g

    gray-elephant-37695

    05/07/2019, 12:43 PM
    It seems as though if I stop an ec2 instance and start it up again, pulumi retains the original public ip / dns even though it has changed and even after doing
    pulumi refresh
    is this a bug?
    w
    • 2
    • 1
  • c

    cold-coat-35200

    05/07/2019, 2:00 PM
    hi, trying to update from aws 0.17.x to 0.18.x without any code change, only depencencies and pulumi tries to recreate my ec2 instances, because something added to ebsBlockDevices by pulumi:
    ++aws:ec2/instance:Instance: (create-replacement)
                    [id=i-05c0e1f10f4f3799c]
                    [urn=urn:pulumi:sbx-app::etcd-clusters::Etcd:EtcdCluster$Etcd:EtcdNode$aws:ec2/instance:Instance::etcd3-ec2Node]
                  ~ ebsBlockDevices    : [
                      ~ [0]: {
                              + __defaults         : []
                            }
                      ~ [1]: {
                              + __defaults         : []
                            }
                    ]
                +-aws:ec2/instance:Instance: (replace)
                    [id=i-05c0e1f10f4f3799c]
                    [urn=urn:pulumi:sbx-app::etcd-clusters::Etcd:EtcdCluster$Etcd:EtcdNode$aws:ec2/instance:Instance::etcd3-ec2Node]
                  ~ ebsBlockDevices    : [
                      ~ [0]: {
                              + __defaults         : []
                            }
                      ~ [1]: {
                              + __defaults         : []
                            }
                    ]
    Is this normal?
    w
    • 2
    • 2
  • b

    better-rainbow-14549

    05/07/2019, 2:47 PM
    i believe those __defaults changes wont actually result in deployment changes its some strange artifact of updating the stack
  • b

    better-rainbow-14549

    05/07/2019, 2:47 PM
    i had the same with azure kube cluster, though make sure you're on latest pulumi CLI
  • b

    brave-angle-33257

    05/07/2019, 3:29 PM
    trying to use cross-stack references for first time.. I have my VPC stack that has outputs of the subnet IDs:
    Outputs:
      + public_subnet_ids: [
      +     [0]: "subnet-00c7ed0ec22cb3ce4"
      +     [1]: "subnet-04327ab075a2ae3b3"
        ]
    I’m then trying to pass those into an ALB in another stack:
    const vpc = new pulumi.StackReference(`my-vpc/${env}`);
    var alb = new aws.applicationloadbalancing.LoadBalancer(alb_name, {
        name: alb_name,
        subnetMappings: vpc.getOutput("public_subnet_ids"),
        enableCrossZoneLoadBalancing: true,
        enableHttp2: true
    });
    and getting this:
    Diagnostics:
      aws:applicationloadbalancing:LoadBalancer (myapp-alb-stage-alb-main):
        error: aws:applicationloadbalancing/loadBalancer:LoadBalancer resource 'myapp-alb-stage-alb-main' has a problem: subnet_mapping.0: expected object, got string
        error: aws:applicationloadbalancing/loadBalancer:LoadBalancer resource 'myapp-alb-stage-alb-main' has a problem: subnet_mapping.1: expected object, got string
    seems like an Output/String/Promise issue but not sure what I’m doing wrong here
  • b

    better-rainbow-14549

    05/07/2019, 3:32 PM
    in the first part, its probably that vpc.getOutput() is type-inferring to "any" so you're not getting a type error for passing a string[] to subnetMappings
  • b

    better-rainbow-14549

    05/07/2019, 3:33 PM
    ihni what type of object it expects but if you remove the vpc.getOutput() to a variable it might help
    b
    • 2
    • 26
  • e

    early-musician-41645

    05/07/2019, 4:37 PM
    Is there a livesite issue going on?
    $ pulumi up -v9
    Previewing update (my-stack):
    error: [500] Internal Server Error
    c
    • 2
    • 9
  • o

    orange-tailor-85423

    05/07/2019, 9:14 PM
    Any updates on state import? This will become important pretty soon for us
    g
    • 2
    • 6
  • p

    proud-tiger-5743

    05/08/2019, 12:08 AM
    Is it possible to update the execution role for a lambda function declared inline via the
    awsx
    package?
    w
    • 2
    • 2
  • p

    proud-tiger-5743

    05/08/2019, 12:09 AM
    Similarly - is it possible to change the deployment type of an API endpoint (from
    REGIONAL
    to
    PRIVATE
    ) in
    awsx
    ?
    w
    • 2
    • 2
  • c

    colossal-room-15708

    05/08/2019, 12:00 PM
    Anybody got an example for retrieving an azure storage account SAS token in python? This here doesn't work.
    sas_token = storage.GetAccountSASResult(
        connection_string=storage_account.primary_connection_string,
        https_only=False,
        resource_types=(
            service=False,
            container=False,
            object=True
        ),
        services=(
            blob=True,
            queue=False,
            table=False,
            file=False,
        ),
        start="2019-01-30",
        expiry="2028-03-21",
        permissions=(
            read=True,
            write=False,
            delete=False,
            list=False,
            add=False,
            create=False,
            update=False,
            process=False
        )
    )
    • 1
    • 4
Powered by Linen
Title
c

colossal-room-15708

05/08/2019, 12:00 PM
Anybody got an example for retrieving an azure storage account SAS token in python? This here doesn't work.
sas_token = storage.GetAccountSASResult(
    connection_string=storage_account.primary_connection_string,
    https_only=False,
    resource_types=(
        service=False,
        container=False,
        object=True
    ),
    services=(
        blob=True,
        queue=False,
        table=False,
        file=False,
    ),
    start="2019-01-30",
    expiry="2028-03-21",
    permissions=(
        read=True,
        write=False,
        delete=False,
        list=False,
        add=False,
        create=False,
        update=False,
        process=False
    )
)
error:
error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/home/david/.pulumi/bin/pulumi-language-python-exec", line 85, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
        return future.result()
      File "/home/david/.local/lib/python3.6/site-packages/pulumi/runtime/stack.py", line 34, in run_in_stack
        Stack(func)
      File "/home/david/.local/lib/python3.6/site-packages/pulumi/runtime/stack.py", line 93, in __init__
        func()
      File "/home/david/.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/lib/python3.6/runpy.py", line 275, in run_path
        mod_name, mod_spec, code = _get_main_module_details()
      File "/usr/lib/python3.6/runpy.py", line 219, in _get_main_module_details
        return _get_module_details(main_name)
      File "/usr/lib/python3.6/runpy.py", line 153, in _get_module_details
        code = loader.get_code(mod_name)
      File "<frozen importlib._bootstrap_external>", line 781, in get_code
      File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "./__main__.py", line 41
        service=False,
               ^
    SyntaxError: invalid syntax
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
works in nodejs btw
Okay, might stick to nodejs then for now. Can't figure this out in python
all good in nodejs. Python is weird.
View count: 1