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

    happy-raincoat-89168

    06/23/2022, 7:51 PM
    Hi, I’m doing some exploratory work with pulumi to see if I want to manage EKS/K8S with it in Typescript. I’ve got an example stack where I create a cluster
    const cluster = new eks.Cluster('dev-exp-pulumi', {...cluster settings...});
    and then later on in the file after adding a few other resources I deploy a manifest.
    const provider = new k8s.Provider("provider", {
      kubeconfig: cluster.kubeconfig,
    });
    
    
    const flux = new k8s.yaml.ConfigFile("flux-static", { file: "./files/flux_static.yaml" }, { provider });
    This gives me the following error trying to build the stack from nothing:
    pulumi:pulumi:Stack (pulumi-eks-experiment-dev-exp-pulumi):
        error: TypeError: Cannot read property 'map' of undefined
            at pulumi-eks-experiment/node_modules/@pulumi/yaml/yaml.ts:2993:14
            at processTicksAndRejections (internal/process/task_queues.js:97:5)
    but if I comment out the
    const flux = …
    line and deploy the stack then the cluster is deployed successfully and then if I uncomment the
    const flux = …
    line and run it again, the
    ConfigFile
    is deployed successfully. I suspect it’s something I’m missing with the
    Output<>
    and
    Input<>
    stuff, but the error doesn’t seem to match the code. What’s causing my error?
    👍 1
    b
    • 2
    • 38
  • m

    mysterious-hamburger-19066

    06/23/2022, 9:32 PM
    Hello. I’ve recently started using Pulumi and love it so far. Is it meant to purely set up infrastrucutre, or is it also meant to be used for setting up the environment?
    s
    l
    • 3
    • 4
  • r

    rich-agency-75207

    06/24/2022, 8:26 AM
    Hi. I am using
    Fn::ReadFile
    to pull in a custom kubeconfig (as part of a custom k8s provider definition) Consequently - I need to pull the CA from the active gke cluster. E.G.
    ${xxx.cluster.masterAuth.clusterCaCertificate}
    Does anyone know if it is possible to substitute read data with this. E.G. Include ${scoped gke ca property} in file --> substitute when consuming.
  • r

    rich-agency-75207

    06/24/2022, 8:27 AM
    On a related note - the reason I am using a file is down to an issue using a multi-line yaml string definition:
    kubeconfig: |
      apiVersion: v1
      clusters:
        ...
    This momentarily worked when I defined this way. Then, a few hours later, pulumi cli started to error. i.e. it worked w/o issue but now it does not:
    error: receiver must be a list or object, not nili
    receiver must be a list or object, not nil
    error: an unhandled error occurred: waiting for RPCs: marshaling properties: awaiting input property kubeconfig: runtime error
    • 1
    • 9
  • c

    calm-horse-33012

    06/24/2022, 8:46 AM
    Hi, I'm looking into importing resources into Pulumi, is there a way to make Pulumi show resources currently in the cloud? It is pretty tedious to browse around and find all the right IDs 😅 (Using AWS, but I figure that shouldn't matter?) EDIT: Found a AWS specific answer at least, Tag Editor EDIT2: Crazy thought, would be awesome to be able to do
    pulumi import --tag XXX
    and just have it import all resources with the given tag 🤯
    b
    • 2
    • 7
  • d

    damp-honey-93158

    06/24/2022, 8:55 AM
    another day, another question! I'm using the automation-api and suddenly (yes indeed, queue dramatic music) when I call stack.RemoveStackAsync() - nothing is getting removed (silence, tumble weeds...). The stack in question is still visible in my pulumi services account - and of course the CI/CD pipelines for integration testing are now leaving a looooong list of stacks in their wake. Anyone else seen this? I've tried a simple xUnit test that runs up a localworkspace stack (that uses PreviewAsync) and destroys it - no exceptions are thrown and the stack still doesn't get deleted. any hints / tips appreciated - and have yourself a great day!
    • 1
    • 2
  • l

    loud-carpenter-77875

    06/24/2022, 10:13 AM
    i am very new to pulumi and want to try pulumi-kubernets expriment tried with quickproject and end up with this issue not sure how i can solve this
  • l

    loud-carpenter-77875

    06/24/2022, 10:13 AM
    pulumi😛ulumi:Stack (quickproject-dev): Traceback (most recent call last): File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 49, in run_pulumi_func func() File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 126, in <lambda> await run_pulumi_func(lambda: Stack(func)) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 143, in init super().__init__("pulumi😛ulumi:Stack", name, None, None) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/resource.py", line 1117, in init Resource.__init__(self, t, name, False, props, opts, remote, False) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/resource.py", line 941, in init register_resource( File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/resource.py", line 486, in register_resource log.debug( File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/log.py", line 45, in debug _log(engine, engine_pb2.DEBUG, msg, resource, stream_id, ephemeral) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/log.py", line 144, in _log engine.Log(req) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/grpc/_channel.py", line 946, in call return _end_unary_response_blocking(state, call, False, None) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking raise _InactiveRpcError(state) grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses" debug_error_string = "{"created":"@1656093959.919937667","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3260,"referenced_errors":[{"created":"@1656093959.919937322","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":167,"grpc_status":14}]}" > During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jagrat/.pulumi/bin/pulumi-language-python-exec", line 107, in <module> loop.run_until_complete(coro) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack await run_pulumi_func(lambda: Stack(func)) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func await wait_for_rpcs() File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 58, in wait_for_rpcs log.debug("Waiting for outstanding RPCs to complete") File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/log.py", line 45, in debug _log(engine, engine_pb2.DEBUG, msg, resource, stream_id, ephemeral) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/log.py", line 144, in _log engine.Log(req) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/grpc/_channel.py", line 946, in call return _end_unary_response_blocking(state, call, False, None) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking raise _InactiveRpcError(state) grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses" debug_error_string = "{"created":"@1656093959.920037994","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3260,"referenced_errors":[{"created":"@1656093959.920037724","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":167,"grpc_status":14}]}" > During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jagrat/.pulumi/bin/pulumi-language-python-exec", line 112, in <module> pulumi.log.error("Program failed with an unhandled exception:") File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/log.py", line 109, in error _log(engine, engine_pb2.ERROR, msg, resource, stream_id, ephemeral) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/pulumi/log.py", line 144, in _log engine.Log(req) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/grpc/_channel.py", line 946, in call return _end_unary_response_blocking(state, call, False, None) File "/home/jagrat/quickstart/venv/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking raise _InactiveRpcError(state) grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses" debug_error_string = "{"created":"@1656093959.920126045","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3260,"referenced_errors":[{"created":"@1656093959.920125791","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":167,"grpc_status":14}]}" > error: an unhandled error occurred: Program exited with non-zero exit code: 1
  • m

    most-mouse-38002

    06/24/2022, 10:28 AM
    Got some yaml files being applied to a k8s cluster created by Pulumi. When running
    pulumi down
    I would like for Pulumi to just ignore resources inside the cluster as the entire cluster is going to be terminated regardless of internal state. I tried adding
    RetainOnDelete(true)
    but it appears to not do what I hoped it would. What is the best approach here? Code in comment.
    b
    • 2
    • 19
  • i

    icy-jordan-58549

    06/24/2022, 10:32 AM
    debug: Determining which Resource Providers require Registration
        debug: All required Resource Providers are registered
        error: an unhandled error occurred: Program exited with non-zero exit code: -1
    • 1
    • 4
  • h

    high-piano-3034

    06/24/2022, 2:31 PM
    Does anyone know if there are any examples out there of importing resources using the automation API (ideally in Go)? It's hard to search for "import" and "go" 😂
    b
    • 2
    • 6
  • w

    wonderful-library-99760

    06/24/2022, 3:06 PM
    Hello, is pulumi working on something like AWS' proton? I mean, something that could mesh with backstage or related tools that serve developer portals? 🤔 That would be awesome to serve cloud templates configured through pulumi with a web portal
    b
    • 2
    • 1
  • i

    incalculable-thailand-44404

    06/25/2022, 3:01 AM
    hi folks, I am running into an issue trying to deploy datadog helm chart on AWS EKS :
    kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release> (eks-datadog-agent):
        error: can't create Helm Release with unreachable cluster: unable to load schema information from the API server: the server has asked for the client to provide credentials
    Looking for some guidance here!
    w
    • 2
    • 3
  • a

    ancient-car-89914

    06/25/2022, 8:30 AM
    using command.remote.Command to execute a script on a remote server over ssh, if an error occurs during the script execution which requires manual intervention (ie. firing up ssh and basically finishing the script’s job by hand), is there any way for me to manually mark the resource as having been created so a future
    pulumi up
    doesn’t try to create it again?
  • b

    brief-spoon-92183

    06/25/2022, 3:01 PM
    Hi everyone, I’m deploying an AWS OpenSearch domain, alongside my old AWS ElasticSearch, and there’s one very important difference in how the domain name works: for ES, a unique suffix is appended to the domain, but for OS, it’s not 😮 Is this a bug, or is this how it’s supposed to be? If it’s expected, then how can we elegantly handle uniqueness across dozens of deployments? 🤔 Thanks!
    b
    • 2
    • 7
  • f

    fancy-spoon-7206

    06/25/2022, 8:44 PM
    Reposting from the #golang channel. I am getting the below error after adding a simple integration test from the docs:
    func TestVpc(t *testing.T) {
    	awsRegion := "us-east-1"
    	cwd, _ := os.Getwd()
    
    	integration.ProgramTest(t, &integration.ProgramTestOptions{
    		Quick:       true,
    		SkipRefresh: true,
    		Dir:         path.Join(cwd, "..", "..", "aep-base-infra"),
    		Config: map[string]string{
    			"aws:region": awsRegion,
    		},
    	})
    }
    Error:
    ➜ resources (main) ✗ go test ./...
    panic: proto: duplicate enum registered: pulumirpc.EnforcementLevel
    
    goroutine 1 [running]:
    <http://github.com/golang/protobuf/proto.RegisterEnum({0x101cb7b88|github.com/golang/protobuf/proto.RegisterEnum({0x101cb7b88>, 0x1a}, 0x14000359a10?, 0x140003599e0?)
    	/Users/dinesh.auti/go/pkg/mod/github.com/golang/protobuf@v1.4.3/proto/registry.go:104 +0xb8
    <http://github.com/pulumi/pulumi/sdk/v2/proto/go.init.0()|github.com/pulumi/pulumi/sdk/v2/proto/go.init.0()>
    	/Users/dinesh.auti/go/pkg/mod/github.com/pulumi/pulumi/sdk/v2@v2.25.2/proto/go/analyzer.pb.go:963 +0x44
    exit status 2
    FAIL	<http://github.com/aetion/aep-base-infra/internal/resources|github.com/aetion/aep-base-infra/internal/resources>	0.393s
    Has anyone seen this before? I am using Pulumi version 3.35.1
    b
    • 2
    • 2
  • f

    fancy-spoon-7206

    06/27/2022, 4:19 AM
    I am trying to control the lifecycle of the stack and resources using golang and avoiding using the Pulumi CLI. Creating a stack works as expected, but not
    Up
    function.
    func main() {
    	ctx := context.Background()
    	//stackName := auto.FullyQualifiedStackName("dinesh", "infrax", "test")
    	workDir := filepath.Join(".")
    	s, err := auto.UpsertStackLocalSource(ctx, "sandbox", workDir)
    	if err != nil {
    		log.Fatalln(err)
    	}
    	
    	// -- pulumi up --
    	_, err = s.Up(ctx)
    	if err != nil {
    		log.Fatalln(err)
    	}
    }
    The error is about the stack being locked by another process. I am pretty sure no other process is touching the current stack. Any insights?
    ➜ infrax go run .      
    2022/06/27 00:14:15 failed to run update: exit status 255
    code: 255
    stdout: Updating (sandbox):
    
        pulumi:pulumi:Stack base-infra-sandbox  2022/06/27 00:14:15 failed to create stack: exit status 255
        pulumi:pulumi:Stack base-infra-sandbox  code: 255
        pulumi:pulumi:Stack base-infra-sandbox  stdout: 
        pulumi:pulumi:Stack base-infra-sandbox  stderr: error: could not create stack: the stack is currently locked by 1 lock(s). Either wait for the other process(es) to end or manually delete the lock file(s).
        pulumi:pulumi:Stack base-infra-sandbox    file:///Users/dinesh.auti/.pulumi/locks/sandbox/ae44c2ff-1d8c-4288-925e-a5302c5b9808.json: created by dinesh.auti@MacBook-Pro.local (pid 8398) at 2022-06-27T00:14:11-04:00
        pulumi:pulumi:Stack base-infra-sandbox  exit status 1
        pulumi:pulumi:Stack base-infra-sandbox  error: an unhandled error occurred: program exited with non-zero exit code: 1
        pulumi:pulumi:Stack base-infra-sandbox **failed** 1 error; 6 messages
     
    Diagnostics:
      pulumi:pulumi:Stack (base-infra-sandbox):
        2022/06/27 00:14:15 failed to create stack: exit status 255
        code: 255
        stdout:
        stderr: error: could not create stack: the stack is currently locked by 1 lock(s). Either wait for the other process(es) to end or manually delete the lock file(s).
          file:///Users/dinesh.auti/.pulumi/locks/sandbox/ae44c2ff-1d8c-4288-925e-a5302c5b9808.json: created by dinesh.auti@MacBook-Pro.local (pid 8398) at 2022-06-27T00:14:11-04:00
        exit status 1
     
        error: an unhandled error occurred: program exited with non-zero exit code: 1
    b
    • 2
    • 6
  • g

    great-midnight-49300

    06/27/2022, 6:21 AM
    Hi, After running
    pulumi stack export | pulumi stack import
    to get ride of pending operations, the configuration of the stack was deleted. How to prevent this?
    l
    c
    b
    • 4
    • 12
  • w

    wet-noon-14291

    06/27/2022, 8:55 AM
    I seem to have messed up my state, not a critical environment but a good learning opportunity in how to fix issues like this. When I try to delete a resource now it complains about the provider doesn't exist any more, and from the exported state file that make sense since the id of the kubernetes provider differs between the provider and where it is referenced. In an attempt trying to fix this I did export the file and then just tried to update the ID so they match between the provider definition in the file and where it is referenced, but for some reason that doesn't work. When I change the ID of the provider and then to an import followed by an export the ID hasn't changed. Can't I change IDs when doing imports of stacks?
  • q

    quiet-laptop-13439

    06/27/2022, 2:22 PM
    We are getting
    Target 'urn:XXX' could not be found in the stack
    error when trying to apply resource. However, we can see the resource with the urn both in the state and AWS console. What could that mean and what could be the fix?
    b
    • 2
    • 11
  • r

    rapid-raincoat-36492

    06/27/2022, 10:46 PM
    When is
    checkpoint
    used as the top level key in a statefile (https://github.com/pulumi/pulumi/blob/master/pkg/resource/stack/checkpoint.go) as opposed to a
    deployment
    key (https://github.com/pulumi/pulumi/blob/master/pkg/resource/stack/deployment.go), and what is the difference?
  • s

    steep-toddler-94095

    06/27/2022, 10:50 PM
    has anyone else been able to successfully use the Pulumi k8s operator with aws S3 as their backend? The operator keeps trying to create a new stack even though it already exists. When it does this, it even overwrites the existing statefile forcing me to restore from backup.
    • 1
    • 1
  • c

    cuddly-ice-6853

    06/28/2022, 7:18 AM
    How to create virtual machine in azure using pulumi without key_data?, basically ssh key should be auto generated on VM
    l
    • 2
    • 1
  • h

    handsome-sugar-38905

    06/28/2022, 8:35 AM
    👋 Hi everyone! may I ask you to tell me how can I migrate from Pulumi Service to self-managed backend?
    👋 1
    n
    • 2
    • 2
  • a

    ambitious-agent-35343

    06/28/2022, 9:27 AM
    How capable is Pulumi for kubernetes configuration, or is there another GitOps tool for this? (KubeSpray, WeaveWorks, ..)
    m
    • 2
    • 3
  • s

    stale-iron-26898

    06/28/2022, 10:48 AM
    Hi! does anyone able to resolve this issue https://github.com/pulumi/pulumi-aws/issues/751 I’m seeing the same issue using pulumi-aws 4.15.0 and pulumi 2.23.1 lambda environment variables doesn’t updated after a change
  • a

    aloof-dress-1001

    06/28/2022, 11:37 AM
    Hi guys! I have a pulumi python code that deploys some resources and exports the output using “pulumi.export”. I want to output those exports to a file, but when trying the python native “with open write” function, it only writes the Output as for the preview (“None”). i can do it with the “pulumi stack output” call, but this way only works after the resources have been deployed. I need the export to the file to happen as soon as the Pulumi code runs (meaning inside the code). can anyone help?
    b
    • 2
    • 1
  • p

    proud-cricket-86351

    06/28/2022, 2:08 PM
    Hi i have a question about Pulumi, how does it communicate with the cloud provider, like for example with AWS? is there any documentation for that?
    b
    • 2
    • 1
  • a

    aloof-tailor-28919

    06/28/2022, 5:18 PM
    Hello! 👋 I am trying to use the ca_cert_identifier parameter with an aws.rds.ClusterInstance resource. When I pass in the Pulumi id value from an aws.acmpca.Certificate resource, I get an error that the id is too long. Am I using this incorrectly (most likely)? or is there a bug?
  • c

    clever-glass-42863

    06/28/2022, 6:58 PM
    Greetings, is there a way to invoke the
    attach-instances
    command from the AWS package so we can attach an EC2 instance to an AutoScaleGroup? I see the Attachment resource, however I don't see the parameters to specify a launched EC2 instance. Any help would be appreciated.
    b
    • 2
    • 7
Powered by Linen
Title
c

clever-glass-42863

06/28/2022, 6:58 PM
Greetings, is there a way to invoke the
attach-instances
command from the AWS package so we can attach an EC2 instance to an AutoScaleGroup? I see the Attachment resource, however I don't see the parameters to specify a launched EC2 instance. Any help would be appreciated.
b

billowy-army-68599

06/28/2022, 7:16 PM
I don't believe this is supported at the moment. Can youy talk more about what you're trying to do?
c

clever-glass-42863

06/28/2022, 7:19 PM
Thanks for the reply. We have a EC2 launch type service that runs game servers via UDP. The EC2 itself is in
host
networkMode which then requires a
distinctInstance
configuration from the auto scale perspective. This is fine, except when trying to do rolling updates. Since we have a desired count for the service, if we are currently servicing our desired count, the auto scale group doesn't create an additional EC2 instance to account for the task placement. Therefore our strategy was to always spin up n+ EC2 instances as needed to serve the rolling deployment. The use case then is to attach the newly created EC2 instance (outside of the scale group) to the scaling group so that it is tracked appropriately.
AWS supports this mechanism via the GUI and CLI. However, I do not see a matching Terraform resource either.
b

billowy-army-68599

06/28/2022, 7:21 PM
that's a great run down, appreciate the insight!
if it's not in the tf provider, we won't have support for it It doesn't appear to be in the cloud control API yet either: https://www.pulumi.com/registry/packages/aws-native/api-docs/autoscaling/
c

clever-glass-42863

06/28/2022, 7:23 PM
Sounds good. We'll find a workaround. I appreciate the quick response
Here is a non-pulumi workaround in C# if anyone runs into this. It does require the use of the Amazon Sdk
// attach-instances hack work around...
_ = Output.Tuple(ec2Instance.Id, clusterAutoScalingGroup.Name).Apply(async x =>
{
    using (var client = new Amazon.AutoScaling.AmazonAutoScalingClient(Amazon.RegionEndpoint.USWest1))
    {
        // This +1 the desired capacity, so you may want to wait for deploymenet then reduce the desired capacity...
        await client.AttachInstancesAsync(new Amazon.AutoScaling.Model.AttachInstancesRequest
        {
            InstanceIds = new List<string> { x.Item1 },
            AutoScalingGroupName = x.Item2
        });
    }

    // We don't care about the results...
    return string.Empty;
});
👍 1
View count: 5