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

    boundless-tailor-35598

    06/19/2020, 9:56 AM
    Thanks!
  • b

    boundless-tailor-35598

    06/19/2020, 10:48 AM
    Sorry @broad-dog-22463 being dumb here, but how do you output the hostnames and ips from the stack?
  • b

    broad-dog-22463

    06/19/2020, 10:49 AM
    Add some output params eg [Output] public Output<ImmutableArray<string>> PublicIps { get; set; } [Output] public Output<ImmutableArray<string>> PublicDns { get; set; }
  • b

    broad-dog-22463

    06/19/2020, 10:49 AM
    Then set the bars as follows
  • b

    broad-dog-22463

    06/19/2020, 10:50 AM
    this.PublicIps = Output.All(ips.ToImmutableArray()); this.PublicDns = Output.All(hostnames.ToImmutableArray());
  • b

    boundless-tailor-35598

    06/19/2020, 10:50 AM
    thanks!
    šŸ‘ 1
  • l

    limited-carpenter-34991

    06/22/2020, 9:10 AM
    Hi there i have problems concerning the output. I create an azure api management backend
    var backend = new Backend(namePlaceHolder, new BackendArgs
    {
      ApiManagementName = apiManagement.Name,
      ResourceGroupName = resourceGroup,
      Protocol = "http",
      Url = Output.Format($"https://{app.DefaultHostname}/api")
    });
    
     Output<string> backendId = backend.Name.Apply(id => id);
    
            
     var backendIdParameter = Output.Format(@$"""{backendId}""");
    
     var apiPolicy = new ApiPolicy($"{namePlaceHolderWithoutSpecialCharacter}", new ApiPolicyArgs
     {
       ApiManagementName = apiManagement.Name,
       ResourceGroupName = resourceGroup,
       ApiName = api.Name,
       XmlContent = $@"
        <policies>
        <inbound>
         <base/>
         <set-backend-service id="4711" backend-id={backendIdParameter} />
        </inbound>
        <backend>
         <base/>
        </backend>
        <outbound>
         <base/>
        </outbound>
        <on-error>
         <base/>
        </on-error>
        </policies>",});
    Every time the xmlContent is filled inside the backend-id with "Pulum.Output<string>" and not the string value. What i have to do to get the value inside this xmlContent?
    t
    • 2
    • 3
  • l

    limited-carpenter-34991

    06/22/2020, 12:00 PM
    Sometimes i got a problem with the azure storage account and the blob container source and the filearchive
    System.InvalidOperationException: Expected Pulumi.AssetOrArchive but got System.String deserializing Pulumi.Azure.Storage.Blob.source
    I coud not find anxy issue on github. Sometimes the error comes and sometimes it works with no problems.
  • w

    worried-city-86458

    06/24/2020, 10:27 AM
    I'm finally back in Pulumi land and trying to port some ts code to c#...
    const cluster = new eks.Cluster(
        name,
        {
            deployDashboard: false,
            publicSubnetIds: publicSubnetIds,
            privateSubnetIds: privateSubnetIds,
            instanceRole: instanceRole,
            roleMappings: iam.getRoleMappings(),
            userMappings: iam.getUserMappings(),
            skipDefaultNodeGroup: true,
            tags: {
                Environment: environment,
                EnvironmentType: environmentType,
                CostCenter: costCenter
            },
            version: k8sVersion,
            vpcId: vpc.outputs.Vpc
        },
        {
            customTimeouts: {
                create: "30m",
                update: "30m"
            }
        }
    );
    ... but I can't find the equivalent of a lot of the above args on
    ClusterArgs
    e.g. how am I supposed to pass role and user mappings? šŸ˜•
    t
    • 2
    • 7
  • m

    mysterious-australia-14256

    06/24/2020, 11:23 AM
    Hi all, is the isDryRun method available in dotnet or if not, is there any way to check in the code whether it is being run in preview mode or not?
    šŸ‘ 1
    t
    • 2
    • 1
  • f

    flat-bear-83490

    06/24/2020, 4:02 PM
    Hi, I'm following the example code in the docs for
    tranformations
    at https://www.pulumi.com/docs/intro/concepts/programming-model/#transformations and I'm finding that ResourceOptions.Merge doesn't seem to be available - I wondered if anyone had any pointers on this? Thanks!
    var vpc = new MyVpcComponent("vpc", new ComponentResourceOptions
    {
        Transformations =
        {
            args =>
            {
                if (args.Resource.GetResourceType() == "aws:ec2/vpc:Vpc" ||
                    args.Resource.GetResourceType() === "aws:ec2/subnet:Subnet")
                {
                    return new ResourceTransformationResult
                    {
                        Args: args.Args,
                        Options: ResourceOptions.Merge( // Not available
                            args.Options,
                            new CustomResourceOptions { IgnoreChanges =  { "tags" } }),
                    };
                }
    
                return null;
            }
        },
    });
    f
    t
    • 3
    • 4
  • c

    cold-iron-6673

    06/26/2020, 1:16 PM
    Have been looking for hours and need some help or example on how to add a vnet to a functionapp
    t
    • 2
    • 4
  • f

    flat-bear-83490

    07/01/2020, 9:50 AM
    I've having some trouble importing a network security group. I'm having an error that
    azure:network:NetworkSecurityGroup (productionuk-NSG):
    error: inputs to import do not match the existing resource
    but can't for the life of me work out the difference. Can anyone recommend some approaches for getting more detailed information about the specific difference?
    b
    • 2
    • 2
  • f

    flat-mouse-20634

    07/01/2020, 12:18 PM
    Hi there, I am trying to use the AzureDevOps provider and my stack is straightforward
    var project = new Project("test", new ProjectArgs
            {
                ProjectName = "my-project-is-super",
            });
    I am getting the below error and not getting any further details
    error: Page not found.
    Am I missing something?
    g
    • 2
    • 3
  • n

    numerous-artist-1705

    07/02/2020, 4:40 PM
    hi, does anyone use F# with Pulumi?
    t
    w
    • 3
    • 22
  • w

    worried-city-86458

    07/02/2020, 9:09 PM
    I've been playing with yak shaving the dev inner loop for C# and debugging in Visual Studio Code (with Remote WSL and Remote containers)... (Bear in mind I'm more comfortable and used to using the more heavyweight Visual Studio, so I'm still learning how to best leverage tasks and launch configs in VS Code.) Anyway, the following is reasonably effective with room for improvement:
    Program.cslaunch.jsontasks.json
  • w

    worried-city-86458

    07/02/2020, 9:15 PM
    Notes: • I'm using a hack that uses a problem matcher to sync with
    pulumi up
    as a background task • ... this seems to require
    --debug
    output from Pulumi to try get some relevant output to delay until the child dotnet process has started • It would be nice if Pulumi supported a command-line option like
    --debug-break
    that would output the dotnet pid and wait for the debugger • VS Code prompts multiple times for the parameters since it currently doesn't support passing parameters to the preLaunchTask • I can now simply
    F6
    to build (sanity check) and
    F5
    to jump into a debugging session (prompted for project and stack)
    • 1
    • 2
  • w

    worried-city-86458

    07/02/2020, 9:22 PM
    I'd love to hear from others (and the Pulumi guys!) about what your dev inner loop looks like so I can further improve mine
  • f

    flat-bear-83490

    07/06/2020, 4:33 PM
    Does anyone know if you can reparent / change the parent of a resource without causing a delete/create?
    t
    • 2
    • 4
  • f

    flat-bear-83490

    07/06/2020, 4:33 PM
  • n

    numerous-processor-60508

    07/06/2020, 7:24 PM
    I wanted to rename a resource group, but realised if I did this through Pulumi it would destroy the items. I created a new resource group in Azure and "moved" the resources into that new group. While then renaming my resource group in my C# project. I did this in the hope that it might reconcile the differences based on name, as I don't let pulumi use the suffixes. However it obvious uses ids, and thus wants to drop and recreate. So I thought I would try and import the new resource group and original resources so it wouldn't delete them (as they are in use), however now it's stating it wants to do an import-replacement. What is an import-replacement? The fact that it also says in the details that it will delete-replacement has me worried somewhat.
    t
    g
    • 3
    • 5
  • n

    numerous-processor-60508

    07/06/2020, 7:24 PM
    Any help appreciated, thank you
  • n

    numerous-artist-1705

    07/09/2020, 5:04 PM
    After 24 minutes of compilation (code generation from JSON schema takes a while), I finally got a NuGet package that supports all Pulumi Azure resources as F# computational expressions! https://github.com/UnoSD/Pulumi.FSharp.Azure
    šŸŽ† 2
    ā¤ļø 4
    t
    w
    • 3
    • 40
  • c

    chilly-hairdresser-56259

    07/09/2020, 8:13 PM
    Hello, we have decided to start using C# for Pulumi instead of Python and am running into issues when doing a stackReference. With Python its pretty straight forward to me. You get the output then you access Id object within the outputs. However, what are we missing to access just "id"?
    Untitled.txt
    t
    • 2
    • 2
  • b

    bored-activity-40468

    07/10/2020, 2:15 PM
    When using
    Deployment.RunAsync<T>
    what's the preferred method of awaiting in `T`'s ctor since a ctor can't be async. Doing people do
    Task.Run
    or is there another way? An example would be wanting to call
    await someStack.GetValueAsync()
    t
    • 2
    • 16
  • b

    bored-activity-40468

    07/10/2020, 7:07 PM
    Should this code output the value when running
    pulumi preview
    ?
    Untitled
    t
    • 2
    • 2
  • c

    chilly-hairdresser-56259

    07/14/2020, 3:05 PM
    Hello, I am new to C# looking to see if anyone here can help with using a StackReference for inputs. I am getting a deserialization error that I am stuck on.
    Untitled
    t
    • 2
    • 3
  • c

    chilly-hairdresser-56259

    07/14/2020, 9:11 PM
    I assume C# is not really supported language? Just trying to understand how to use outputs from stack A to stack B.
    w
    s
    • 3
    • 2
  • b

    bored-activity-40468

    07/15/2020, 12:55 AM
    @tall-librarian-49374 I'm working with @strong-plastic-28250 on this project. He's new to C# and I've been working with it for several years. The question I have with this snippet is, are there any downsides to being explicit with async await? I see the comments in RunAsync and how it looks for all [Ouput] attributes and waits/loops until they've completed. Could the same be achieved without using [Output] attributes, using async awaits, awaiting RunAsync and within that, using Task.WaitAll? Maybe this is only an issue with StackReferences. It seems that to use something from a StackReference in the creation of a resource needs to happen within the
    .Apply(func)
    which feels sort of like
    .ContinueWith(func)
    which is what async await tries to avoid, I think.
    Untitled
    t
    • 2
    • 18
  • b

    bumpy-motorcycle-53357

    07/17/2020, 2:14 PM
    https://www.pulumi.com/docs/guides/continuous-delivery/azure-devops/ describes how to use Azure DevOps to deploy Pulumi, but only to Azure. We use Azure Pipelines but want to deploy to AWS. The Pulumi Azure Pipelines Task only supports deployments to Azure. It would be very nice to have a more generic Azure DevOps task that lets you run Pulumi that isn't married to Azure.
    n
    c
    c
    • 4
    • 9
Powered by Linen
Title
b

bumpy-motorcycle-53357

07/17/2020, 2:14 PM
https://www.pulumi.com/docs/guides/continuous-delivery/azure-devops/ describes how to use Azure DevOps to deploy Pulumi, but only to Azure. We use Azure Pipelines but want to deploy to AWS. The Pulumi Azure Pipelines Task only supports deployments to Azure. It would be very nice to have a more generic Azure DevOps task that lets you run Pulumi that isn't married to Azure.
n

numerous-artist-1705

07/17/2020, 4:28 PM
I just use the CLI from a Bash task, install Pulumi and execute commands. The DevOps task doesn't support secret providers either if I recall correctly.
happy to share the example
c

clever-sunset-76585

07/17/2020, 4:55 PM
We use Azure Pipelines but want to deploy to AWS. The Pulumi Azure Pipelines Task only supports deployments to Azure. It would be very nice to have a more generic Azure DevOps task that lets you run Pulumi that isn’t married to Azure.
Hi @bumpy-motorcycle-53357 the task does support deploying all of the providers that Pulumi supports. The only nice thing about deploying to Azure with the task is that you can use an Azure Service Connection because that’s a first-class concept for the Azure cloud only. For all others, you may define secret variables for your build/release pipeline that is then automatically made available to your Pulumi app as well. EDIT: Note that specifying a Service Connection is optional. You can still specify all of the
ARM_*
as build variables too. But the Service Connection is definitely the recommended way to go if you are deploying to Azure on Azure Pipelines.
šŸ‘ 1
https://github.com/pulumi/pulumi-az-pipelines-task/blob/master/overview.md#how-do-i-deploy-to-aws-gcp-and-other-cloud-providers-using-pulumi-and-this-task-extension
I’ll update https://www.pulumi.com/docs/guides/continuous-delivery/azure-devops/ too with the same note as what we have on the marketplace page for the extension.
c

chilly-hairdresser-56259

07/17/2020, 6:21 PM
Why is Azure first-class, AWS has better processing power and majority of the clients. Pulumi isn't a cloud specific it's a cloud agnostic platform. So please update the Extension so that it can use AWS Service Providers, not just Azure.
Cloud agnostic company should think cloud agnostic 100%
n

numerous-artist-1705

07/17/2020, 6:30 PM
I think @clever-sunset-76585 meant Azure is a first-class support in Azure DevOps, not Pulumi
šŸ‘ 1
c

clever-sunset-76585

07/17/2020, 6:37 PM
I thinkĀ @clever-sunset-76585Ā meant Azure is a first-class support in Azure DevOps, not Pulumi
Correct.
View count: 1