Created
June 30, 2021 04:08
-
-
Save ninjarobot/64f2614da7433663d836a343b1fd27d1 to your computer and use it in GitHub Desktop.
Create a minimal ARM resource to use with Farmer template generation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "nuget: Farmer" | |
open Farmer | |
// Give it a resource type. This is helpful the resource and handling dependencies. | |
let rightClickDeployments = ResourceType ("Microsoft.Hi/rightClickDeployments", "2021-06-29") | |
// Define the resource itself. | |
let minimalResource = | |
{ new IArmResource with | |
member _.JsonModel = | |
{| rightClickDeployments.Create (ResourceName "minimalResource", Location.EastUS) with | |
// Define the properties of the ARM resource here. | |
properties = {| hello = "world" |} | |
|} :> _ | |
member _.ResourceId = rightClickDeployments.resourceId "minimalResource" | |
} | |
// Add it to a template just like any other resource. | |
let template = | |
arm { | |
add_resource minimalResource | |
} | |
template.Template |> Writer.toJson |> System.Console.WriteLine |
Author
ninjarobot
commented
Jun 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment