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
getting-started
  • f

    full-king-49894

    04/14/2022, 8:55 PM
    Hi all, super noob question here. I can't find any documentation that describes how the Pulumi file structure should be used with the project it is deploying. Assume I have an existing NodeJS project that implements an API endpoint using a Lambda container and function URL. This project is under Git control and has /.gitignore /README.md /.eslintrc.json /other-typical-root-level-config-files /src /src/lambda.dockerfile /src/handler.js /src/some-other-non-relevant-files /package.json Should I create a pulumi folder and put my pulumi files in there? Since I already have a package.json, is there any issue adding Pulumi's deps to the existing package.json devDependencies object? And if I can do that, can I leave the other Pulumi files in the root, and if so, can I rename Pulumi's index.js to pulumi.js to differentiate from the actual app being deployed?
    m
    a
    r
    • 4
    • 18
  • f

    full-king-49894

    04/14/2022, 8:57 PM
    FWIW, I find the documentation for Pulumi to be very good. Just surprised there is no best-practices section or section that describes how to use it in a real-world project
    b
    • 2
    • 1
  • b

    brash-room-69051

    04/15/2022, 3:02 AM
    Hi Folks, I’ve tried Pulumi for the first time by following the tutorial here. But I used
    Node.js
    app instead, just a simple web server written in
    Express.js
    . Once, I ran
    pulumi up
    and wait until everything finished, I got an error as picture below. Here is my code.
    aws:ecs:Service (app-svc):
        error: 1 error occurred:
        	* creating urn:pulumi:dev::pulumi-nodejs-fargate::awsx:x:ecs:FargateService$aws:ecs/service:Service::app-svc: 1 error occurred:
        	* error waiting for ECS service (arn:aws:ecs:ap-southeast-1:982138089702:service/cluster-37bf9a3/app-svc-358fe7b) to become ready: ResourceNotReady: exceeded wait attempts
    a
    • 2
    • 3
  • b

    bitter-army-70832

    04/15/2022, 3:53 PM
    Hi all, any idea why this is happening on
    pulumi login
    ?
    b
    • 2
    • 1
  • b

    bitter-army-70832

    04/15/2022, 3:53 PM
    pulumi login <https://app.pulumi.com/georgeportillo>                                                                                                                                                                   ──(Fri,Apr15)─┘
    Manage your Pulumi stacks by logging in.
    Run `pulumi login --help` for alternative login options.
    Enter your access token:
    error: problem logging in: getting user info from <https://app.pulumi.com/georgeportillo>: unmarshalling response object: invalid character '<' looking for beginning of value
    m
    b
    • 3
    • 6
  • b

    bitter-army-70832

    04/15/2022, 3:54 PM
    I pasted my access token, copied it just fine, made sure several times but it's still giving me this error.
  • f

    full-king-49894

    04/15/2022, 7:29 PM
    Ok, trying to grok Pulumi outputs. My use-case is creating an AWS CloudFront distribution with a custom OriginAccessIdentity, in NodeJS. I have
    const originAccessIdentity = new aws.cloudfront.OriginAccessIdentity("oai", {
      comment: "Some comment",
    });
    But now I need to dereference the newly created ETag/Id to use in
    ...
      origins: [
        {
          domainName: bucketV2.bucketRegionalDomainName,
          originId: s3OriginId,
          s3OriginConfig: {
            originAccessIdentity: `origin-access-identity/cloudfront/${originAccessIdentity.id}` <=== Does not work
          },
        },
      ],
    ...
    It does not seem possible to simply use
    originAccessIdentity.id
    as the returned value is an object wrapped in pulumi sugar. I have tried all sorts of ways to try and get properties from the returned object including: originAccessIdentity.id originAccessIdentity.get() originAccessIdentity.get("id") originAccessIdentity.id.apply(id=>id) I am following along on https://www.pulumi.com/docs/intro/concepts/inputs-outputs/ as well as using step-through debugging via VSCode to inspect the returned object.
    b
    • 2
    • 41
  • s

    strong-intern-84363

    04/17/2022, 4:02 PM
    Hi, someone in this community interested to participate in a project involving aws/gcp cloud, pulumi and python ? We are looking for a skilled pulumi person that could help us improve our existing pulumi/python code base/skills, either by coaching or by working on a per function basis. Let me know if interested and let’s have a chat about it. Have a nice day.
    b
    • 2
    • 2
  • r

    rhythmic-branch-12845

    04/18/2022, 2:46 AM
    hi, I have some issues with the getting started tutorial. Could somebody help me? https://pulumi-community.slack.com/archives/C84L4E3N1/p1649911995262149
  • b

    brash-room-69051

    04/18/2022, 12:56 PM
    Hi, From this thread, I re-run
    pulumi up
    again but got different error
    aws:ecs:TaskDefinition (app-svc):
        error: 1 error occurred:
        	* failed creating ECS Task Definition (app-svc-e621f050): ClientException: Log driver awslogs requires options: awslogs-region
    I haven’t seen
    logConfiguration
    in example repo or document. How to config it?
  • b

    brainy-church-78120

    04/19/2022, 7:32 PM
    hello wonderful people! @sticky-planet-19341, one of Pulumi's ux designers, will be running some short interviews next week to gather some information to help improve the experience of using Pulumi. we are looking to talk with people who have lots of experience with Pulumi and with folks new to Pulumi, along with people somewhere in the middle. If you have 15 minutes to spare some time next week, please add an emoji to this message or thread a comment, and we will reach out to you to get you scheduled.
    b
    • 2
    • 1
  • s

    strong-intern-84363

    04/19/2022, 11:03 PM
    Hi ! Does someone by any chance have a working example on getting gcp availability zones ? Not sure I understand how to use this function, would welcome any help or live examples. https://www.pulumi.com/registry/packages/gcp/api-docs/compute/getzones/ Managed to get it working on AWS but fighting for GCP.
  • k

    kind-translator-33451

    04/21/2022, 3:37 PM
    Hello everybody nice to discover pulumi. Great idea. Do you know if a book has been edited in order to learn all pulumi functionalities ? Thanks
    b
    l
    • 3
    • 3
  • w

    witty-vegetable-61961

    04/21/2022, 10:34 PM
    Need a memory refresher, but wen I create a stack, do a create the yaml file manually in my project?
    a
    m
    • 3
    • 9
  • b

    bright-horse-50102

    04/22/2022, 3:44 AM
    Hi! I have a statefulset:
    const labels = { appClass: 'app' };
    
    export const appSvc = new k8s.core.v1.Service('app-svc', {
      metadata: {
        labels,
        name: 'app-svc',
      },
      spec: {
        type: 'ClusterIP',
        clusterIP: 'None',
        selector: labels,
      },
    }, {
      provider,
    });
    
    export const interactionsApp = new k8s.apps.v1.StatefulSet('app', {
      metadata: {
        labels,
      },
      spec: {
        serviceName: 'app-svc',
        replicas: 3,
        selector: {
          matchLabels: labels,
        },
        template: {
          metadata: {
            labels,
          },
          spec: {
            imagePullSecrets: [
              { name: registryCredentials.metadata.name },
            ],
            containers: [
              { /* ... */ },
            ],
          },
        },
      },
    }, {
      provider,
      dependsOn: [
        registryCredentials,
        databaseUser,
        redisInstance,
      ],
    });
    I hardcode the service's
    metadata.name
    to
    'app-svc'
    and the statefulset's
    spec.serviceName
    to
    'app-svc'
    as well. While this works, it feels wrong because now the resource name is not managed by pulumi. If I don't specify
    metadata.name
    in the service definition, and pass
    appSvc.metadata.name
    to the statefulset
    spec.serviceName
    , the statefulset is never created.. it waits for the
    appSvc
    to become ready, but the
    appSvc
    will never become ready because the statefulset hasn't been made yet:
    kubernetes:core/v1:Service (app-svc):
      error: 2 errors occurred:
          * resource default/app-svc-4kc42v1c was successfully created, but the Kubernetes API server reported that it failed to fully initialize or become live: 'app-svc-4kc42v1c' timed out waiting to be Ready
          * Service does not target any Pods. Selected Pods may not be ready, or field '.spec.selector' may not match labels on any Pods
    how do I solve this issue? Is hardcoding the service name a good idea?
    l
    b
    • 3
    • 33
  • g

    gray-state-1017

    04/22/2022, 11:56 AM
    I everybody! I have a simple question: I run a pulumi up with tho big charts: the cli is running for more than half an hour now and I would like to do something like a pulumi destroy. I tried logging in with another client and it says I should delete the lock. Is there an easier/faster way to proceed in such cases?
    b
    • 2
    • 21
  • a

    able-bird-91336

    04/23/2022, 6:54 AM
    Hello all! So here is yet another question about
    Output<string>
    from a n00b. :) I have tried reading the q/a given in this Slack, the doc and other blogs but still can't really wrap my head around it. I don't get how to apply (pun) this to my situation. The solution I have today works, but feels wrong. Could somebody give some pointers on how to do this "for real"? The problem: I'm creating a Kubernetes Service "LoadBalancer" and need to get hold of the created IP-adr. I then need to use this IP-adr when creating a ConfigMap using it as data to create a file of it used by a Deployment. (please see code below for what I'm trying to do) The code (simplified, a lot more going on but it is the gist of it):
    // TypeScript & Azure
    myService.status.loadBalancer.ingress[0].ip.apply(hostname => {
          const yamlConfigGroup = new kubernetes.yaml.ConfigGroup(
               "deploymentconfigmap-yml",
               {
                 yaml: `
                 apiVersion: v1
                 kind: ConfigMap
                 metadata:
                   name: deployment-config
                   namespace: kube-system
                   labels:
                     k8s-app: theapp
                 data:
                   thedata.yml: |-
                     thesettings.monitors:
                     - type: mydata
                       hosts: ["${hostname}"]
                 `
               }
             );
    });
    This works but "feels" wrong because it doesn't show the creation in Preview.
    b
    • 2
    • 6
  • i

    incalculable-thailand-44404

    04/25/2022, 12:43 AM
    Hi Folks, any recommended documentation with examples for setting up an AWS RDS cluster with read write RDS instances with Pulumi?
    i
    • 2
    • 3
  • i

    icy-controller-6092

    04/25/2022, 12:56 AM
    The zip file produced by AssetArchive seems to dereference symlinks and replace them with duplicates, which can produce a larger output archive. Is there any way to recreate the
    -y
    symlink-preserving functionality?
    e
    • 2
    • 2
  • w

    wet-carpenter-14925

    04/25/2022, 10:28 PM
    Hello. Does anyone know whether the Pulumi Azure Pipelines Task supports authenticating to Azure KeyVault as a secrets provider via service principal yet? I'm running into the same issues documented here. I see that most people used a workaround that involved embedding service provider credentials in pipeline variables, but I'm hoping that in the past two years maybe the underlying issue has been fixed.
  • i

    icy-controller-6092

    04/26/2022, 5:58 AM
    Has anyone had any recent experience deploying to localstack using Pulumi? I’m looking for a local dev feedback loop to test out mainly API gateway, Lambda & Lambda Layers
  • m

    modern-branch-92818

    04/26/2022, 11:18 PM
    Hello, I'm fairly experienced with Terraform but am diving into Pulumi for the first time and I'm getting tripped on the basics, I'm basically trying to write some inline pulumi config that will deploy an azure storage account container when a user clicks a button on the website:
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const config = new pulumi.Config();
    const location = config.require("location");
    const storageAccountName = config.require("storageAccountName");
    const storageContainerName = config.require("storageContainerName");
    const resourceGroupName = config.require("resourceGroupName");
    const storage = azure.core.getResourceGroup({
        name: resourceGroupName,
        location: location,
    });
    const container = new azure.storage.Container("container", {
        name: storageContainerName,
        storageAccountName: storageAccountName,
        containerAccessType: "private",
    });
    export const containerId = container.id;
    export const containerResourceId = container.resourceManagerId;
    This typescript code snippet was generated using tf2pulumi and I"m confuse about two things: • How do I add provider configuration to this to tell Pulumi which subscription I want to deploy the resource to? • How do I add backend configuraiton to this to tell Pulumi which backend I want to store my state file in (which in this case should be an Azure storage account) I've read through the documentation and can't seem to find the answer to these questions, any assistance would be greatly appreciated
    m
    • 2
    • 21
  • i

    icy-controller-6092

    04/27/2022, 12:04 AM
    if I create a
    new aws.resource.Thing()
    but don’t use it anywhere else, does it still get created? I’m wondering if I need to comment out the
    new
    call, or if I can just comment out the place where it’s used (lambda layer)
    m
    • 2
    • 2
  • i

    icy-controller-6092

    04/27/2022, 4:29 AM
    Is there an API for generating IAM policies? e.g. I have a
    aws.s3.Bucket
    and I want to be able to call
    PutObject
    from a
    aws.lambda.Function
    - is there some kind of helper function where I can pass that in and get back a
    aws.iam.Policy
    ?
    l
    l
    • 3
    • 6
  • a

    ancient-nightfall-54764

    04/27/2022, 7:48 AM
    Hi all. Does anyone know whether the pulumi have command that only run specific resource? suppose I have code pulumi that all infrastructure resource on that, but I just one to run the specific resource like security group. thanks before
    e
    • 2
    • 4
  • c

    crooked-spring-277

    04/27/2022, 4:03 PM
    Has anyone had any luck migrated resources from lets say gcp-classic to google native provider without having all the boxes recreated?
  • w

    wonderful-twilight-70958

    04/27/2022, 8:54 PM
    Once I do
    pulumi login --local
    , how do I re-log back into pulumi hosted cloud? Running
    pulumi login
    just says "logged into local" again 😕
    c
    • 2
    • 2
  • b

    bright-horse-50102

    04/28/2022, 7:28 AM
    Is it possible to hook into the lifecycle of my Pulumi application? E.g. declare functions in my Pulumi codebase that get called on deployment start, on deployment finish?
    l
    e
    • 3
    • 6
  • r

    ripe-pillow-18164

    04/28/2022, 6:51 PM
    Hi, is Pulumi only a provisioning tool (e.g. create a new aws instance with this cloud-init config) or can it also be used as configuration management (e.g. ensure that this folder and file exists, start this systemd unit if not running, etc...)? I can only find examples for the first.
    b
    b
    • 3
    • 4
  • g

    great-arm-54759

    04/29/2022, 5:21 PM
    Hey Folks, how are you? I’m creating an automation API in Go and to test local, I’m trying to use LocalStack S3, but it’s not working. Can anyone help me? Endpoint handler function:
    func CreateHandler(w http.ResponseWriter, req *http.Request) {
    	w.Header().Set("Content-Type", "application/json")
    	var createReq CreatePolicyReq
    	err := json.NewDecoder(req.Body).Decode(&createReq)
    	if err != nil {
    		w.WriteHeader(400)
    		fmt.Fprintf(w, "failed to parse create request")
    		return
    	}
    
    	ctx := context.Background()
    
    	stackName := createReq.Name
    	program := services.CreateStack("gaia-test-policy", "gaia-test-role")
    
    	opts := []auto.LocalWorkspaceOption{
    		auto.Project(workspace.Project{
    			Name:    tokens.PackageName(stackName),
    			Runtime: workspace.NewProjectRuntimeInfo("go", nil),
    			Backend: &workspace.ProjectBackend{
    				URL: "<http://0.0.0.0:4566/project-gaia>",
    			},
    		}),
    	}
    Error Message:
    b
    • 2
    • 5
Powered by Linen
Title
g

great-arm-54759

04/29/2022, 5:21 PM
Hey Folks, how are you? I’m creating an automation API in Go and to test local, I’m trying to use LocalStack S3, but it’s not working. Can anyone help me? Endpoint handler function:
func CreateHandler(w http.ResponseWriter, req *http.Request) {
	w.Header().Set("Content-Type", "application/json")
	var createReq CreatePolicyReq
	err := json.NewDecoder(req.Body).Decode(&createReq)
	if err != nil {
		w.WriteHeader(400)
		fmt.Fprintf(w, "failed to parse create request")
		return
	}

	ctx := context.Background()

	stackName := createReq.Name
	program := services.CreateStack("gaia-test-policy", "gaia-test-role")

	opts := []auto.LocalWorkspaceOption{
		auto.Project(workspace.Project{
			Name:    tokens.PackageName(stackName),
			Runtime: workspace.NewProjectRuntimeInfo("go", nil),
			Backend: &workspace.ProjectBackend{
				URL: "<http://0.0.0.0:4566/project-gaia>",
			},
		}),
	}
Error Message:
b

billowy-army-68599

04/29/2022, 5:23 PM
can you show me the output of
pulumi whoami
?
g

great-arm-54759

04/29/2022, 5:28 PM
Hi @billowy-army-68599, sorry for the question, I’m new to Pulumi, do you want it to run directly from the terminal or via API? If it’s local, it shows my username
b

billowy-army-68599

04/29/2022, 5:29 PM
yes from the terminal
you need to login, i know you've set the backend, but do a login first
g

great-arm-54759

04/29/2022, 5:31 PM
Sure, I tried login but doesn’t work --’, is that correct?
View count: 5