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
dotnet
  • a

    able-train-72108

    09/21/2022, 8:01 PM
    I'm looking at the helm chart v3 api of pulumi : https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/chart/#depend-on-a-chart-resource and in the depend on example it states that we need to use the Ready() otherwise it will not work (
    Note the use of the `Ready()` method; depending on the Chart resource directly will 
            // not work.
    ) The problem is that I don't find the Ready function in the helm c# api, browsing here; https://github.com/pulumi/pulumi-kubernetes/blob/master/sdk/dotnet/Helm/V3/Chart.cs I cannot find the word ready in the page. I looked at go, python and nodejs sdk and they all have a ready member and it is set to something in the constructor. Is it a limitation of c# or a bug?
    b
    w
    • 3
    • 4
  • l

    late-lizard-19909

    09/22/2022, 6:10 PM
    I have an issue with creating a service principal in azure. I think what is happening is that my principal is not created quickly enough in azure ad to be used in the rest of my stack. I found a solution here where they add a timeout, but its typescript and I'm not advanced enough in C# to figure out how to do the equivalent. https://github.com/pulumi/pulumi-azure/issues/103#issuecomment-490600543
    i
    • 2
    • 3
  • s

    sticky-jordan-27156

    09/23/2022, 8:13 AM
    Hello, I'm trying to create a new AWS role policy but something is wrong in my json:
    let _policy =
            let args =
                Iam.RolePolicyArgs (
                    Policy =
                        input
                            """
    {
        "Version": "2012-10-17",
        "Statement": [{
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
            ],
            "Resource": "arn:aws:logs:*:*:*"
        }]
    }
    """,
                    Role = io lambdaRole.Id
                )
    
            Iam.RolePolicy ($"{loweredProjectName}-log-policy", args)
    Leads to
    aws:iam:RolePolicy (autograph-log-policy):
        error: aws:iam/rolePolicy:RolePolicy resource 'project-log-policy' has a problem: "policy" contains an invalid JSON policy. Examine values at 'RolePolicy.Policy'.
    I'm not sure why. Any ideas?
  • s

    sparse-intern-71089

    09/23/2022, 7:35 PM
    This message was deleted.
  • d

    damp-honey-93158

    09/30/2022, 1:40 PM
    hello dotnet-pulumiers! has anyone experienced the following: you build the pulumi program in your IDE, no problems - but when you run pulumi up, lots of compile errors? I’ve got this situation now on a Mac, which doesn’t happen on Windows with the exact same branch. In this case I’m using “preview” features of the C# language (string interpolation - finally), and the error messages do relate directly with the use of the new string interpolation features. So on Mac, is the pulumi compilation of the code not making use of the .csproj file definitions that guide the use of “preview” language features? Does anyone know how I could influence/tell pulumi to use the preview version of the C# language? Thank you!
    l
    d
    • 3
    • 5
  • d

    dazzling-gigabyte-42983

    10/31/2022, 1:03 PM
    Is there any easy way to get the current subscription Id when running the code. I want the subscription ID associated with the login (Az Login - Azure). I'm trying to allow devs to point at their own MSDN Subscription so this would be ideal rather than putting it in config
    r
    m
    • 3
    • 2
  • b

    bland-xylophone-56721

    10/31/2022, 5:01 PM
    Hey folks, when running a stack preview I'd like to compare proposed changes to the current stack, to determine what extra resources may be used. Basic example: a user modifies 10x VM's from 16GB RAM to 32GB, I'd like to know that they are requesting 160GB more RAM resources. Some code (C#):
    // PREVIEW CHANGES
    var output = stack.PreviewAsync(new PreviewOptions
    {
        Color = "always",
        OnStandardOutput = Console.WriteLine,
    }).Result;
    All this tells me in the
    output.ChangeSummary
    is that 10 resources will be created. How can programatically see before & after for comparison? Thanks!
  • m

    miniature-leather-70472

    11/02/2022, 10:12 AM
    Has anyone seen, and hopefully solved an issue with using Visual Studio 2022 with Pulumi that whenever you run commands from the Pulumi CLI, then come back to visual studio it seems to loose all the nuget packages and is full of errors? Running a build in VS resolves the issue, but having to do this every time I run a Pulumi command is annoying. I mentioned this a while back and a few people had seen it, but no one had a resolution. Hoping someone might have found one!
    e
    r
    • 3
    • 4
  • r

    ripe-russia-4239

    11/03/2022, 11:03 AM
    Has anyone successfully written tests for a C# Pulumi project that uses
    new Pulumi.Config()
    ? I'm trying a few approaches, currently injecting the
    Pulumi.Config
    instance via the Stack's constructor, but I can't work out how to populate the config object in my tests with sample values. The class is sealed and implements no interfaces, so it's not possible to mock it either (as far as I can tell)
    • 1
    • 1
  • r

    rhythmic-crowd-40243

    11/07/2022, 2:02 AM
    Hello All. I’m trying to read an output serialized as json from a stack upstream. My output looks something like this:
    "logWorkspaces": {
        "eastus2": "app-logs-eastus2-law16df9848",
        "central": "...",
        ...
    }
    This my attempt to try and extract the output.
    var logWorkspaceReference =  coreStackReference
                        .RequireOutput(App.Infra.Core.OutputNames.LogWorkspace);
    
    var x = logWorkspaceReference.Apply(o => JsonSerializer
        .Deserialize<Dictionary<string, object>>(o.ToString()));
    
    var workspace = Pulumi.AzureNative.OperationalInsights.GetWorkspace.Invoke(
        new GetWorkspaceInvokeArgs
        {
            ResourceGroupName = resourceGroup.Location,
            WorkspaceName = x.Apply(url => (string) url["eastus2"])
        });
    But deserialization is failing…
    an unhandled exception:
        System.Text.Json.JsonException: 'S' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
           at void System.Text.Json.ThrowHelper.ReThrowWithPath(ref ReadStack state, JsonReaderException ex)
    I don’t think I’m understanding outputs correctly. But before I spend anymore time on this, can this be done?
    e
    • 2
    • 4
  • r

    ripe-russia-4239

    11/10/2022, 10:23 AM
    Hi everyone, does anyone have an example of writing tests for stacks that include calls to a Pulumi Function? Concrete example: I need to write a test for a method that creates an Azure Event Hub connection string by calling the
    ListNamespaceKeys
    Function, like so:
    public Output<string> CreateConnectionString(string applicationName, params Union<string, AccessRights>[] accessRights)
    {
        var authorisationRule = new NamespaceAuthorizationRule(applicationName, new NamespaceAuthorizationRuleArgs
        {
            AuthorizationRuleName = applicationName,
            Rights = accessRights,
            NamespaceName = _eventHubNamespace.Name,
            ResourceGroupName = ResourceGroupName
        }, CustomResourceOptions);
    
        return ListNamespaceKeys.Invoke(new ListNamespaceKeysInvokeArgs
        {
            AuthorizationRuleName = authorisationRule.Name,
            NamespaceName = _eventHubNamespace.Name,
            ResourceGroupName = ResourceGroupName
        }, _invokeOptions).Apply(o => Output.CreateSecret(o.PrimaryConnectionString));
    }
    The Functions pass through
    IMocks.CallAsync()
    , but the
    ListNamespaceKeysResult
    type is sealed and the constructor private, and neither anonymous types nor a copy of the
    Result
    type can be serialised by Pulumi. I feel like I'm missing something here, and the documentation isn't filling in the gap 😕 (For the purposes of the tests, I don't much care about the precise value of the
    PrimaryConnectionString
    property--i.e., whether or not it's a valid connection string--and certainly don't care about the values of any of the other properties.)
    • 1
    • 2
  • b

    bored-activity-40468

    11/10/2022, 8:49 PM
    if
    Providers
    is passed to a
    ComponentResource
    will
    InvokeOptions
    inherit the provider if its parent is set?
    b
    • 2
    • 2
  • b

    bright-flag-46266

    11/14/2022, 2:23 PM
    Hi all, I am using C# to configure pulumi and I have a helm chart that I'm trying to deploy where I am trying to configure some users. the configuration in the chart looks as follow
    users:
    - user: foo
      pass: bar
    my C# configuration for doing this looks like the following
    "users", new Dictionary<string, object>()
    {
        {"user", "foo"},
        {"pass", "bar"}
    }
    but I am getting the following error from the pod
    Expected users field to be an array, got map[pass:0xc000074e10 user:0xc000074e60]
    how do I specify an array of values to a helm chart? I have looked at the documentation for Helm Releases but it didn't help much https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#release
    e
    w
    a
    • 4
    • 8
  • a

    ancient-psychiatrist-43185

    11/15/2022, 2:24 PM
    Hi all, we are trying to create
    EventSubscription
    with `DeliveryWithResourceIdentityArgs`for Azure provider. Usings:
    using Pulumi.AzureNative.EventGrid.V20220615;
    using Pulumi.AzureNative.EventGrid.V20220615.Inputs;
    Code:
    var eventSubscription = new EventSubscription($"eventsub",
                        new EventSubscriptionArgs
                        {
                            EventDeliverySchema = EventDeliverySchema.EventGridSchema,
                            DeliveryWithResourceIdentity = new DeliveryWithResourceIdentityArgs
                            {
                                Destination = new ServiceBusQueueEventSubscriptionDestinationArgs
                                {
                                    EndpointType = "ServiceBusQueue",
                                    ResourceId = "nameofeventsub"
                                },
                                Identity = new EventSubscriptionIdentityArgs
                                {
                                    Type = EventSubscriptionIdentityType.UserAssigned,
                                    UserAssignedIdentity = "???"
                                }
                            },
    
    [...]
    Our problem is to determine in what format
    UserAssignedIdentity
    should be passed. We tried id of the managed identity or client id with no success. Error message:
    resource partially created but read failed autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="Event subscription doesn't exist.": Code="Internal error" Message="The operation failed due to an internal server error. The initial state of the impacted resources (if any) are restored. Please try again in few minutes. If error still persists, report 386223c4-3350-4378-9b5f-4f3e0d1a5e98:11/15/2022 2:00:16 PM (UTC) to our forums for assistance or raise a support ticket ."
    Does anyone have an idea what should be passed in
    UserAssignedIdentity
    ?
    m
    • 2
    • 1
  • b

    billowy-tiger-6272

    11/23/2022, 2:50 PM
    I notice in the .NET version (the only one I use) that when you create, for example, a ResourceGroup for Azure, you do something like
    var resourceGroup = new ResourceGroup("resourceGroup");
    , but this will generate a resource group with a random name, and that if you want to give a fixed name you need to specify it in the
    ResourceGroupArgs
    class... But then we end up having like 2 instances of the resource "name"... How is this supposed to be handled correctly? I'd like to reduce code duplication (mainly if I'm interpolating the resources names based on the environment and such, but having to do twice for every resource looks kind of weird... Perhaps I'm misusing it... 🤔
    l
    e
    +2
    • 5
    • 9
  • d

    damp-honey-93158

    11/24/2022, 12:03 PM
    Is there a C# lib out there that can validate resource names (rg, key vault, storage, registry and so on) BEFORE I try to submit the pulumi code to azure? Since we have versioned ephemeral infrastructure - there will be parallel instances of the entire infra stack - and it'd be easier to understand what is what if I can inject the version numbers into the names in some places - in addition to tags - but some naming rules don't allow periods, or underscores while others do (e.g. rg vs container registry name). Thanks for any hints / tips
    e
    • 2
    • 3
  • o

    orange-airplane-72526

    12/05/2022, 2:48 PM
    Hi, whats the best way to set an s3 backend when using the c# pulumi automation API. Ex.:
    var program = PulumiFn.Create<MyStack>();
    
    var stackArgs = new InlineProgramArgs("test", "a", program);
    
    var stack = await LocalWorkspace.CreateOrSelectStackAsync(stackArgs);
    await stack.SetConfigAsync("aws:region", new ConfigValue("eu-central-1"));
    await stack.UpAsync();
    e
    • 2
    • 7
  • l

    little-library-54601

    12/06/2022, 2:24 PM
    Folks, I started getting this error in a Github Action late yesterday.
    Diagnostics:
    199    pulumi:pulumi:Stack (grv-api-resources-grv-api-dev):
    200      You must install or update .NET to run this application.
    201      App: /home/runner/work/GeneralRV-API/GeneralRV-API/Devops/azure-environment/pulumi/grv-api-resources/bin/Debug/netcoreapp3.1/grv-api-resources
    202      Architecture: x64
    203      Framework: '<http://Microsoft.NETCore.App|Microsoft.NETCore.App>', version '3.1.0' (x64)
    204      .NET location: /usr/share/dotnet
    205      The following frameworks were found:
    206        6.0.11 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    207        7.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    Nothing about the action's dependence on .net core has changed since last week when it worked. I'll be looking into it shortly, but I thought someone here might be able to short-circuit my need to research. Is it possibly something as straightforward as a "uses" step within the job to explicitly reference a version of .net core?
    b
    c
    i
    • 4
    • 22
  • s

    sticky-jordan-27156

    12/07/2022, 6:35 PM
    Hi all, my deploy seems to have stopped working and I only recently noticed it:
    pulumi:pulumi:Stack Telplin.Deploy-telplin  Unhandled exception. System.AggregateException: One or more errors occurred. (The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.)
          pulumi:pulumi:Stack Telplin.Deploy-telplin   ---> System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.
      
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at System.Text.Json.Utf8JsonReader.Read()
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack)
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter)
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 json, JsonDocumentOptions options)
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at Pulumi.Deployment.ParseConfig()
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at Pulumi.Deployment..ctor(RunnerOptions runnerOptions)
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at Pulumi.Deployment.<>c.<RunAsync>b__108_0()
          pulumi:pulumi:Stack Telplin.Deploy-telplin     at Pulumi.Deployment.CreateRunnerAndRunAsync(Func`1 deploymentFactory, Func`2 runAsync)
    I'm quite confused why this is happening, does this ring a bell for anyone?
  • b

    breezy-rocket-79823

    12/08/2022, 10:09 AM
    Hi, I'm trying to create a AWS application load balancer using Awsx.Lb. The documentation is for typescript and they are using some methods to create the target groups and listeners, e.g.
    const alb = new awsx.lb.NetworkLoadBalancer("web-traffic");
    const httpListener = alb.createListener("http-listener", { ... });
    const target = alb.createTargetGroup("web-target", { ... });
    I can't seem to find these methods when using C#. Are they located in static classes or are they just not there?
  • a

    adorable-house-55616

    12/09/2022, 4:11 PM
    Hello, I am using AWS and trying to work out how to reference an output from one resource during the creation of another. Typically, if they are all created inline, I already have an object reference, and should just be able to reference the normal output properties. However, I was going down the path of splitting everything out into its own class. As an example - let's say I have a KMS key which is stored in a source file under /KMS/Keys/MyKey.cs - then, I have a S3 bucket which needs to reference this Key's ARN to setup server-side encryption - and that code is in, let's say, /S3/Buckets/MyBucket.cs. The idea was to have a folder structure mapped to the AWS services and I have some higher-level code which instantiates everything under /KMS, and then everything under /S3. However, it seems perhaps this is not the way to do this, and instead maybe I should be using Components? I'm still fairly new to Pulumi so still grappling with some of the foundational concepts. Any thoughts on this?
    s
    b
    • 3
    • 9
  • w

    witty-vegetable-61961

    12/15/2022, 11:01 PM
    hi all, is there a way to use Pulumi with sln files? I want a project iwht an sln file as NDepend requires an sln file.
    i
    e
    • 3
    • 5
  • r

    red-australia-25342

    12/16/2022, 8:07 PM
    Hello, I'm trying to import an existing Azure IoT hub into my environment. I'm getting the error "ID was missing the IoTHubs element". I'm using the import command provided in the documentation
    pulumi import azure:iot/ioTHub:IoTHub hub1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1
    and replacing the subscription id, resource group name, and iot hub logical name and identifier. Am I missing something? Is the iotHubs a placeholder for another id?
    m
    • 2
    • 4
  • f

    freezing-ability-2805

    12/16/2022, 10:18 PM
    Hello, just wonder if any body experience the issue to deploy with Pulumi via bitbucket to Azure, the error message is: failed to decrypt: incorrect passphrase, please set PULUMI_CONFIG_PASSPHRASE to the correct passphrase or set PULUMI_CONFIG_PASSPHRASE_FILE to a file containing the passphrase the DEV and QA deployments works fine the PROD deployment is failing, thanks in advance.
    b
    • 2
    • 15
  • m

    millions-journalist-34868

    12/18/2022, 7:24 PM
    I just wanted to share my latest blog post that talks about using Pulumi and Nuke together to have everything in C#: infrastructure code, application code, CI/CD pipeline code. https://www.techwatching.dev/posts/when-pulumi-met-nuke
    b
    • 2
    • 3
  • w

    white-architect-1595

    12/27/2022, 3:44 PM
    Hello everyone! My team is trying to use Pulumi to create Azure Logic Apps (Standard) that have multiple workflows under one Standard Logic App. We can find details on how to create a logic app, but we want to create multiple workflows under one standard logic app. Has anyone done this before? We have looked over all Pulumi documentation and none of it is helpful in creating one standard logic app with multiple workflows under it. The documentation is only for creating the logic app in itself. Thanks in advance! (edited)
  • w

    white-architect-1595

    01/04/2023, 3:04 PM
    Does anyone know why when I create a webapp my appsettings are showing in the JSON for my web app in the portal? here is how I am creating the webapp
    var standardLogicApp = new Pulumi.AzureNative.Web.WebApp($"Instanda-{sn}-logic-", new()
        {
            Kind = "functionapp,workflowapp",
            ResourceGroupName = resourceGroup.Name,
            Location = resourceGroup.Location,
            ServerFarmId = appServicePlace.Id,
            SiteConfig = new SiteConfigArgs
            {
                AppSettings = new[]{
    
                        new NameValuePairArgs
                        {
                            Name = "FUNCTIONS_EXTENSION_VERSION",
                            Value = "~4"
    
                        },
                        new NameValuePairArgs
                        {
                            Name = "FUNCTIONS_WORKER_RUNTIME",
                            Value = "node"
    
                        },
                        new NameValuePairArgs
                        {
                            Name = "WEBSITE_NODE_DEFAULT_VERSION",
                            Value = "~14"
    
                        },
                        new NameValuePairArgs
                        {
                            Name = "WEBSITE_CONTENTSHARE",
                            Value = Output.Format($"{workflowfolder}")
    
                        },
                        new NameValuePairArgs
                        {
                            Name = "AzureWebJobsStorage",
                            Value = Output.Format($"DefaultEndpointsProtocol=https;AccountName={storageAccount.Name};AccountKey={primaryStorageKey};EndpointSuffix=<http://core.windows.net|core.windows.net>"),
                        },
                        new NameValuePairArgs
                        {
                            Name = "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
                            Value = Output.Format($"DefaultEndpointsProtocol=https;AccountName={storageAccount.Name};AccountKey={primaryStorageKey};EndpointSuffix=<http://core.windows.net|core.windows.net>"),
                        },
                        new NameValuePairArgs
                        {
                            Name = "AzureFunctionsJobHost__extensionBundle__id",
                            Value = "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
                        },
                        new NameValuePairArgs
                        {
                            Name = "AzureFunctionsJobHost__extensionBundle__version",
                            Value = "[1.*, 2.0.0)",
                        },
    
                        new NameValuePairArgs
                        {
                            Name = "APP_KIND",
                            Value = "workflowapp",
                        },
                    },
            },
        });
    e
    • 2
    • 1
  • w

    white-architect-1595

    01/04/2023, 3:05 PM
    under siteconfigs the appsetting is = null
  • s

    swift-island-2275

    01/06/2023, 3:45 PM
    Hi, I am trying to get an Azure KeyVault Secret in Pulumi stack. I know that ARM API doesn't allow to do that, therefore we need to use "Data SDK". Here it's mentioned that we can use
    GetClientConfig
    and
    GetClientToken
    together with correct SDK to get it working. However, it seems that the token returned from
    GetClienToken
    has different audience. When I run the code, I get an error:
    {
      "error": {
        "code": "Unauthorized",
        "message": "AKV10022: Invalid audience. Expected <https://vault.azure.net>, found: <https://management.azure.com/>."
      }
    }
    I understand the message, however I am wondering how to get a token with correct audience. Any suggestions ?
    i
    • 2
    • 5
  • l

    lively-pizza-96645

    01/10/2023, 7:18 PM
    What is the best way of creating local files after Pulumi has deployed successfully?
    s
    b
    • 3
    • 16
Powered by Linen
Title
l

lively-pizza-96645

01/10/2023, 7:18 PM
What is the best way of creating local files after Pulumi has deployed successfully?
ended up writing my own provider to solve this issue. If there is any better solutions. Let me know
s

stocky-restaurant-98004

01/10/2023, 11:40 PM
You can use the Command provider and set
dependsOn
to the last thing to be provisioned. https://www.pulumi.com/registry/packages/command/api-docs/local/command/
l

lively-pizza-96645

01/11/2023, 2:40 AM
writing multiline strings with command is a bit iffy tho. unless there is something i missed?
s

stocky-restaurant-98004

01/11/2023, 3:13 AM
Hmm. Maybe the Automation API would be a better fit?
l

lively-pizza-96645

01/11/2023, 3:15 AM
might be... But like. How would one write a kubeconfig etc to local file system? Just to give a random example of a local file that depends on cloud resources
s

stocky-restaurant-98004

01/11/2023, 3:15 AM
pulumi stack output kubeconfig --show-secrets > kubeconfig.yaml
l

lively-pizza-96645

01/11/2023, 3:16 AM
ah. manual step. gotcha
s

stocky-restaurant-98004

01/11/2023, 3:18 AM
BUT, if you're using the Pulumi K8s provider, you can just feed it into the provider (this is C# and AKS, but you should be able to translate for your lang/cloud):
var creds = AzureNative.ContainerService.ListManagedClusterUserCredentials.Invoke(new() {
    ResourceGroupName = resourceGroup.Name,
    ResourceName = managedCluster.Name,
});
var encoded = creds.Apply(result => result.Kubeconfigs[0]!.Value);
var decoded = encoded.Apply(enc => {
    var bytes = Convert.FromBase64String(enc);
    return Encoding.UTF8.GetString(bytes);
});

var provider = new Provider("k8s", new ProviderArgs {
  KubeConfig = decoded
});

// create K8s resources here
If you want to orchestrate, you could use Make for sure.
l

lively-pizza-96645

01/11/2023, 3:19 AM
Yeah. Just using kubeconfig as an example. Make as in? Makefile?
s

stocky-restaurant-98004

01/11/2023, 3:20 AM
Yeah. You can automate the commands to run after
pulumi up
l

lively-pizza-96645

01/11/2023, 3:21 AM
ah gotcha!
s

stocky-restaurant-98004

01/11/2023, 3:22 AM
You will need to use a pseudotarget since
pulumi up
does not create a file, but you could do something like
pulumi up -y && touch .make/pulumiup
or just use
.PHONY
and run
pulumi up
every time.
l

lively-pizza-96645

01/11/2023, 3:23 AM
I assume outputs can store arrays?
s

stocky-restaurant-98004

01/11/2023, 4:35 PM
Yes. You can do
Output<string[]>
or
Output<string>[]
. I believe the former is preferred.
b

bored-activity-40468

01/11/2023, 5:25 PM
@lively-pizza-96645 I copy this design but don't use the k8 provider but it might have examples of what you're looking for https://github.com/gitfool/Pulumi.Dungeon
View count: 1