Git Product home page Git Product logo

Comments (5)

JordanMarr avatar JordanMarr commented on June 3, 2024 1

I'm fine with adding both name and resourceName, so you can close this too if you want.

from pulumi.fsharp.extensions.

UnoSD avatar UnoSD commented on June 3, 2024

That was a bit tricky from a naming perspective, but I recall I added a resourceName operation on the builders that should map to the name of the cloud resource (rather than the Pulumi name). It should override the auto-naming in Pulumi.

Yep, that sounds about right: https://github.com/UnoSD/Pulumi.FSharp.Extensions/blob/master/Pulumi.FSharp.Myriad/Operations.fs#L236

from pulumi.fsharp.extensions.

JordanMarr avatar JordanMarr commented on June 3, 2024

That worked (thank you!), but with a few caveats:

  1. Setting only resourceName results in a null ref exception for name. But setting both name and resourceName seems to work. (I'm not sure if that's order dependent).

  2. KeyVault.accessPolicy doesn't have a resourceName, only name. Although that may not matter since the access policies aren't visible from the resource group listing anyway.

Since you're generating the entire computation expression (correct?), I guess it's not possible (or not very easy) to simply have the resourceName custom operation set both?

from pulumi.fsharp.extensions.

JordanMarr avatar JordanMarr commented on June 3, 2024

Btw, really great idea to use Myriad here as you have done. Well done!
I used Myriad in an early alpha of SqlHydra to generate records from SQL Server SSDT .dacpac file, but have since pivoted to make it a dotnet tool instead.

from pulumi.fsharp.extensions.

UnoSD avatar UnoSD commented on June 3, 2024

That worked (thank you!), but with a few caveats:

  1. Setting only resourceName results in a null ref exception for name. But setting both name and resourceName seems to work. (I'm not sure if that's order dependent).
  2. KeyVault.accessPolicy doesn't have a resourceName, only name. Although that may not matter since the access policies aren't visible from the resource group listing anyway.

Since you're generating the entire computation expression (correct?), I guess it's not possible (or not very easy) to simply have the resourceName custom operation set both?

Glad it's working; I have not had a lot of time to recently to spend on the project, so it's good to have someone else using it and getting some feedback.

  1. That's expected, Pulumi requires the "name", so it makes sense it throws an exception (would be nice a more functional response, but that's not in my code).
  2. Does an Access policy in KV have a name? Being part of a resource I don't know if it can have a name in Azure at all. In that case, it would make sense to have only the Pulumi name as the Azure REST API may not have a option to set it. Looking at https://docs.microsoft.com/en-us/rest/api/keyvault/vaults/create-or-update#accesspolicyentry it does not seem to have a name.

It would be possible to set both using the resource name, it would require a more complex implementation of the creation (if name is not set, use resourceName, if it's set, use that), but I wonder if that could be an issue where the resource name accepts certain characters and the Pulumi name doesn't; need to investigate that.

Btw, really great idea to use Myriad here as you have done. Well done!
I used Myriad in an early alpha of SqlHydra to generate records from SQL Server SSDT .dacpac file, but have since pivoted to make it a dotnet tool instead.

Thank you, it was fun using it despite the lack of documentation (there and on Fantomas), they are awesome projects, but the learning curve it's steep without many examples. Great to know that I can also have a look at your project.

from pulumi.fsharp.extensions.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.