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
automation-api
  • m

    most-lighter-95902

    03/11/2022, 3:02 AM
    Name:         developer-binding-jobs-flow
    Labels:       <http://app.kubernetes.io/managed-by=pulumi|app.kubernetes.io/managed-by=pulumi>
    Annotations:  <none>
    Role:
      Kind:  ClusterRole
      Name:  DeveloperRole
    Subjects:
      Kind            Name            Namespace
      ----            ----            ---------
      ServiceAccount  default         jobs-flow
  • m

    most-lighter-95902

    03/11/2022, 3:03 AM
    So ServiceAccount
    default
    in
    jobs-flow
    should have the permission to create a Job in
    jobs-resource
    namespace as well but I’m getting this error during the Automation API run:
  • m

    most-lighter-95902

    03/11/2022, 3:03 AM
    jobs.batch is forbidden: User "system:serviceaccount:jobs-flow:default" cannot create resource "jobs" in API group "batch" in the namespace "jobs-resource"
  • m

    most-lighter-95902

    03/11/2022, 3:04 AM
    Any guidance would be much appreciated!
    • 1
    • 1
  • m

    most-lighter-95902

    03/15/2022, 9:48 PM
    Hi, I’m using Automation API to provision an EKS cluster (using
    @pulumi/eks
    library) but I’m getting this error:
    Unhandled exception: Error: Could not find aws CLI for EKS. See <https://github.com/pulumi/pulumi-eks> for installation instructions
  • m

    most-lighter-95902

    03/15/2022, 9:49 PM
    When I go to see the installation instructions, it doesn’t seem to mention any aws CLI installations?
    f
    • 2
    • 3
  • m

    most-lighter-95902

    03/15/2022, 10:45 PM
    I tried installing aws cli and kubectl cli via Dockerfile, but nothing seems to work?
    b
    • 2
    • 6
  • m

    most-lighter-95902

    03/16/2022, 6:00 PM
    One more weird issue I’ve been stuck with: running
    const { accountId: awsAccountId } = await aws.getCallerIdentity({})
    in the
    index.ts
    of the Automation API program gives me the wrong account. The config value has
    AWS_ACCESS_KEY_ID
    and
    AWS_SECRET_ACCESS_KEY
    set correctly using client’s aws credentials, but the account id I’m receiving from the code is my own account id, not the client’s account id?
  • m

    most-lighter-95902

    03/16/2022, 6:01 PM
    Is there another way to retrieve aws account id?
  • m

    most-lighter-95902

    03/16/2022, 6:01 PM
    export const createPulumiProgram = (args: CreatePulumiProgramArgs) => async () => {
      const { stack, inputs } = args
      
      // Should return client's account id since aws credentials in config 
      // is set to client's aws credentials, but returns my own account id
      const { accountId: awsAccountId } = await aws.getCallerIdentity({})
    }
    l
    • 2
    • 26
  • p

    proud-pizza-80589

    03/16/2022, 9:59 PM
    Given the following component resource https://gist.github.com/roderik/4d6a223f05623280d87b2ce16c870d2f i can easily scale up my PVC (by increasing resources.limits.storage) But scaling down can’t happen as this will throw an error. Is there a way to access the “current” state of this component resource so I can compare it and not downgrade storage?
    l
    • 2
    • 5
  • m

    most-lighter-95902

    03/18/2022, 2:05 AM
    Hi, I’m getting this error while running automation API to set up EKS -
    no resource plugin 'eks' found in the workspace or on your $PATH
    .
    • 1
    • 1
  • m

    most-lighter-95902

    03/18/2022, 2:05 AM
    I’m actually pretty confused as to how Pulumi Automation API picks the version it requires. Locally I’m using the latest version, but the automation API frequently errors out citing another older version (i.e. aws)?
    b
    • 2
    • 6
  • m

    most-lighter-95902

    03/18/2022, 2:05 AM
    If someone can shed some light on this, it’d be much appreciated!
  • m

    most-lighter-95902

    03/26/2022, 5:09 PM
    I’m trying to check if a Kubernetes resource exists by using a getter, but it seems to just error out if the resource doesn’t exist? Is there a way to only create a resource if it doesn’t exist already?
  • m

    most-lighter-95902

    03/26/2022, 5:09 PM
    const pulumiSecretName = `pulumi-credentials`
        let pulumiSecret = k8s.core.v1.Secret.get(pulumiSecretName, `${namespaceName}/${pulumiSecretName}`)
        console.log('pulumiSecret in stacks/job-flow.ts', pulumiSecret)
        if (!pulumiSecret) {
          pulumiSecret = new k8s.core.v1.Secret(pulumiSecretName, {
            metadata: {
              name: pulumiSecretName,
              namespace: namespaceName,
            },
            stringData: {
              'PULUMI_ACCESS_TOKEN': pulumiAccessToken,
            }
          }, { parent: this })
        }
  • m

    most-lighter-95902

    03/26/2022, 5:10 PM
    If Kubernetes secret
    ${namespaceName}/${pulumiSecretName}
    doesn’t exist, it will just error out and fail during Automation API run
  • m

    most-lighter-95902

    03/26/2022, 5:11 PM
    I need to check if it exists instead and if (and only if) it doesn’t, create the resource
  • m

    most-lighter-95902

    03/26/2022, 5:12 PM
    Does anyone know how to do this?
  • w

    wet-soccer-72485

    03/27/2022, 9:26 PM
    Has anyone experienced a SIGKILL event immediately after running a preview? I can’t make heads or tails of it.
    • 1
    • 2
  • h

    handsome-butcher-2572

    03/28/2022, 6:43 PM
    Hey everyone, quick question on using pulumi automation API local. Has anyone figured out how to leverage secrets_provider in automation API main.py file, I am trying to run this through my CICD pipeline, but havnt been able to get past adding KMS key for secret encryption.
    b
    a
    • 3
    • 2
  • p

    purple-lion-34129

    03/29/2022, 1:29 PM
    Hello everyone #automation-api
  • p

    purple-lion-34129

    03/29/2022, 1:29 PM
    Is there a way to use the cross guard in automation API?...Am able to use it via CLI..
    l
    • 2
    • 1
  • l

    lemon-lamp-41193

    03/29/2022, 9:35 PM
    Am I correct in my findings that the Automation API currently does not support stack transformations? Such as the ones mentioned here: https://www.pulumi.com/blog/automatically-enforcing-aws-resource-tagging-policies/#automatically-applying-tags.
    b
    • 2
    • 3
  • p

    proud-pizza-80589

    03/31/2022, 5:51 AM
    Is there a way, inside of an inline program, to access the “current” state of a resource (so the data i can see in the website)?
    b
    l
    • 3
    • 5
  • w

    wet-soccer-72485

    04/06/2022, 6:36 AM
    Are ‘Update Plans’ on the roadmap for the automation API? https://www.pulumi.com/blog/announcing-public-preview-update-plans/
    l
    • 2
    • 2
  • b

    bitter-psychiatrist-55958

    04/07/2022, 8:27 AM
    is there an automation api to list all stacks for a project?
    l
    b
    g
    • 4
    • 15
  • b

    bitter-psychiatrist-55958

    04/07/2022, 8:33 AM
    i've a use case where i'd like to programatically loop stacks and make changes to all of them
  • q

    quaint-hair-91883

    04/12/2022, 8:17 AM
    Hi! I’m working on a CLI tool that builds on Automation API. Is is possible to programmatically do
    pulumi login s3://……
    ? The tool I’m writing needs to be portable.
    l
    • 2
    • 5
  • w

    wet-gigabyte-99270

    04/12/2022, 9:31 AM
    Is it possible to use Azure Functions endpoints to wrap pulumi Automation? I have some simple pulumi TS code that creates a resource group and want to hit an endpoint in azure that will then provision a resource group for me. Basically const stack = await LocalWorkspace.createStack({ stackName: orgAndStack, projectName, program: createPulumiProgram(context, content), } ); inside an azure function. I have tried and I can run it locally but not on azure. Errors are "errno": -4058, "code": "ENOENT", "syscall": "spawn pulumi", I think this implies it tries to call the CLI which I guess is not available at the point where the code is executed. Should I just dump all my stuff into a docker container instead and give up on the Azure Functions idea?
    b
    b
    • 3
    • 4
Powered by Linen
Title
w

wet-gigabyte-99270

04/12/2022, 9:31 AM
Is it possible to use Azure Functions endpoints to wrap pulumi Automation? I have some simple pulumi TS code that creates a resource group and want to hit an endpoint in azure that will then provision a resource group for me. Basically const stack = await LocalWorkspace.createStack({ stackName: orgAndStack, projectName, program: createPulumiProgram(context, content), } ); inside an azure function. I have tried and I can run it locally but not on azure. Errors are "errno": -4058, "code": "ENOENT", "syscall": "spawn pulumi", I think this implies it tries to call the CLI which I guess is not available at the point where the code is executed. Should I just dump all my stuff into a docker container instead and give up on the Azure Functions idea?
b

bored-oyster-3147

04/12/2022, 12:54 PM
Currently automation api requires the use of the CLI locally still. So if you can't make that accessible within the azure function than it won't be doable
👍 1
w

wet-gigabyte-99270

04/12/2022, 12:56 PM
Alright. Thanks, I suspected this, really good to get a confirmation. I have set up a new path hosting this in a container instead. Adding the CLI to the container should be much simpler, I hope 🙂
b

bored-oyster-3147

04/12/2022, 12:58 PM
It was implemented modularly such that there are plans to not need the CLI eventually and it could be pulled out / replaced, but that's probably a ways off. Good luck!
b

bored-activity-40468

04/12/2022, 10:23 PM
@wet-gigabyte-99270 might be useful https://github.com/gitfool/Pulumi.Dungeon/blob/main/Cli/Dockerfile
👍 1
🙌 1
View count: 7