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

    helpful-vegetable-35581

    02/03/2019, 5:37 PM
    weekend progress, the following pulumi program runs (https://github.com/Frassle/examples/tree/dotnet/azure-cs-webserver)
    🎉 1
  • t

    tall-librarian-49374

    02/03/2019, 7:36 PM
    Is it time for me to try to run it? Where are those nuget packages?
  • h

    helpful-vegetable-35581

    02/03/2019, 7:54 PM
    I've just been building and copying them to a folder set up as a nuget local source
  • h

    helpful-vegetable-35581

    02/03/2019, 8:00 PM
    https://github.com/Frassle/pulumi/tree/dotnet https://github.com/Frassle/pulumi-azure/tree/dotnet Should be able to clone those and just run make
  • h

    helpful-vegetable-35581

    02/03/2019, 8:01 PM
    Nupkgs will be in the sdk/dotnet/bin/Release folders
  • t

    tall-librarian-49374

    02/03/2019, 8:18 PM
    Makes sense. I'll give it a try next week.
  • t

    tall-librarian-49374

    02/03/2019, 8:19 PM
    How are C# files generated from TF?
  • h

    helpful-vegetable-35581

    02/03/2019, 8:40 PM
    https://github.com/Frassle/pulumi-terraform/tree/dotnet Added C# support to tfgen
  • t

    tall-librarian-49374

    02/03/2019, 8:51 PM
    Impressive 😎
  • t

    tall-librarian-49374

    02/05/2019, 1:28 PM
    @helpful-vegetable-35581 Removed my previous question because I got it working!
  • t

    tall-librarian-49374

    02/05/2019, 2:08 PM
    This works too
    🎉 1
  • s

    stocky-spoon-28903

    02/05/2019, 2:40 PM
    What does the
    IO
    function do @tall-librarian-49374 ?
    t
    • 2
    • 4
  • h

    helpful-vegetable-35581

    02/05/2019, 7:14 PM
    That looks pretty good, I was worried F# was going to be awkward because of the stricter typing but a couple of IO calls isn't too bad. Good reason to keep the name a nice short "IO".
  • h

    helpful-vegetable-35581

    02/05/2019, 7:18 PM
    design wise, I did wonder about getting rid of the "XArgs" classes and just pass the properties via named parameters to the resource ctors. Separate structs for options is a JS/TS pattern so it makes perfect sense there, but C#/F# you could go either way. Also when you get to something more complex let me know how the IO type works out. As your using F#, a functional tip IO.SelectMany = monadic bind.
  • t

    tall-librarian-49374

    02/05/2019, 7:53 PM
    Yes, I had the same thought re:args class
  • t

    tall-librarian-49374

    02/16/2019, 8:04 AM
    @helpful-vegetable-35581 Why is
    ZipBlobArgs.Content
    of type
    string
    in C# while it's
    pulumi.asset.Archive
    in TypeScript? Needs some special treatment?
  • h

    helpful-vegetable-35581

    02/16/2019, 12:39 PM
    Yeh I hadn't yet added Archive/Asset support to the runtime or translator. Have taken a pause on working on it while waiting to hear the results of https://github.com/pulumi/pulumi/issues/2430.
  • t

    tall-librarian-49374

    02/16/2019, 6:53 PM
    Yes, that's understandable, thanks
  • t

    tall-librarian-49374

    02/16/2019, 9:31 PM
    @helpful-vegetable-35581 Yet any idea if I can make it work now?
    var blob = new ZipBlob(
                    "dotnetzip",
                    new ZipBlobArgs(
                        resourceGroupName: resourceGroup.Name,
                        storageAccountName: storageAccount.Name,
                        storageContainerName: container.Name,
                        type: IO "block",
                        content: IO "???"
                    ));
    Seems to fail with
    An assertion has failed
    with whatever I put into
    content
    .
  • t

    tall-librarian-49374

    02/16/2019, 10:30 PM
    Ok, found a way forward by using normal
    Blob
  • h

    helpful-vegetable-35581

    02/16/2019, 10:32 PM
    Yeh was just about to suggest using Blob, that should just take a file path. I'm not sure exactly why the asset conversion is erroring, looks like the python and go providers also just pass a string so presumably there is some valid value for it.
  • h

    helpful-vegetable-35581

    02/16/2019, 10:44 PM
    So I think the translators are a bit confused, looks like assets should be sent as a map via the RPC to the engine, then the terraform bridge translates that to a file path for terraform to use. Surprised I haven't seen anything on the python or go chats about this not working.
  • t

    tall-librarian-49374

    02/16/2019, 11:08 PM
    Hmm, interesting
  • t

    tall-librarian-49374

    02/16/2019, 11:10 PM
    On a different topic, IO.SelectMany seems to grind the program to death for me.
    pulumi up
    never gets done with CPU stuck at 100%. Even on something trivial like
    storageAccount.PrimaryConnectionString.SelectMany(cs => new IO(cs))
    .
  • t

    tall-librarian-49374

    02/16/2019, 11:17 PM
    Looks like the problem is with non-task constructor. Task constructor + SelectMany seems to work.
  • h

    helpful-vegetable-35581

    02/17/2019, 8:55 AM
    Oh OK I'll take a look at that, might be wrongly propagating the known/unknown state
  • h

    helpful-vegetable-35581

    02/17/2019, 2:17 PM
    https://github.com/Frassle/pulumi/commit/857f48215cd4848187268e975fbf76ae6f3d7ff7 should fix it
  • t

    tall-librarian-49374

    02/17/2019, 2:34 PM
    You are my hero 🙂 Please don't spend time on my issues unless you want to, I don't want to be a burden.
  • t

    tall-librarian-49374

    02/17/2019, 9:02 PM
    So, with some preparation, we can make F# DSL like this:
  • t

    tall-librarian-49374

    02/17/2019, 9:02 PM
Powered by Linen
Title
t

tall-librarian-49374

02/17/2019, 9:02 PM
View count: 1