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

    eager-musician-93270

    12/21/2021, 12:25 PM
    Hi folks! I have a set of resources that are static and should not change on a per-branch basis like AWS Route 53 hosted zones, CDN distribution, custom domain DNS validation etc, and a set of resources that could change on a per-branch basis like databases, API Gateways and their functions, etc. The static resources would be shared by all of the other per-branch stacks. Am I correct to model these two resource sets as at least two separate stacks? Do I need to somehow map a separate
    index.ts
    with my Pulumi code to each of the two sets of stacks?
    g
    • 2
    • 2
  • w

    wide-london-37434

    12/21/2021, 9:01 PM
    Hi everyone, does anyone know how to get the current branch name from my local repo when I am running
    pulumi up
    ? Pulumi clearly has some capabilities here since it saves the commit hash to the service, but I can't find any leads in terms of which package that stuff might live in
    • 1
    • 2
  • f

    fancy-egg-38667

    12/21/2021, 9:22 PM
    where is a link to the API docs?
    b
    • 2
    • 3
  • f

    fancy-egg-38667

    12/21/2021, 9:23 PM
    I just want to browse methods/modules for the golang library
  • f

    fancy-egg-38667

    12/21/2021, 9:23 PM
    nvm found em
  • f

    fancy-egg-38667

    12/21/2021, 10:12 PM
    ( nvm solved it )
  • f

    fancy-egg-38667

    12/21/2021, 10:14 PM
    ok so I have adopted a resource, but I named it poorly and I want to rename it, but it is trying to delete my resource. How do I "unadopt" an aws resource without pulumi šŸ’€ ing it
    r
    • 2
    • 3
  • a

    adorable-match-24864

    12/21/2021, 11:24 PM
    Hey all, I am looking to use the blob API, however in the Azure native it seems like the options are limited compared to the one in Azure Classic? I am trying to use source_uri for creating a blob object. The blob is already in an another Azure account and I have a SAS token to copy it to the new container.
  • f

    fancy-egg-38667

    12/21/2021, 11:51 PM
    hmm, trying to import an autoscaling group, getting an error:
    āÆ pulumi import aws:autoscaling/group:Group platformCoreEcsCluster platform-dev
    Previewing import (dev)
    
    View Live: [redacted]
    
         Type                      Name                    Plan       Info
         pulumi:pulumi:Stack       pulumi-experiment-dev              1 error
     =   └─ aws:autoscaling:Group  platformCoreEcsCluster  import     4 errors
    
    Diagnostics:
      pulumi:pulumi:Stack (pulumi-experiment-dev):
        error: preview failed
    
      aws:autoscaling:Group (platformCoreEcsCluster):
        error: aws:autoscaling/group:Group resource 'platformCoreEcsCluster' has a problem: Invalid combination of arguments: "launch_configuration": one of `launch_configuration,launch_template,mixed_instances_policy` must be specified. Examine values at 'Group.LaunchConfiguration'.
        error: aws:autoscaling/group:Group resource 'platformCoreEcsCluster' has a problem: Invalid combination of arguments: "launch_template": one of `launch_configuration,launch_template,mixed_instances_policy` must be specified. Examine values at 'Group.LaunchTemplate'.
        error: aws:autoscaling/group:Group resource 'platformCoreEcsCluster' has a problem: Invalid combination of arguments: "mixed_instances_policy": one of `launch_configuration,launch_template,mixed_instances_policy` must be specified. Examine values at 'Group.MixedInstancesPolicy'.
        error: Preview failed: one or more inputs failed to validate
    Anyone else ever seen this?
    s
    • 2
    • 1
  • m

    many-apartment-92429

    12/22/2021, 3:49 PM
    Hi guys! I am new to Pulumi and would like to create a script that creates Github repos. The script should not be a part of our available stacks(e.g. it should not be executed as part of ā€˜pulumi up’, but simply by ā€œyarn ts-node script.tsā€). If I understood correctly, one can use LocalWorkspaces for that together with the Github module. So, my code looks like this:
    import { LocalProgramArgs, LocalWorkspace } from "@pulumi/pulumi/automation";
    import * as github from "@pulumi/github";
    const repo2 = new github.Repository(
      "mytest",
      {
        description: "mytest",
        visibility: "internal",
      },
    );
    console.log("Created repo2 repository");
    bit if fails with:
    yarn ts-node scripts/repos/simple_script.ts
    yarn run v1.22.17
    $ /home/seo_infra/node_modules/.bin/ts-node scripts/repos/simple_script.ts
    
    /home/seo_infra/node_modules/@pulumi/pulumi/runtime/settings.js:123
            throw new Error("Program run without the Pulumi engine available; re-run using the `pulumi` CLI");
                  ^
    Error: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
        at requireTestModeEnabled (/home/seo_infra/node_modules/@pulumi/pulumi/runtime/settings.js:123:15)
        at Object.getMonitor (/home/seo_infra/node_modules/@pulumi/pulumi/runtime/settings.js:216:13)
        at Object.registerResource (/home/seo_infra/node_modules/@pulumi/pulumi/runtime/resource.js:213:32)
        at new Resource (/home/seo_infra/node_modules/@pulumi/pulumi/resource.js:217:24)
        at new CustomResource (/home/seo_infra/node_modules/@pulumi/pulumi/resource.js:309:9)
        at new Repository (/home/seo_infra/node_modules/@pulumi/repository.ts:305:9)
        at Object.<anonymous> (/home/seo_infra/scripts/repos/simple_script.ts:39:15)
        at Module._compile (node:internal/modules/cjs/loader:1095:14)
        at Module.m._compile (/home/seo_infra/node_modules/ts-node/src/index.ts:1310:23)
        at Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    error Command failed with exit code 1.
    info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
    Do you have any hints why it fails and how to make it working? Googling a good half of the internet did not help… Adding a local stack with configuration also did not change anything:
    const stack = await LocalWorkspace.createOrSelectStack(args, {
        projectSettings: {
          name: "infra",
          runtime: "nodejs",
          backend: {
            url: `s3://${BUCKET_NAME}`,
          },
        },
        secretsProvider,
        stackSettings: {
          [args.stackName]: {
            secretsProvider,
          },
        },
      });
    The error is still the same. Thank you.
    s
    b
    • 3
    • 6
  • f

    fancy-egg-38667

    12/22/2021, 11:59 PM
    We have a lot of kubernetes deployments and we use Spinnaker to facilitate canary deployments. However, I would LOVE to not have to use Spinnaker. How do other people do canary deployment with Pulumi?
  • s

    sparse-butcher-73713

    12/23/2021, 8:08 AM
    mmmm, I dont do this but sounds like a good use case for labels?
  • a

    able-honey-93860

    12/24/2021, 12:29 AM
    Is there any good documentation regarding self-managed backend? I logged into s3 and followed along the ā€œCreate a New Projectā€ guide under AWS. I am successfully creating the buckets after running pulumi up, however I cannot understand this passphrase issue for the life of me. I understand that using pulumi’s service it does all the management for you, but I want to be self hosted so this is throwing a wrench in all their documentation and I can't really follow along. Current issue running pulumi on windows with python as the language-once successfully running pulumi up, I cannot run any command because it constantly says
    "error: constructing secrets manager of type ā€œpassphraseā€: unable to find either ā€˜PULUMI_CONFIG_PASSPHRASE’ or ā€˜PULUMI_CONFIG_PASSPHRASE_FILE’ when trying to access the Passphrase Secrets Provider; please ensure one of these environments barebones is set to allow the operation to continueā€
    I have tried a number of ways to ā€œsetā€ the passphrase but no luck. First tried setting it locally in my windows environment variables list and then tried
    pulumi config set —secret PULUMI_CONFIG_PASSPHRASE ā€œTestā€
    And yes ā€œTestā€ is the passphrase I used when running pulumi up, just trying to understand how it's all working then I would use something more secure. Along with setting it up before running pulumi up by running
    pulumi stack unit dev —secrets-provider passphrase
    It just continuously gives me the error above after I run any subsequent commands after a successful pulumi up. For instance after creating the bucket I run
    pulumi stack output bucket_name
    and then get the same passphrase error above. I have to be missing something super simple lol. I have deleted everything and redid it multiple times but no luck. I just can't find anything on my own so I appreciate any help!
    b
    s
    s
    • 4
    • 11
  • a

    ancient-shampoo-2049

    12/28/2021, 1:19 AM
    Hello - trying to create AWS codebuild project using github personal access token, but when I log into the AWS console, it doesn't show the project being connected:
    source_credential = aws.codebuild.SourceCredential(resource_name="xxx",
    auth_type="PERSONAL_ACCESS_TOKEN",
    server_type="GITHUB", 
    token="****")
    is the Python I'm using (prior to creating the code build project). Any pointers or references I can look at?
    b
    • 2
    • 5
  • a

    aloof-leather-66267

    12/28/2021, 4:17 PM
    Is there an equivalent to Terraformer for Pulumi, to import all resources at once?
    w
    • 2
    • 3
  • a

    acoustic-church-60550

    12/29/2021, 10:01 PM
    Hello there, I started to learn Pulumi and I'm stuck on the ARM converter - It says "program generation errorsgenerating program for language python: panic recovered during generation: fatal: An assertion has failed" without telling me on which part of my 800 lines of ARM code šŸ™‚ - Where I could start to troubleshoot my template?
    s
    • 2
    • 2
  • a

    acoustic-boots-88794

    12/30/2021, 9:24 PM
    Hey guys, I'm looking for an example on how to deploy a Node JS API on AWS (EC2), can anyone help me get started?
    s
    • 2
    • 1
  • q

    quaint-megabyte-77026

    12/31/2021, 11:08 PM
    Hey guys First of all, I am enjoying Pulumi thank you for that You guys made working with kuberenetes fun for me I have a issue. I think it's a race condition. So basically i have kuberenetes that has deployment and service for postgres, postgres-replication and pgpool. Each of the container have three service and three deployment On the ENV for the deployment i need to use serivce IP that will be created. But the issue is serice resource is stuck cause it's can't connect to any POD and deployment is not created cause it's waiting for service to complete to get the service IP Any direction towards a solution will be greatly appreciated Thank for you time and happy new year
    b
    • 2
    • 1
  • f

    full-sugar-56177

    01/01/2022, 5:33 PM
    Coming from terraform with terragrunt environments, I used to create many small components and as a result many state files. For example an AWS Lambda function would probably have 4-5 different state files one for each resource (IAM Role, ECR Repository, Lambda etc). I am now trying to migrate into Pulumi service and I want to have a better understanding of how pricing works. As I can see each stack contains some metadata resources like
    pulumi:providers:pulumi
    . Does these resources count towards pricing? If so, having an equivalent structure as terragrunt with multiple Projects and stacks per application, it will cost me much more than using a single Project architecture.
    b
    • 2
    • 9
  • s

    swift-ambulance-7102

    01/02/2022, 8:41 PM
    Anyone have a good walkthrough or a good article on creating a component for Pulumi? I have a couple I really would like to create and I am ready to get these out the door.
    b
    • 2
    • 9
  • s

    sticky-exabyte-94099

    01/03/2022, 12:15 PM
    Maybe I should have asked my question in General here šŸ™‚ https://pulumi-community.slack.com/archives/C84L4E3N1/p1641199066239100
  • p

    plain-potato-84679

    01/04/2022, 10:16 AM
    Hi, I'm stuck with an error message, when trying to build a docker image. After it didn't work with my custom Dockerfile, I tried with the example from the pulumi repo (https://github.com/pulumi/pulumi-docker/tree/master/examples/dockerfile-py), but with no luck either. This is the error message I'm seeing:
    error: Program failed with an unhandled exception:
        error: Traceback (most recent call last):
          File "C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin\pulumi-language-python-exec", line 107, in <module>
            loop.run_until_complete(coro)
          File "C:\Users\user\Anaconda3\lib\asyncio\base_events.py", line 587, in run_until_complete
            return future.result()
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi\runtime\stack.py", line 110, in run_in_stack
            await run_pulumi_func(lambda: Stack(func))
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi\runtime\stack.py", line 45, in run_pulumi_func
            await wait_for_rpcs()
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi\runtime\stack.py", line 94, in wait_for_rpcs
            raise exception
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi\output.py", line 161, in run
            value = await self._future
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi\output.py", line 161, in run
            value = await self._future
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi\output.py", line 182, in run
            transformed: Input[U] = func(value)
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\image.py", line 254, in <lambda>
            lambda args: get_image_data(_ImageArgs(*args))
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\image.py", line 237, in get_image_data
            image_args.skip_push,
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\docker.py", line 243, in build_and_push_image       
            build_result = build_image(base_image_name, path_or_build, log_resource, cache_from)
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\docker.py", line 437, in build_image
            docker_build(image_name, build, log_resource, cache_from)
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\docker.py", line 491, in docker_build
            return run_command_that_must_succeed("docker", build_args, log_resource, env=build.env)
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\docker.py", line 599, in run_command_that_must_succeed
            cmd, args, log_resource, report_full_command_line, False, stdin, env)
          File "C:\Users\user\OneDrive - MZ KG\Work\__Projekte\Python\pulumi_infrastructure\gcp_vm_dagster\venv\lib\site-packages\pulumi_docker\docker.py", line 661, in run_command_that_can_fail  
            stderr=subprocess.PIPE, stdin=subprocess.PIPE, encoding="utf-8")
          File "C:\Users\user\Anaconda3\lib\subprocess.py", line 800, in __init__
            restore_signals, start_new_session)
          File "C:\Users\user\Anaconda3\lib\subprocess.py", line 1207, in _execute_child
            startupinfo)
        FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden
        error: an unhandled error occurred: Program exited with non-zero exit code: 1
    I can't make much of the output. Maybe you have an idea?
    b
    • 2
    • 1
  • w

    witty-honey-13693

    01/05/2022, 10:06 PM
    Hi , Can any one share me an example of Pulumi stack in C# to execute an powershell script. I found this one in pulumi documentation but it does execute. https://www.pulumi.com/registry/packages/azure-native/api-docs/resources/azurepowershellscript/
    b
    • 2
    • 1
  • f

    flaky-librarian-26344

    01/07/2022, 2:55 AM
    Hi! I'm working on setting up my first Pulumi project. However, when I try to run "pulumi new aws-python", it says that the pulumi command was not found. Okay, so I reinstall pulumi and pay attention to the feedback I get in Terminal. After listing various casks, it ends with: "/usr/local/Homebrew/Library/Homebrew/brew.rb:15:in `<main>': HOMEBREW_REQUIRED_RUBY_VERSION was not exported! Please call bin/brew directly! (RuntimeError)" .I'm not sure if the issue is that pulumi is installed, but I need to setup the $PATH so that the command pulumi works, or if the issue is that pulumi isn't getting fully installed, in which case, I guess I need to figure out how to call bin/brew directly, or something. I haven't been able to figure out how to do either of those things, so I'd love to get some advice. Thanks!
    b
    g
    • 3
    • 3
  • s

    sticky-exabyte-94099

    01/07/2022, 9:00 AM
    I“m having problems getting redis to work with up... If I run the following code once it is created but the next time I run up I get the following error. [edit] maybe
    var redis = new AzureNative.Cache.Redis("redisCacheBeinni",
    should be
    var redis = new AzureNative.Cache.Redis("redis",
    .. going to try that... [edit2] ok that solved it.. also it took for ever to create this resource and I think I gave up last time before it finished and everything went south from there...
    var redis = new AzureNative.Cache.Redis("redisCacheBeinni", new AzureNative.Cache.RedisArgs
            {
                EnableNonSslPort = true,
                Location = ResourceGroup.Apply(t => t.Location),
                MinimumTlsVersion = "1.2",
                Name = "redisCacheBeinni",
                RedisConfiguration = new AzureNative.Cache.Inputs.RedisCommonPropertiesRedisConfigurationArgs
                {
                    MaxmemoryPolicy = "allkeys-lru",
                },
                ResourceGroupName = ResourceGroup.Apply(t => t.Name),
                Sku = new AzureNative.Cache.Inputs.SkuArgs
                {
                    Capacity = 1,
                    Family = "C",
                    Name = "Standard",
                },
                Tags =
                {
                    { "environment", StackName },
                },
            });
    this is the error...
    error: cannot create already existing resource '/subscriptions/0e96.../resourceGroups/beinni-rg52d042de/providers/Microsoft.Cache/redis/redisCacheBeinni'
    Shouldn“t this be re-runnable? If I need to run this once and then import this resource (don“t know how) that sounds like a bug.. or at least not what I would expect I also see that all other resources are created with a postfix but redis is just created as
    redisCacheBeinni
    in the portal.. And btw its never created in the Pulumi portal either...
    b
    • 2
    • 15
  • q

    quaint-psychiatrist-60421

    01/08/2022, 6:33 AM
    Greetings Programs! Dipping into the pulumi pool ... I have AWS instances being created similar to how we do things in terraform, but now I would like to run an ansible playbook against newly created instances. python: In my app module I use
    instances.append(aws.ec2.Instance(<various_params>))
    for creating instances, and return
    instances
    . I would then like to run ansible (either through subprocess.run() or ansible imports) against newly created resources. This list always contains the total resources, new or existing.
    g
    • 2
    • 2
  • s

    sticky-exabyte-94099

    01/08/2022, 1:35 PM
    Hi I“m trying to setup custom domain for Azure AppService in C# and I“m having problems following these two resources here https://www.pulumi.com/blog/hosting-a-static-website-on-azure-with-pulumi/ and https://github.com/pulumi/examples/tree/master/classic-azure-ts-dynamicresource Both are using a super lengh CDNCustomDomainResource typescript class. I“m not supposed to convert that over to C# before setting this up? Or should I be using something like this https://www.pulumi.com/registry/packages/azure-native/api-docs/cdn/customdomain/ ? #lost!!
    g
    • 2
    • 6
  • s

    sticky-exabyte-94099

    01/09/2022, 3:47 PM
    Now I“m trying to deploy my infrastructure in Azure DevOps and have my code deployed with it. NB. my other issues are still not figured out.. Searching for examples I have found many but this one here uses Blob and FileArchive. What I don“t understand is that it points to "../src/bin/*Debug*/.." How will that work with release? And then I spotted SourceControl on AppService but I find no information on it and can see that I point the service down to the project I want. So can somebody point me some up-2-date information on how to deploy infrastructure and code together? Just like I show done here but with ArchiveFunctionApp OR should I just build and publish my code separately in stages before so for instance a zip is placed in a correct staging directory for pulumi stack to pick it up? Just like this?
    g
    b
    • 3
    • 9
  • m

    most-lighter-95902

    01/10/2022, 5:08 AM
    Can you have unlimited number of projects with Pulumi Team plan?
    b
    • 2
    • 1
  • c

    chilly-plastic-75584

    01/10/2022, 7:28 PM
    I'd appreciate any examples of Go and kubernetes where everything is NOT in a large single main function. I'm trying to break down this giant sucker into smaller pieces to work through if I can and have very limited time to finish this pilot test to see if I can replace a drafted helm chart. Any help would be appreciated as I'll have to go another direction if I can get my plan setup. I have more terraform + helm templating experience than Pulumi. So far I finished setting up a config file with dev input values, and will want to do a deployment + render to yaml in the next day or so. I used kube2pulumi to get started.
    b
    • 2
    • 31
Powered by Linen
Title
c

chilly-plastic-75584

01/10/2022, 7:28 PM
I'd appreciate any examples of Go and kubernetes where everything is NOT in a large single main function. I'm trying to break down this giant sucker into smaller pieces to work through if I can and have very limited time to finish this pilot test to see if I can replace a drafted helm chart. Any help would be appreciated as I'll have to go another direction if I can get my plan setup. I have more terraform + helm templating experience than Pulumi. So far I finished setting up a config file with dev input values, and will want to do a deployment + render to yaml in the next day or so. I used kube2pulumi to get started.
I can't find Pulumi K8 Go v3 option to RenderToYaml either. Is this still pending?
https://www.pulumi.com/docs/guides/adopting/from_kubernetes/#rendering-kubernetes-yaml I did this and it worked to render the deployment. Will look further at this
b

billowy-army-68599

01/10/2022, 7:52 PM
@chilly-plastic-75584 I think you're looking for a ComponentResource https://github.com/pulumi/examples/blob/ca40203279f393c0c159dadcadc97c6007122997/kubernetes-go-guestbook/components/serviceDeployment.go
c

chilly-plastic-75584

01/10/2022, 7:53 PM
Ahhh. Nice. Ok, so i can break pieces up and then put these in the NewDeployment. This would let me create a seperate func for each service so I could potentionally render and test stuff easier later?
b

billowy-army-68599

01/10/2022, 7:54 PM
you can import them as libraries basically, so you can break things apart cleanly
and yes ComponentResources are unit testable\
c

chilly-plastic-75584

01/10/2022, 7:55 PM
Any repo with examples. I'm crunched for time unfortunately and still want to give this a shot over investing more in helm. Anything to jump start would be great. For now even just rendering the yaml and using pulumi as glorified templater would be a step forward šŸ™‚
Oh and with the renderer, is there something I can do to just render and not run deployment itself so I can do comparisons of the helm to this?
I don't mind putting this in github discussions if better too for others to benefit, whatever works. Just gonna have some small questions to work through and need to know the best avenue. thanks!
b

billowy-army-68599

01/10/2022, 7:58 PM
what examples are you looking for specifically?
c

chilly-plastic-75584

01/10/2022, 8:01 PM
• I know terraform, so normally I'd use prebuitl modules. I understand that Pulumi is going to be more hands on right now with the registry being so new. • I want to see a repo with example of breaking services into seperate functions in Go , even better if any unit testing examples included. • I'll want to eventually run in minikube/kind locally, but for now Im just sticking with the shared cluster i have. • I want to run pulumi up and just get the rendered yaml and not try to deploy yet so I can compare the generated yaml to the helm template rendering and make sure I'm on track.
Hopefully that helps. Stepping away. Please feel free to have me post in github so others benefit or just here, whatever is easiest for you pulumi pros šŸ™‚ Right now I'm trying to replace a CI text templating replacement approach with a code driven approach, but for now I'm trying to emulate this exact deployment (it's almost the same as a brand new helm template but has some more security features added).
thanks!
b

billowy-army-68599

01/10/2022, 8:27 PM
unfortunately I won't have the time to put that together, but the component resource example i sent above should be a good starting point
c

chilly-plastic-75584

01/10/2022, 9:03 PM
Ok. That's honestly my biggest point of feedback as a user wanting to adopt . Lots of good examples, but definitely would love to see more including testing patterns. I'll look on github too. I also need to know if I can render the yaml without trying to deploy? I want to preview this but before I trying to deploy. I can't figure out how to do that.
b

billowy-army-68599

01/10/2022, 9:41 PM
renderYamltoDirectory won't do a deploy at all if that helps? only outputs the yaml
c

chilly-plastic-75584

01/10/2022, 10:55 PM
@billowy-army-68599 yes. I mean to get the rendering to run I seem to have to run
pulumi up
. refresh/preview don't seem to render the yaml.
Oh are you saying when I set the provider to have rendertoyaml as an option that overrides actually trying to deploy it?
I think i see. I need to add the renderer to the components not just deployment, looking now as I bet that's it
So far so good. NewRole for example, added
, pulumi.Provider(renderProvider))
and i think this solves the issue
BOOM
worked. I like it! Now at least I can render and mature it from there, just taking a small step to confirm my yaml matches expectations. The Component stuff is a bit deep so I'm going to have to look into this plus Integration/unit testing soon too. Any resources welcomed
@billowy-army-68599 ok, now that I have yaml rendered, any idea on how pass an option to either use the renderer for yaml or go ahead and deploy? I'm going to try using pulumi directly later today so not sure if I can do both since the yaml file target is the managed resource with that provider being set. I'm assuming I can't do both and set a yaml only flag. I'm assuming I'd have to create another provider that is just the k8 target and use a switch to pick which one to pass.
b

billowy-army-68599

01/11/2022, 5:10 PM
the renderyaml option is designed to be used if you're doing something with a gitops executor like flux or argocd
you'd need a second provider to do the deploy directly with pulumi
c

chilly-plastic-75584

01/11/2022, 7:06 PM
I have a new config flag in yaml that is
onlyyaml: true
and when I flip it seems to be correctly identifying the change.
Let me confirm: I can't use pulumi for dual output to yaml, since it's actually managing the yaml like it would any resource. It's not really any type of "Export" but an actual managed resource. As a result I can render like I showed, but when I flip over to deploying to actual k8 I'm not going to be able to render to yaml + deploy at the same time. It's a 1 or the other option, right?
b

billowy-army-68599

01/11/2022, 7:25 PM
correct
c

chilly-plastic-75584

01/12/2022, 6:16 PM
@billowy-army-68599 i put a follow-up in more long-form here to confirm I'm not missing anything else so others benefit. I'll try to post more of that on github since it's visible to all (and myself when I repeat the same questions later šŸ˜‰ )
https://github.com/pulumi/pulumi/discussions/8734
b

billowy-army-68599

01/12/2022, 6:28 PM
okay, I'll take a look when i get a few mins!
View count: 3