PowerShell / DSC

This repo is for the DSC v3 project
MIT License
133 stars 22 forks source link

Intent for this implementation - will it only be an Intermediate language? #406

Open brwilkinson opened 2 months ago

brwilkinson commented 2 months ago

Summary of the new feature / enhancement

Shifting this to a new topic, since I originally put the below idea/comments in a different issue which was related to parallel execution only because I was tagged in that specific issue.

I had seen some examples where multiple levels of nesting (of languages) e.g. functions are embedded in yaml or json and this was concerning for me, since it's not inviting for me to write/author and maintain. I can understand that if the intent was for this to be an intermediate language, then that would perhaps be required, however I wanted to get an idea on this up front.

Can we please plan now to have an authoring experience based on Bicep Language? People can still use yaml or json, however I feel like the advantages of Bicep is extremely compelling.

More on why I think this is important.

Some examples

1) Radius have taken to extend Bicep in a way that would exactly meet the need that I am interested in this core tool of DSC to be extended.

example 2 above is the main reason for writing this thread/idea/feature request and I really hope this could get some traction

1) tagging @anthony-c-martin in case you can get the opportunity to chat with @SteveL-MSFT or @mgreenegit if you haven't had the chance to share each sides of your visions on Configuration Management. 2) I hope that it's possible for this to be more of a case of not if but when. 3) I know resources are limited, so perhaps this just becomes a community project up front?

Proposed technical implementation details (optional)

for simplicity I will link to the above utils sample in the:

using 'script.bicep'

// This sample only works on an OS with bash installed
param name = 'Anthony'
param platform = 'bash'
provider utils

param name string
param platform 'bash' | 'powershell'

resource sayHelloWithBash 'Script' = if (platform == 'bash') {
  type: 'bash'
  script: replace(loadTextContent('./script.sh'), '$INPUT_NAME', name)
}

resource sayHelloWithPowerShell 'Script' = if (platform == 'powershell') {
  type: 'powershell'
  script: replace(loadTextContent('./script.ps1'), '$INPUT_NAME', name)
}

output stdout string = (platform == 'bash') ? sayHelloWithBash.stdout : sayHelloWithPowerShell.stdout
SteveL-MSFT commented 2 months ago

Bicep has always been in our roadmap, but with limited resources won't on that won't happen til later unfortunately. One of the primary reasons we adopted ARM template syntax for the configuration doc is to eventually get to Bicep.

mgreenegit commented 1 month ago

@brwilkinson would you mind if we scheduled time for deeper discussion?

brwilkinson commented 1 month ago

@mgreenegit did you have a chance to talk with @anthony-c-martin?