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

    salmon-printer-16080

    12/06/2021, 2:24 AM
    Any modern (less than 1yo) unit testing examples for
    Azure-TypeScript
    ? Having issues with the mocks, and it looks like the examples / docs are quite old. Would be good to have some boilerplate to verify.
  • n

    numerous-printer-41511

    12/06/2021, 3:38 AM
    generally speaking, if I create a resource via Pulumi, then go delete that resource via, say, that AWS console, upon the next run of
    pulumi up
    would I expect that resource to be re-created and all dependent properties/resources updated with new values after that resource’s re-creation?
    b
    e
    • 3
    • 3
  • e

    echoing-activity-32278

    12/06/2021, 11:46 AM
    Hi. Running a service inside AKS. Could I specify some domain name inside the K8s manifest (or Pulumi) so that when the service gets deployed, the domain name get pointed to it?
  • t

    thankful-father-68341

    12/06/2021, 12:44 PM
    Hi Team - I have a quick question - Is there a way I can access Pulumi state (to get the exact ARNs/Configuration) from my application code? for example when I create a DynamoDB it creates a unique ARN, I need that ARN in my application code - What is hte best practice
    l
    l
    • 3
    • 7
  • e

    early-intern-90238

    12/06/2021, 4:01 PM
    I do not understand how to use the Pulumi GKE Cluster AutoProvisioningDefaults, does anyone have an example?
    • 1
    • 3
  • b

    bulky-policeman-29913

    12/06/2021, 5:46 PM
    @here can anyone tell me if there is a supported way to do a stack reference across different pulumi projects? Specifically we are using the AWS S3 backend and each project is in a new directory. Pulumi login though only logs into the active project, I would need to get shared resources from a different one.
    g
    e
    +2
    • 5
    • 19
  • b

    breezy-table-35227

    12/06/2021, 6:30 PM
    Hello, given this note from the docs:
    During some program executions,
    apply
    doesn’t run. For example, it won’t run during a preview, when resource output values may be unknown. Therefore, you should avoid side-effects within the callbacks. For this reason, you should not allocate new resources inside of your callbacks either, as it could lead to
    pulumi preview
    being wrong.
    can anyone let me know the preferred way to create a resource that depends on an output value? Me and my teammates have been trying for days to create resources without this, and always end up with various errors relating to things being an Output instance (we’re using python if it matters)
    r
    • 2
    • 17
  • f

    freezing-sugar-24066

    12/06/2021, 11:45 PM
    If I am using
    acm.getCertificate()z
    for the only purpose of using the
    arn
    to create a CloudFront distribution with an
    cloudfront.DistributionViewerCertificate
    object, but would like the class creating the cloudfront distribution to accept either just a static string
    arn: string
    or an
    arn: Output<string>
    , what’s the cleanest way to go about that? (I believe one can pass in strings to Output<string> but am only 92% sure). I think I’ve got it right that I can do this so that Pulumi understands the dependency graph:
    const gcResult = await acm.getCertificateOutput({ domain })
    
    new aws.cloudfront.Distribution('api-cloudfront', {
      ...
      viewerCertificate: gdResult.apply(r => ({
        acmCertificateArn: r.arn
      })),
      ...
    })
    But how do I wrap the
    new()
    in a class that accepts
    Input<string>
    instead of
    Input<acm.GetCertificateResult>
    , since I don’t need to depend on the whole object and don’t want to write a class that requires passing in an object with all the properties of
    acm.GetCertificateResult
    ?
  • a

    abundant-book-94104

    12/07/2021, 8:03 AM
    Is there a process for helping fix documentation? I've raised an issue, but as I'm hacking around building out our Pulumi assets, I'm happy to contribute, more than adding more issues. Are the API doc's autogenerated from the code?
    g
    • 2
    • 1
  • m

    many-salesmen-89069

    12/07/2021, 8:33 AM
    Hi, just wanted to give quick feedback re
    pulumi stack rm
    . I really wish it didn’t remove files from my repo. I often use this command while developing to make sure I’m starting with a clean slate and it always removes my config file which if I’m lucky I have in git history, except now…
    💯 2
    m
    g
    • 3
    • 4
  • f

    future-daybreak-16512

    12/07/2021, 9:35 AM
    I've posted the question on #python channel originally, for greater reach posting the same here : Getting the following error while calling get functions from Pulumi Policy class using Python :
    error: Exception calling application: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.
    The sample code :
    from pprint import pprint
    from pulumi_policy import (
      ReportViolation,
      ResourceValidationArgs,
    )
    import pulumi
    import pulumi_aws as aws
    
    config = pulumi.Config()
    
    def ec2_validator(args: ResourceValidationArgs, report_violation: ReportViolation):
    
      if args.resource_type == "aws:ec2/instance:Instance":
        if args.props.get('vpcSecurityGroupIds'): 
          sg_id = aws.ec2.get_security_groups(tags={
            "key": "val",
            "key": "val",
          })
    
          pprint(vars(sg_id))
    Any idea how to fix this error?
  • c

    colossal-boots-62227

    12/07/2021, 10:18 AM
    Minor bug: if you set
    memory="1 GB"
    for
    aws.ecs.TaskDefinition
    (which is allowed but converted to
    1024
    by ECS) then Pulumi always think that the service needs to be updated
    • 1
    • 2
  • e

    echoing-activity-32278

    12/07/2021, 12:21 PM
    Is it possible to share some config values across different stacks?
  • e

    echoing-activity-32278

    12/07/2021, 12:21 PM
    Especially I want to make every stack use westus2
  • p

    proud-art-41399

    12/07/2021, 2:19 PM
    Is there a way to specify type when setting stack config value? Or at least enforce consistency. Consider these two commands:
    pulumi config set --path 'foo["bar"]' 100
    pulumi -C infra/ config set 'baz' 100
    These result in this stack config:
    test:baz: "100"
    test:foo:
      bar: 100
    i.e. it's a string value for top-level key while it's number for nested key.
    b
    • 2
    • 3
  • d

    dry-motorcycle-32519

    12/07/2021, 2:33 PM
    Hello does anybody knows how to get the connection string for a azure servicebus queue ?
    👍 1
    b
    g
    • 3
    • 4
  • m

    melodic-policeman-41474

    12/07/2021, 2:38 PM
    created my first stack... tried to modify it and get the error below. The resource it has as pending did create so I'm not sure why pulumi refresh doesn't work. Not off to a strong start. Seems kind of clunky to resolve state problems by exporting to a file and then importing. We are using GCP. After I removed the pending resource(nodepool) and imported the export file it created a new node pool instead of updating the node pool I had. Not sure pulumi is ready for primetime on gcp at least. Anyone else successfully using pulumi to manage gcp infra?
    These resources are in an unknown state because the Pulumi CLI was interrupted while
    waiting for changes to these resources to complete. You should confirm whether or not the
    operations listed completed successfully by checking the state of the appropriate provider.
    For example, if you are using AWS, you can confirm using the AWS Console.
    
    Once you have confirmed the status of the interrupted operations, you can repair your stack
    using 'pulumi stack export' to export your stack to a file. For each operation that succeeded,
    remove that operation from the "pending_operations" section of the file. Once this is complete,
    use 'pulumi stack import' to import the repaired stack.
    b
    • 2
    • 12
  • f

    freezing-sugar-24066

    12/07/2021, 3:49 PM
    Does anyone have advice for me on this?
    b
    • 2
    • 2
  • j

    jolly-vr-53742

    12/07/2021, 7:48 PM
    Looking to update an access key and a secret key in an eks configmap via TypeScript. Anyone happen to have a working example?
  • b

    bored-carpenter-17346

    12/08/2021, 2:29 AM
    How to copy a stack from one project to another?
    b
    • 2
    • 17
  • v

    victorious-sugar-42620

    12/08/2021, 3:07 AM
    hey guys, I have a object in my stack with some properties using secrets. For example:
    dev:ACCOUNTS:
      - pass:
          secure: v1:xxxxxxxxx
        user: admin
      - pass:
          secure: v1:yyyyyyyyy
        user: admin2
    What I am trying to achieve is to get this, turn it into JSON and send it to my Node application as a environment variable. The problem is when I do something like this:
    const config = new Config();
    config.requireSecretObject<any[]>('ACCOUNTS').apply(a => JSON.stringfy(a)); // Will produce "[{\"pass\":\"[secret]\",\"user\":\"admin\"},{\"pass\":\"[secret]\",\"user\":\"admin2\"}]"
    JSON.stringfy(config.requireObject('ACCOUNTS')) // Will also produce "[{\"pass\":\"[secret]\",\"user\":\"admin\"},{\"pass\":\"[secret]\",\"user\":\"admin2\"}]"
    I want the secret itself, the only reason I use it as a secret in the stack is to avoid it in plain text in the Github Repo. I have no problems with people being able to see it inside the TaskDefinition (since I am using AWS). How do I achieve this?
    r
    • 2
    • 13
  • v

    victorious-sugar-42620

    12/08/2021, 3:08 AM
    I know that I could use AWS Parameter Store, but I like the stack approach more 😄
  • v

    victorious-sugar-42620

    12/08/2021, 3:09 AM
    Note that if I access the property and call toUppercase on it, it will show me the password but this is kinda useless. What happens under the hood on pulumi side is something like
    pass.toString = () => '[secret]';
  • s

    steep-beach-52652

    12/08/2021, 4:56 AM
    hello, is there a way to tell pulumi to delete the depedent service as well instead of failing
    aws:servicediscovery:PrivateDnsNamespace (xyz):
        error: deleting urn:pulumi:dev::dev::aws:servicediscovery/privateDnsNamespace:PrivateDnsNamespace::xyz: 1 error occurred:
        	* error deleting Service Discovery Private DNS Namespace (ns-54dofue7mzejssxa): ResourceInUse: Namespace has associated services; delete the services before deleting the names
  • s

    square-coat-62279

    12/08/2021, 5:12 AM
    hi all, I am new to both Pulumi and Typescript, I have an application that expose an endpoint for user to upload images, after Pulumi deployed the resources, I'd like to add a small test case to upload a photo (which is also located in the code repo) to that endpoint. Would Pulumi up ignore it since it is technically nothing to do with Pulumi? Here's my code:
    const request = require('request');
            const fs = require('fs');
            const testImage = fs.readFileSync('src/deploys/imageUpload/testImage.txt',{ encoding: 'utf8', flag: 'r' });
    
            request(`http://${props.hosts[0]}/upload`, {
                method: 'POST',
                json: true,
                body: {
                    key: 'somerandomvalue12345',
                    files: testImage,
                },
            });
    the file (src/deploys/imageUpload/testImage.txt) is actually a base64 value text file while the original file is in PNG format.
  • t

    tall-beard-99429

    12/08/2021, 2:16 PM
    Any known problems
    error: failed to decrypt config: [500] Internal Server Error
    on
    update
    b
    • 2
    • 2
  • b

    bulky-policeman-29913

    12/08/2021, 3:27 PM
    Quick probably easy question
  • b

    bulky-policeman-29913

    12/08/2021, 3:29 PM
    If I use a method to get a resource say
    aws.sns.getTopic({name: name})
    and it returns a promise. How exactly do I pass a value like the arn to another resource for use. It's not a pulumi input/output. I would prefer not to have my entire other resource definition created in the promise block
    b
    • 2
    • 3
  • m

    many-dress-54535

    12/08/2021, 3:37 PM
    Hi - anyone tried to create an azure ACR registry with a scheduled task to cleanup images periodically? it would be a task that first gets the list of repositories, then run an acr purge on those registries the command in the documentation is like this:
    # Environment variable for container command line
    PURGE_CMD="acr purge \
      --filter 'samples/devimage1:.*' --filter 'samples/devimage2:.*' \
      --ago 0d --untagged"
    
    az acr task create --name weeklyPurgeTask \
      --cmd "$PURGE_CMD" \
      --schedule "0 1 * * Sun" \
      --registry myregistry \
      --context /dev/null
    I am trying to implement that using https://www.pulumi.com/registry/packages/azure-native/api-docs/containerregistry/task but I couldn't find a way to: • Get the names of the acr repositories at each execution • Pass the command as a string
  • m

    mysterious-battery-54431

    12/08/2021, 6:57 PM
    Hello. I have a Pulumi stack that had a resource and output which have been deleted. For some reason the output remains in the stack, despite that the code is not there to support it. Every time I run
    pulumi up
    it deletes the output, but the output is actually never deleted, and I can see it in the stack in the Pulumi console, or if I run
    pulumi stack output
    . Any ideas about how to surgically remove an output in this scenario?
    r
    • 2
    • 4
Powered by Linen
Title
m

mysterious-battery-54431

12/08/2021, 6:57 PM
Hello. I have a Pulumi stack that had a resource and output which have been deleted. For some reason the output remains in the stack, despite that the code is not there to support it. Every time I run
pulumi up
it deletes the output, but the output is actually never deleted, and I can see it in the stack in the Pulumi console, or if I run
pulumi stack output
. Any ideas about how to surgically remove an output in this scenario?
r

red-match-15116

12/08/2021, 6:59 PM
is it the last output in the stack?
i.e. the only output in the stack
You could try the steps listed here: https://github.com/pulumi/pulumi/issues/8273
m

mysterious-battery-54431

12/08/2021, 7:10 PM
@red-match-15116 yes it was the last output, and the method in the link you added worked - ty!
View count: 1