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

    elegant-dress-88912

    12/12/2019, 5:29 AM
    yep, it's declaration
  • e

    elegant-dress-88912

    12/12/2019, 5:30 AM
    export requires assignment
  • b

    bored-jackal-93148

    12/12/2019, 5:30 AM
    right … hence
    | undefined
  • b

    bored-jackal-93148

    12/12/2019, 5:30 AM
    no it doesn’t
  • b

    bored-jackal-93148

    12/12/2019, 5:30 AM
    export const foo = undefined
  • b

    bored-jackal-93148

    12/12/2019, 5:30 AM
    let x: string | undefined
  • e

    elegant-dress-88912

    12/12/2019, 5:30 AM
    here you have assignment
  • b

    bored-jackal-93148

    12/12/2019, 5:30 AM
    export x
    will work
  • a

    ambitious-ram-5811

    12/12/2019, 5:30 AM
    I could've sworn
    default(Type)
    was a thing but oh well - just write
    let serviceAccountPrivateKey: pulumi.Output<string>? = undefined
    b
    • 2
    • 1
  • b

    bored-jackal-93148

    12/12/2019, 5:31 AM
    undeinfed is imlicitly assigned
    a
    • 2
    • 2
  • e

    elegant-dress-88912

    12/12/2019, 5:32 AM
    @bored-jackal-93148 I guess
    export x
    works because
    let x: string | undefined
    also assigns default type value
    👍 1
  • a

    ambitious-ram-5811

    12/12/2019, 5:33 AM
    Anyways this is probably better suited for #typescript than #general 🙂
  • b

    bored-jackal-93148

    12/12/2019, 5:33 AM
    sure
  • e

    elegant-dress-88912

    12/12/2019, 5:50 AM
    thanks for you help. I ended up with
    // somewhere in index.ts
    let serviceAccount: TypeOfServiceAccount;
    export let serviceAccountPrivateKey = pulumi.Output("");
    
    if (config.createServiceAccount) {
      serviceAccount = new TypeOfServiceAccount(...)
      const serviceAccountKey = new ...
      serviceAccountPrivateKey = serviceAccountKey.PrivateKey
    }
    So serviceAccount and serviceAccountPrivateKey are global vars and can be used later, private key is exported during declaration, serviceAccountKey is local var in
    if
    block cause I don't need it elsewhere
  • e

    elegant-dress-88912

    12/12/2019, 6:37 AM
    actually, I had to
    let
    only `Output`'s above
    if
    because I can instantiate real objects only inside
    if
    and later usage of declared serviceAccount will cause error 'usage before assignment'
  • a

    adamant-postman-86832

    12/12/2019, 10:32 AM
    any plans to support azure stack providers in the future?
    t
    b
    • 3
    • 6
  • b

    better-actor-92669

    12/12/2019, 11:02 AM
    Hello. Can someone please help me solve the following issue which occurs upon CloudSQL Postgres Instance creation in GCP.
    gcp:sql:DatabaseInstance (cloud_pgsql_main):
        error: Error, failed to create instance smth-pulumi-1-psql-main: googleapi: Error 403: The client is not authorized to make this request., notAuthorized
    Reference to a class: https://github.com/pulumi/pulumi-gcp/blob/d5c103b63474e73b7a0ea0639a6e162be70726ac/sdk/python/pulumi_gcp/sql/database_instance.py#L12 (GCP Python). I use a separate service account to issue pulumi API calls. Both
    $GOOGLE_APPLICATION_CREDENTIALS
    and
    $GOOGLE_CLOUD_KEYFILE_JSON
    are set. I have assigned a CloudSQL Admin Role for this service account. I also tried to make it an owner of the entire project, but it doesn't help. Thank you so much in advance!
  • g

    glamorous-waitress-51149

    12/12/2019, 11:28 AM
    I’m apparently trying to assign Input<string> to Output<string>, how do I go about getting the value. This seems to be something that might have changed with a new release yesterday?
  • g

    glamorous-waitress-51149

    12/12/2019, 11:28 AM
    const databasePassword = config.requireSecret("databasePassword")
  • g

    glamorous-waitress-51149

    12/12/2019, 11:29 AM
    const cluster = new aws.rds.Cluster("default", {
        masterPassword: databasePassword,
  • g

    glamorous-waitress-51149

    12/12/2019, 11:32 AM
    masterPassword
    is
    Input<string>
    but
    databasePasssword
    is
    Output<string>
  • g

    glamorous-waitress-51149

    12/12/2019, 11:32 AM
    i see I could change it to
    config.requireSecret("databasePassword").get()
    but docs suggest not to do this
    b
    t
    w
    • 4
    • 49
  • c

    cool-egg-852

    12/12/2019, 3:27 PM
    Is there anyway to interact with the gcp marketplace through pulumi? For example to install Neo4j?
    g
    • 2
    • 2
  • r

    rhythmic-hair-33677

    12/12/2019, 6:49 PM
    I see there is no
    apply
    method on an instance of
    k8s.apiextensions.CustomResource
    . Is there a workaround to perform an action after the object is applied to the cluster?
  • r

    rhythmic-hair-33677

    12/12/2019, 7:16 PM
    nvm just wrapping the instance in pulumi.output() gets things rolling
  • t

    thankful-optician-22583

    12/12/2019, 8:00 PM
    Hi guys I have a Pulumi EKS question. My situation is this: 1. I have a pod that is running pulumi up within my eks cluster. This pod is associated with a Service Account has IAM Role A. 2. The worker node has IAM Role B
  • t

    thankful-optician-22583

    12/12/2019, 8:00 PM
    How do I make sure pulumi is run with Role A and not Role B?
  • t

    thankful-optician-22583

    12/12/2019, 8:03 PM
    Now should this be automatic? Because the roles are attached to the pod/worker node there is no aws_credentials etc. so this would mean that Pulumi will not be able to view the ./aws/ folder for configs
    a
    • 2
    • 5
  • c

    crooked-jelly-50877

    12/12/2019, 10:14 PM
    I’m trying to use the new E2 machine type on GKE, and getting a google API error. I surmise this is because the E2 machine type is beta, and the underlying terraform provider has to be updated?
    w
    • 2
    • 11
  • b

    breezy-agency-15661

    12/13/2019, 1:47 AM
    I’m looking for a way to set the node runtime for the lambda function when creating the lambda for a scheduled job. If I create the lambda directly, I can do something like this:
    const lambda = new aws.lambda.Function("myfunc", {
            code: undefined,
            role: ";)",
            handler: "index.handler",
            runtime: aws.lambda.NodeJS10dXRuntime
        },
        {}
    );
Powered by Linen
Title
b

breezy-agency-15661

12/13/2019, 1:47 AM
I’m looking for a way to set the node runtime for the lambda function when creating the lambda for a scheduled job. If I create the lambda directly, I can do something like this:
const lambda = new aws.lambda.Function("myfunc", {
        code: undefined,
        role: ";)",
        handler: "index.handler",
        runtime: aws.lambda.NodeJS10dXRuntime
    },
    {}
);
View count: 1