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

    quick-painter-61380

    11/29/2021, 6:48 PM
    I'm looking for some more detailed information about using pulumi import. I'm having trouble importing a GCS bucket. I think I have the ID wrong but I'm not sure what I should be using for it. I've tried the name, the URI (gs://<bucket name>), and a URI like https://www.googleapis.com/storage/v1/b/<bucket name>.
    r
    f
    • 3
    • 6
  • w

    witty-honey-13693

    11/29/2021, 11:29 PM
    Hi I am working on a solution to create Resource Group , Functionapp and Storage account and register the Function app endpoint in APIM. Resources are in one subscription whereas APIM is in other subscription. Is there any way to execute the first half of the stack in one subscription and the other half of the stack in another subscription. Any thoughts on this ? When i execute this the stack cannot find the APIM in the subscription. However i can create one APIM which i dont want to do, i just want to utilize the existing one in other subscription.
    • 1
    • 1
  • n

    nice-father-44210

    11/30/2021, 10:37 PM
    Not sure if this is off-topic, but can anyone recommend a CD tool that’s good for authoring/managing pipelines made up of many independently-deployable Pulumi Stacks?
    a
    • 2
    • 2
  • s

    steep-controller-2269

    12/01/2021, 1:16 PM
    Anyone any pointers to figure out the version of a provider? I am trying to bootstrap rancher, and then create a token and run into the error below, and suspect a version difference, as plain terraform is succesful.
    error: [ERROR] getting rancher server version
  • n

    nice-father-44210

    12/02/2021, 2:37 AM
    What’s the correct way to create resources when iterating over a List or Map that is provided as an Output? The Python docs for
    Output::apply
    say the following:
    'func' is not allowed to make resources.
    c
    r
    • 3
    • 8
  • b

    broad-actor-99495

    12/02/2021, 5:29 PM
    on Windows, trying to follow the steps mentioned here in typescript: https://www.pulumi.com/registry/packages/docker/. Since I don't know how to configue TCP access to the docker daemon, I exposed it on tcp://localhost:2375 without TLS in the docker hub parameters. After running pulumi config set docker:host tcp://127.0.0.1:2375/ and setting the DOCKER_HOME envvar, I have the below error. any help?
    Type                       Name                   Status                  Info
         pulumi:pulumi:Stack        xxxxxxxxxxxxxxxxx-dev  **failed**              1 error
     +   └─ docker:index:Container  ubuntu                 **creating failed**     1 error
    
    Diagnostics:
      pulumi:pulumi:Stack (xxxxxxxxxxxxxxxxx-dev):
        error: update failed
    
      docker:index:Container (ubuntu):
        error: 1 error occurred:
            * container failed to be in running state
    SO question related to docker: https://stackoverflow.com/questions/70199313/how-to-use-docker-host-error-during-connect
  • w

    worried-xylophone-86184

    12/03/2021, 1:44 PM
    Hi all ! I am trying out Pulumi and used the S3 backend option for storing state. Now when I want to switch back to the Pulumi managed backend service I get the following traceback whenever I try to login by running
    pulumi login <https://app.pulumi.com>
    error: problem logging in: getting user info from <https://app.pulumi.com>: unmarshalling response object: invalid character '<' looking for beginning of value
    Any help would be appreciated
    b
    • 2
    • 1
  • a

    acceptable-notebook-17653

    12/03/2021, 7:40 PM
    Hello everyone! At my company we are evaluating Pulumi to help us manage kubernetes infrastructure on multiple clouds. We are just starting out! One thing we are trying to get straight in our minds is the Project and Stack relationship and practices the community follow. From reading through the documentation, we want to create a project and then add stack’s to that project. I am curious and wondered if anyone would mind commenting on how they setup up and organise their
    project
    and
    stack
    . We are using pulumi version v3.19.0 Thanks
    g
    b
    • 3
    • 27
  • s

    sticky-dress-65732

    12/05/2021, 1:59 PM
    Hi, everyone. Is it possible to use existing TF modules from Pulumi? I’m not talking about accessing TF states or managing existing resources, I refer to reusing our own modules we’ve developed internally to manage AWS resources. Thanks in advance
    b
    • 2
    • 1
  • a

    adamant-mechanic-40684

    12/06/2021, 8:55 PM
    hello! I'm trying out pulumi and im trying to change one of the fargate awsx tutorials to use ec2. but im getting stumped 😢
    import * as awsx from "@pulumi/awsx";
    
    const lb = new awsx.lb.NetworkListener("loadbalancer", { port: 80 });
    
    // Need explicit cluster bc we have to define ec2 autoscaling group
    const cluster = new awsx.ecs.Cluster("ec2-cluster");
    
    cluster.createAutoScalingGroup("ec2-cluster-asg", {
      templateParameters: { minSize: 2 },
      launchConfigurationArgs: { instanceType: "t2.nano" },
    });
    
    // Will build our app image and push to ECR
    const appImage = awsx.ecs.Image.fromPath("app-docker-image", "./app");
    
    const appService = new awsx.ecs.EC2Service("app", {
      cluster,
      taskDefinitionArgs: {
        containers: {
          app: {
            image: appImage,
            portMappings: [lb],
            memoryReservation: 256,
          },
        },
      },
      desiredCount: 2,
    });
    
    export const url = lb.endpoint;
    When I go to
    pulumi up
    I get an error creating the autoscale group cloudformation stack
    error waiting for CloudFormation Stack creation: failed to create CloudFormation stack, rollback requested (ROLLBACK_COMPLETE): ["The following resource(s) failed to create: [Instances]. Rollback requested by user." "Property AvailabilityZones cannot be empty."]
    I'm under the impression auto scaling would be using the clusters azs? Not seeing a good place to specify the az either, so I think I'm missing something? Any help would be much appreciated!
    b
    • 2
    • 3
  • b

    breezy-painter-29573

    12/06/2021, 11:09 PM
    Originally I posted the question in #python, but loop behaviour probably apply for any language. Hi there! Could you guys please help me to understand why apply from the Output does not work as expected inside a loop?
    def container_definition(image_name, service, env_variables):
        print("service:",service)
        print("env_vars:", env_variables)
        return json.dumps([{
            'name': 'server',
            'image': image_name,
            'networkMode': 'awsvpc',
            'readonlyRootFilesystem': False,
            'essential': True,
            'environment': env_variables,
            ..... Non relevant code continues
        }])
    
    for service in config.common_config['services']:
        env_variables.append({'name': 'SERVICES', 'value': service})
        if service != 'frontend':
            env_variables.append({'name': 'TEMPORAL_CLI_ADDRESS',
                'value': f'{config.common_config["frontend"]["service_name"]}.{config.common_config["dns_namespace"]}'})
        task_definitions[service] = aws.ecs.TaskDefinition(config.common_config[service]['service_name'],
            family=config.common_config[service]['service_name'],
            cpu=config.common_config[service]['cpu'],
            memory=config.common_config[service]['memory'],
            network_mode='awsvpc',
            requires_compatibilities=['FARGATE'],
            execution_role_arn=ecs_task_role.arn,
            task_role_arn=ecs_task_role.arn,
            container_definitions=image.image_name.apply(
                lambda image_name: container_definition(image_name, service, env_variables)),
            tags={
                "Service": "temporal",
            },
            opts=ResourceOptions(depends_on=[log_group]))
    When it is executed for the container_definitions in preview I am seeing env_variables with duplicates and 
    service
     is set to the latest in the list of 
    config.common_config['services']
     . I do believe it is somehow related to the nature of "Promised" Output, but not an expert in Python enough to catch and fix it. TIA! Everything worked properly in the loop until I needed to add image name for ECR 😄
    b
    • 2
    • 4
  • b

    billions-hospital-77217

    12/08/2021, 1:15 AM
    I'm going crazy trying to implement InstanceRootBlockDevice for EC2 and I cannot figure out the syntax to properly pass this into an EC2 Instance using C# Currently trying this:
    var j = new Pulumi.Aws.Ec2.Inputs.InstanceRootBlockDevice {
                DeviceName = "SIKKA_UAT",
                VolumeType = "gp3",
                Tags = {
                    { "Name", "SIKKA_UAT" },
                }
            };
    But it's just not the right way to instantiate it (reference is wrong, InstanceRootBlockDevice isn't in Pulumi.Aws.Ec2.Inputs probably)
    b
    • 2
    • 3
  • n

    nice-engineer-43278

    12/10/2021, 8:15 PM
    Hello guys!! I'm having troubles by installing AWS plugin on
    v4.32.0
    version. When I run this it gets me a
    403
    error from the resource URL... So trying with a different version like
    v4.31.0
    works the installation but it doesn't add the command to the PATH so every time that I try to update or create a stack it gets me this error...
    error: no resource plugin 'aws-v4.32.0' found in the workspace or on your $PATH, install the plugin using `pulumi plugin install resource aws v4.32.0`
    b
    • 2
    • 2
  • n

    nice-engineer-43278

    12/10/2021, 8:15 PM
    Some can help me to understant why this is happening?
  • w

    witty-honey-13693

    12/13/2021, 3:34 AM
    Hi All Iam executing the pulumi stack through Az DevOps from docker method. The stack executes successfully when we use "up" command. For example, i delete few resources manually and if they are required to be recreated through pulumi we normally use pulumi up --refresh However with pulumi runner command refresh command is not recognized. How can i cover this scenario to refresh the stack using pulumi runner ?
    w
    • 2
    • 1
  • g

    great-sunset-355

    12/14/2021, 9:52 AM
    Hi, can anyone explain to me how does
    pulumi.ResourceOptions(providers={mapping}
    work? I looked at the type description but it's not helpful and nor is the docstring. Because when the resource is created like this:
    opts = pulumi.ResourceOptions(
                    parent=self,
                                       provider=classic_aws_provider,
                )
    and later on
    opts
    is modified to use
    providers
    parameter
    opts- pulumi.ResourceOptions(
                    parent=self,
                                       providers={'aws':classic_aws_provider, 'aws-native':aws_native_provider},
                )
    Pulumi results in creating
    default
    aws provider and completely ignore
    providers
    p
    • 2
    • 16
  • r

    rapid-byte-24256

    12/14/2021, 11:35 AM
    Hello All, I'm new to pulumi and I'm getting an issue while creating new K8s deployment but I get this issue
    error: the current deployment has 1 resource(s) with pending operations:
    * urn:pulumi:temp-production::test::kubernetes:apps/v1:Deployment::flagship, interrupted while updating
    tried the recommend solution appeared in this error message by applying Pulumi stack export then import after removing pending operation but I get another issue
    error: could not import deployment: [503] Service Unavailable
    , Can anyone help me, please🙏?
  • m

    miniature-window-2464

    12/14/2021, 1:09 PM
    Hello, I tried to deploy an Azure subnet with delegations (the example here is not complete https://www.pulumi.com/registry/packages/azure-native/api-docs/network/subnet/#create-subnet-with-a-delegation) and I get this error when adding the delegations node: error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[]. This is my code:
    const appSubnet = new azure_native.network.Subnet("appSubnet", {
        addressPrefix: "10.1.2.0/24",
        resourceGroupName: resourceGroup.name,
        subnetName: "appSubnet",
        virtualNetworkName: myVirtualNetwork.name,
        delegations: [{
            serviceName : "Microsoft.ContainerInstance"
        }]
    });
    Any ideas of what is wrong? I want to delegate it to Container Instances service. Thank you, mauro
    b
    • 2
    • 3
  • s

    swift-ambulance-7102

    12/14/2021, 4:31 PM
    In regards to Outputs, is there a good way other than doing an IF statement to create to have an Export on my stack but only export the value if the resource is created?
    g
    • 2
    • 2
  • f

    fresh-solstice-91936

    12/14/2021, 11:33 PM
    I'm trying to manually create an aws lambda function: index.ts:
    const testLambda = new aws.lambda.Function("testLambda", {
      code: new pulumi.asset.AssetArchive({
        ".": new pulumi.asset.FileArchive("./handler"),
      }),
      role: iamForLambda.arn,
      handler: "handler.handler",
      runtime: "nodejs14.x",
      environment: {
        variables: {
          foo: "bar",
        },
      },
    });
    handler/handler.ts:
    export const handler = () => {
      console.log("meow");
    }
    this fails with:
    "errorType": "Runtime.ImportModuleError",
      "errorMessage": "Error: Cannot find module 'handler'\nRequire stack:\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
    I'm sure I'm just referencing the handler wrong, but I've tried a few different things and can't figure it out lol.
    g
    • 2
    • 7
  • s

    swift-pharmacist-99893

    12/15/2021, 6:23 AM
    How can I have a secret at my unit tests? What I mean is if I have the code
    Config().get_secret('secret_here')
    how can I setup
    PULUMI_CONFIG={ "project:secret_here": "..." }
    ?
  • r

    refined-guitar-81055

    12/15/2021, 12:52 PM
    Hi there - new to Pulumi and struggling with Slack at the moment so please excuse this message (cant seem to format it very well) I have created a Visual Studio solution with two projects. Deployment is a C# Pulumi project with the necessary code to create a Resource Group in Azure. If i run Pulumi up this works as expected. So far so good! The second project - Infrastructure, is basically an empty project (C# class library) which will hold further code in due course. I have an azure-pipelines.yml file in the solution at the same level as the projects i.e. not within the Deployment project. This is all within a GitHub repo which is connected to Azure DevOps. The DevOps library holds the details for the service principal (connection to azure subscription) and the pulumi access token details. It also has the stack name and working directory details. When I run the pipeline I get the following error: ##[error]Error: There was an error when attempting to execute the process 'D:\a\_temp\aa8550c9-81e6-4520-a3ab-bbac6a308c44\pulumi\bin\pulumi.exe'. This may indicate the process failed to start. Error: spawn D:\a\_temp\aa8550c9-81e6-4520-a3ab-bbac6a308c44\pulumi\bin\pulumi.exe ENOENT From what I can see i assume Pulumi is correctly installing on the agent (returning version number) and I'm assuming that the working directory is incorrect but for the life of me I cant work out what the correct value should be! Any advice please. Martyn
    w
    • 2
    • 3
  • s

    swift-ambulance-7102

    12/15/2021, 1:02 PM
    Is the Pulumi
    version
    available inside the
    up
    command? I want to add a tag to resources and that tag would be the pulumi version that was used during a deploy.
    s
    • 2
    • 1
  • c

    cool-wall-66940

    12/16/2021, 9:31 AM
    Hi, I am a newbie, who started learning Pulumi. I use DigitalOcean as my cloud provider. I have successfully created Droplets, Project spaces and moved a droplet into a project space, however I am stuck creating an equivalent of an S3 bucket (SpacesBucket). I googled for the error but I can't find a solution. I tried to set the ACCESS keys in pulumi as well as on the DO admin site but without success. Obviously, I am missing something, did somebody have a similar issue/error? Thank you 🙂 For the following code :
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    foobar = digitalocean.SpacesBucket("foobarrandom615243", region="nyc3")
    I get the following error:
    Diagnostics:
      pulumi:pulumi:Stack (pulumispacecreate-dev):
        error: update failed
     
      digitalocean:index:SpacesBucket (foobarrandom615243):
        error: 1 error occurred:
            * Error creating bucket: Spaces credentials not configured
    b
    l
    b
    • 4
    • 19
  • p

    prehistoric-london-9917

    12/16/2021, 10:18 PM
    Any tips on destroying a stack where we’ve lost the passphrase?
  • r

    rhythmic-australia-32204

    12/17/2021, 2:22 PM
    hi Everyone 👋🏻 I’ve tried to use pulumi with ovh (openstack based), it says
    One of 'auth_url' or 'cloud' must be specified
    . I’ve googled this but couldn’t find where to add these variables, any idea?
    b
    • 2
    • 2
  • c

    chilly-plastic-75584

    12/17/2021, 5:28 PM
    I have a local helm template I've rendered. Before I get too deep into helm I want to evaluate Pulumi for creating a common module instead. Here's the piece I'm not clear on. I know I'd need to use remote state for the shared staging environment. For devs locally though I want to be able to run the local docker/k8 definitions and spin up containers and such. I'm not clear on how local dev/testing is handled, so that they aren't needing to store state remotely and just using for free in local context. Any tips on this? Go with K8 + Azure seems promising but need to make I'm not having to maintain local + remote configurations.
    b
    • 2
    • 4
  • q

    quiet-plastic-34312

    12/18/2021, 2:39 PM
    anyone can help me ... im trying a gcp cloud run example to deploy a docker image... there any way to deploy images hosted on dockerhub?
  • e

    elegant-stone-39023

    12/19/2021, 4:42 PM
    TypeError: The "hostname" argument must be of type string. Received an instance of OutputImpl
    - How to get out of it? Thank you.
    b
    • 2
    • 1
  • s

    swift-pharmacist-99893

    12/21/2021, 10:27 AM
    Currently I have a
    s3
    bucket with multiple folders where I hold my stacks/states. Is it possible to use
    StackReference
    to have interdependency between them? How should I login with pulumi in this case?
    b
    • 2
    • 6
Powered by Linen
Title
s

swift-pharmacist-99893

12/21/2021, 10:27 AM
Currently I have a
s3
bucket with multiple folders where I hold my stacks/states. Is it possible to use
StackReference
to have interdependency between them? How should I login with pulumi in this case?
b

billowy-army-68599

12/21/2021, 10:33 AM
is everything in the same s3 backend?
s

swift-pharmacist-99893

12/21/2021, 11:49 AM
Yes, but different folders. Example, • project1 I need to login as:
<s3://mybucket/project1>
• project2 I need to login as:
<s3://mybucket/project2>
b

billowy-army-68599

12/21/2021, 9:34 PM
no that's not possible, the login needs to be the same
s

swift-pharmacist-99893

12/29/2021, 2:08 PM
Thanks for the previous comment, I tried to do myself as follow:
pulumi login <s3://mybucket>
pulumi new aws-python -n project1 # creating stack prod
pulumi new aws-python -n project2 # creating stack prod
But this gives me an error. How should I proceed with local backends and multiple projects and stacks and have the stack reference work?
b

billowy-army-68599

12/29/2021, 8:36 PM
you need to prefix your project and stack, like so: pulumi stack init project1.prod pulumi stack init project2.prod
s

swift-pharmacist-99893

12/30/2021, 2:17 PM
Ok, thank you very much!
View count: 3