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

    proud-pizza-80589

    01/20/2021, 2:59 PM
    Did something change recently on tracking open promises? The following code works standalone, but fails on 50 or more open promises using the automation api.
    import * as k8s from '@pulumi/kubernetes';
    import * as pulumi from '@pulumi/pulumi';
    
    // get the cluster stack from infra-launchpad-cluster package
    const clusterStack = new pulumi.StackReference(`settlemint/bpaas-clusters/production`);
    
    // fetch the correct kubeconfig file
    const kubeconfig = clusterStack.requireOutput(`${'GKE'}${'EUROPE'}kubeconfig`.toLowerCase());
    
    // create a k8s provider to talk to the cluster for this service based on provider and region
    const provider = new k8s.Provider(`kdkdkdkdkdkd`, {
      kubeconfig,
    });
    
    console.log(provider);
    It is normal that there are a lot of open promises since it is embedded in my application. In the automation api the error reported is
    an unhandled error occurred: The Pulumi runtime detected that 58 promises were still active
    l
    • 2
    • 18
  • g

    gifted-terabyte-92288

    01/21/2021, 3:16 PM
    👋 Has anyone run into an issue when trying to create an API gateway on AWS with the automation API + Pulumi crosswalk? When I run the script, it errors every time. I posted more details (and code) here: https://github.com/pulumi/pulumi/issues/6162 If anyone else has run into this, would appreciate some guidance.
    b
    l
    • 3
    • 18
  • p

    proud-pizza-80589

    01/21/2021, 5:20 PM
    is there a way to validate values of a helm chart (typescript) before deploying? Or a way to auto generate types from a chart. Just lost an hour or two because i mistyped a key…
    b
    • 2
    • 3
  • l

    limited-rainbow-51650

    01/24/2021, 11:55 AM
    If I have the following input arguments: • organization name • project name • stack name • access token for the managed platform but I don’t have the actual stack sources around, can I use the Automation API to follow up on the latest activity? (new deploys as well as success/failure)
    b
    l
    • 3
    • 9
  • m

    magnificent-television-29869

    01/25/2021, 9:32 AM
    Hi all, I have a number of stacks and github projects, that I would like to be able to deploy in different resource groups in azure, could you guide me towards the correct door please, I am looking at the automation-api, and am a bit confused with the different segments
    l
    • 2
    • 4
  • l

    lemon-agent-27707

    01/27/2021, 11:23 PM
    👋 anyone building something cool? Would love to hear about what folks are doing with Automation API 🤖 🏭
    👋 1
    m
    • 2
    • 2
  • l

    little-cartoon-10569

    01/28/2021, 3:31 AM
    Not doing it yet, but the thing I want to use it for is for managing accounts with dependencies as stacks with dependencies.
    • 1
    • 2
  • s

    square-art-73366

    02/02/2021, 12:19 AM
    Hi everyone, the example is very useful of multi-stack application https://github.com/pulumi/automation-api-examples/tree/c31839ced632561fb9ea12de16b96d974715486e/go/multi_stack_orchestration . I am looking for a good reference architecture of complicated use case, my use case is multi-tenant(UK, DE, US, etc)  and multi-layer(Infra, service, ect) platform, do you have some examples and good ideas in Python with different branch mode and different configuration file and inner-reference  stack case with automation api. I am mixed with inner stack, branch mode, Opts with different Providers. if you have some good idea, just let me know. currently. my idea is 1. different configuration for different Tenant, but multi-stack application will have many configuration. 2. different stack  for different layer of Platform. But I don’t know how to do the ci/cd in the right wary in the end.
    f
    • 2
    • 3
  • l

    lemon-agent-27707

    02/03/2021, 11:23 PM
    Announcement for Node.js Automation API users: @pulumi/pulumi v2.20.0 has been released with several stability improvements for inline programs related to error handling, gRPC cleanup, hangs, and promise leak detection.
    🏆 1
    👏 1
    g
    • 2
    • 3
  • r

    red-match-15116

    02/09/2021, 8:25 PM
    message has been deleted
    🏭 1
    🤖 2
    🔥 3
    👍 1
    😛artypus-8bit: 2
    🚀 1
    b
    l
    s
    • 4
    • 7
  • l

    lemon-agent-27707

    02/10/2021, 8:42 PM
    FYI - Go SDK users, we are planning on removing the current implementation of structured JSON previews so that streaming preview output can be accessed in a manner consistent with the rest of the Automation API methods. We will follow up later by adding a way to stream structured events for all lifecycle methods in all of the SDKs (up/preview/refresh/destroy) This is a breaking change. If this will cause problems for you, please chime in with some notes in the issue: https://github.com/pulumi/pulumi/issues/6308
    👍 1
  • l

    limited-rainbow-51650

    02/15/2021, 5:59 PM
    Is there any way to retrieve the update ID via an
    UpResult
    after running
    stack.Up
    ? https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v2/go/x/auto#UpResult The update ID is what I get returned from this platform REST call: https://api.pulumi.com/api/stacks/{{.Organization}}/{{.Project}}/{{.Stack}}/updates?output-type=service&pageSize=10&page=1
    l
    • 2
    • 7
  • a

    alert-processor-41605

    02/23/2021, 9:21 PM
    Loving the automation API! I have a quick question about a new issue that's come up with the automation api. When I run "up" on a stack, I get an error
    unknown flag: --page-size
    after the up runs. Up is successful, but this error is thrown whent he history is getting fetched. This happened locally and running
    brew upgrade pulumi
    fixed the problem. When I'm running in my CI environment (Github Actions), however, I do not know how to resolve it as I don't have a specific version of pulumi running in the action. Any thoughts on how to resolve this? I will put the full error in a thread below.
    b
    • 2
    • 4
  • p

    prehistoric-kite-30979

    02/25/2021, 11:14 AM
    Hi! Where/how are stack configs persisted with the automation API? In standard CLI based Pulumi, this is just the
    stack-name.pulumi.yaml
    file.
    c
    l
    • 3
    • 4
  • l

    little-orange-65618

    02/26/2021, 12:30 AM
    Building out a POC with the new automation API's (inline programs), and seeing some warnings that I didn't have before with more traditional CLI based infra. • warning: provider config warning: "skip_credentials_validation": [DEPRECATED] This field is deprecated and will be removed in version 3.0 of the Azure Provider I'm not specifying this parameter anywhere, it appears to be some sort of default • warning: name is deprecated: This property has been renamed to
    display_name
    and will be removed in v2.0 of this provider. The 'name' one happens a lot and seems to be tied to Azure role (assignment / lookup, hard to tell since the log doesn't indicate where) but checking all name properties (in resource creation and member variables) makes it seem like none of them support display_name
    g
    c
    • 3
    • 3
  • b

    bored-flower-84342

    03/02/2021, 9:00 PM
    I'm looking for a dotnet api automation example - I see there are go/node/python examples in the automation-api-examples on github, anyone know where I can find a working example using the pre release alpha for dotnet?
    f
    • 2
    • 8
  • c

    colossal-australia-65039

    03/03/2021, 11:21 PM
    How can I use the automation API to handle when one stack depends on outputs from another stack? Right now I'm using
    StackReference
    but it only ties the stacks together with a string value (the name of the stack). I'd like to do this with an object reference so I can run a single command to bring up multiple stacks all in the correct order. Is something like this possible?
    l
    l
    • 3
    • 4
  • c

    colossal-australia-65039

    03/04/2021, 12:26 AM
    is it possible to specify the stack's configs in
    createOrSelectStack
    so I don't need to run that and then run
    setAllConfig
    as two imperative actions?
    r
    • 2
    • 1
  • f

    fast-dinner-32080

    03/06/2021, 1:39 AM
    Been looking into the automation api and had an idea that we could store the pulumi state in a kubernetes secret in the namespace I am deploying too if I use the filesystem state. Have one field to track a lock and another to hold the state in a compressed string of sorts. I guess other fields for the workspace config if I were to store it in the program/kubernetes. Has anyone done something like this?
  • f

    faint-table-42725

    03/08/2021, 6:24 PM
    message has been deleted
  • c

    clever-cartoon-41433

    03/08/2021, 11:43 PM
    This is an insanely powerful tool
    l
    b
    • 3
    • 7
  • t

    tall-needle-56640

    03/09/2021, 4:32 PM
    I'm having an issue with Azure auth. Here's my code:
    var servicePrincipalId = Environment.GetEnvironmentVariable("AzureServicePrincipalId");
    programArgs.EnvironmentVariables = new Dictionary<string, string>
    {
        ["ARM_CLIENT_ID"] = servicePrincipalId,
        ["ARM_CLIENT_SECRET"] = Environment.GetEnvironmentVariable("AzureServicePrincipalKey"),
        ["ARM_TENANT_ID"] = Environment.GetEnvironmentVariable("AzureServiceTenantId"),
        ["ARM_SUBSCRIPTION_ID"] = Environment.GetEnvironmentVariable("AzureSubscriptionId"),
    };
    
    var upResult = await stack.UpAsync();
    I know
    ARM_SUBSCRIPTION_ID
    is set to the correct value, but when I run (test in VS), it errors out saying it can't find the resource group. Turns out it is using the subscription ID I normally use (default), but why isn't it picking up the subscription ID I am setting?
    • 1
    • 1
  • t

    tall-needle-56640

    03/09/2021, 6:48 PM
    I'm getting an error within the gRPC code:
    Grpc.AspNetCore.Server.ServerCallHandler: Error: Error when executing service method 'Run'.
    
    Pulumi.LogException: Error occurred during logging
     ---> Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1615315279.587000000","description":"Failed to pick subchannel","file":"..\..\..\src\core\ext\filters\client_channel\<http://client_channel.cc|client_channel.cc>","file_line":4143,"referenced_errors":[{"created":"@1615315279.467000000","description":"failed to connect to all addresses","file":"..\..\..\src\core\ext\filters\client_channel\lb_policy\pick_first\<http://pick_first.cc|pick_first.cc>","file_line":398,"grpc_status":14}]}")
       at Pulumi.GrpcEngine.LogAsync(LogRequest request)
       at Pulumi.Deployment.Logger.LogAsync(LogSeverity severity, String message, Resource resource, Nullable`1 streamId, Nullable`1 ephemeral)
    Any ideas? Additional output:
    Microsoft.Hosting.Lifetime: Information: Now listening on: <http://0.0.0.0:63544>
    Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
    Microsoft.Hosting.Lifetime: Information: Hosting environment: Production
    Microsoft.Hosting.Lifetime: Information: Content root path: C:\repos\Atlas.Infrastructure.Templates\tests\Atlas.Infrastructure.Templates.Tests.Integration\bin\Debug\netcoreapp3.1
    'testhost.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\<http://Microsoft.NETCore.App|Microsoft.NETCore.App>\3.1.11\System.Runtime.CompilerServices.Unsafe.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'testhost.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\<http://Microsoft.NETCore.App|Microsoft.NETCore.App>\3.1.11\System.Numerics.Vectors.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2 POST <http://127.0.0.1:63544/pulumirpc.LanguageRuntime/GetRequiredPlugins> application/grpc 
    'testhost.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\<http://Microsoft.AspNetCore.App|Microsoft.AspNetCore.App>\3.1.11\Microsoft.AspNetCore.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executing endpoint 'gRPC - /pulumirpc.LanguageRuntime/GetRequiredPlugins'
    Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint 'gRPC - /pulumirpc.LanguageRuntime/GetRequiredPlugins'
    Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2 POST <http://127.0.0.1:63544/pulumirpc.LanguageRuntime/Run> application/grpc 
    Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 88.9516ms 200 application/grpc
    Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executing endpoint 'gRPC - /pulumirpc.LanguageRuntime/Run'
    The thread 0x767c has exited with code 0 (0x0).
    Microsoft.Hosting.Lifetime: Information: Application is shutting down...
    l
    • 2
    • 4
  • r

    red-match-15116

    03/11/2021, 5:56 PM
    message has been deleted
    i
    • 2
    • 7
  • l

    limited-rainbow-51650

    03/11/2021, 7:46 PM
    Does the
    ConfigMap
    type in:
    // SetAllConfig sets all values in the provided config map.
    func (s *Stack) SetAllConfig(ctx context.Context, config ConfigMap) error {
    	return s.Workspace().SetAllConfig(ctx, s.Name(), config)
    }
    support Pulumi structured configuration? It doesn’t look like it.
    r
    b
    • 3
    • 10
  • b

    better-shampoo-48884

    03/17/2021, 6:16 PM
    Do we have any sample code for automation laying around anywhere I could take a look at? preferably typescript/javascript, but I'll take any flavor..
    r
    • 2
    • 2
  • b

    better-shampoo-48884

    03/17/2021, 6:18 PM
    my goal is to make a simple app that takes a) lists the resources in a stack and b) allows modification of that stacks resources (i.e. add an IP to a whitelist + do a role assignment.
  • b

    better-shampoo-48884

    03/17/2021, 6:19 PM
    would that be better served updating the source stack, or would it be better to create a dependent stack that references the resources of the first?
    m
    • 2
    • 4
  • b

    brave-winter-60074

    03/19/2021, 7:55 AM
    Hi I am trying out the go example for multi stack here -> https://github.com/pulumi/automation-api-examples but as far I can see the used packages are not located on github on the places they should, where can i find theese?
    package main
    
    import (
       "context"
       "fmt"
       "os"
    
       "<http://github.com/pulumi/pulumi/sdk/v2/go/pulumi|github.com/pulumi/pulumi/sdk/v2/go/pulumi>"
       "<http://github.com/pulumi/pulumi/sdk/v2/go/x/auto|github.com/pulumi/pulumi/sdk/v2/go/x/auto>"
       "<http://github.com/pulumi/pulumi/sdk/v2/go/x/auto/optup|github.com/pulumi/pulumi/sdk/v2/go/x/auto/optup>"
    )
    
    func main() {
       ctx := context.Background()
       stackName := "salesforce"
    b
    b
    • 3
    • 22
  • b

    better-shampoo-48884

    03/21/2021, 2:13 PM
    I noticed that the automation-api leverages the typical Pulumi.yaml and Pulumi.<stackname>.yaml files - any chance of these being declared as part of the code instead? Would much prefer to have these synced in a database or something to go stateless..
    c
    b
    • 3
    • 7
Powered by Linen
Title
b

better-shampoo-48884

03/21/2021, 2:13 PM
I noticed that the automation-api leverages the typical Pulumi.yaml and Pulumi.<stackname>.yaml files - any chance of these being declared as part of the code instead? Would much prefer to have these synced in a database or something to go stateless..
c

clever-byte-21551

03/21/2021, 2:25 PM
AFAIK you can define everything by code, this is how i’m using it:
project := workspace.Project{
		Name:    tokens.PackageName(projectName),
		Runtime: workspace.NewProjectRuntimeInfo("go", nil),
	}
	w, err := auto.NewLocalWorkspace(
		ctx,
		auto.Program(deployFunc),
		auto.Project(project),
	)
	if err != nil {
		return nil, errorlib.Wrapf(err, "failed to create workspace")
	}

	w.SetEnvVar("PULUMI_CONFIG_PASSPHRASE", passphrase)
b

better-shampoo-48884

03/21/2021, 2:27 PM
nice! have you tried it with remote state / secrets?
it is a bit tricky to navigate the docs at the moment, so didn't see the workspace bit til now
c

clever-byte-21551

03/21/2021, 3:09 PM
I’m using S3 backend for the state and a passphrase secret store (others didn’t work so well with the automation API at the time)
b

bored-oyster-3147

03/21/2021, 4:17 PM
The first version of the automation API still depends on the CLI under the hood so it likely will rely on those project/stack YAML files until the CLI is no longer a dependency Their should be APIs for you to manipulate those files on the workspace, but you will hit a wall if your files contain complex objects instead of just string/string KVPs. In that case you’ll need to handle the serialization yourself.
You can use remote state by either using the environment variables that specifies the backend, or by setting it in the project settings YAML file
b

better-shampoo-48884

03/21/2021, 4:21 PM
thanks 🙂
View count: 1