Created
March 28, 2017 13:41
-
-
Save gregohardy/a3491df6a59c1d07f7e81cddd71a38c2 to your computer and use it in GitHub Desktop.
azure resource with content
This file contains 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
azure_resource_group { 'test-rg': | |
ensure => present, | |
location => 'eastus', | |
} | |
# Example with a source | |
azure_resource_template { 'test-storage-account': | |
ensure => 'present', | |
resource_group => 'test-rg', | |
source => 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-storage-account-create/azuredeploy.json', | |
params => { | |
'storageAccountType' => 'Standard_GRS', | |
}, | |
} | |
# Example from https://github.com/Azure/azure-quickstart-templates/tree/master/101-loadbalancer-with-nat-rule | |
azure_resource_template { 'lb-test-template': | |
ensure => 'present', | |
resource_group => 'test-rg', | |
content => '{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"dnsNameforLBIP":{"type":"string","metadata":{"description":"Unique DNS name"}},"addressPrefix":{"type":"string","defaultValue":"10.0.0.0/16","metadata":{"description":"Address Prefix"}},"subnetPrefix":{"type":"string","defaultValue":"10.0.0.0/24","metadata":{"description":"Subnet Prefix"}},"publicIPAddressType":{"type":"string","defaultValue":"Dynamic","allowedValues":["Dynamic","Static"],"metadata":{"description":"Public IP type"}}},"variables":{"virtualNetworkName":"virtualNetwork1","publicIPAddressName":"publicIp1","subnetName":"subnet1","loadBalancerName":"loadBalancer1","nicName":"networkInterface1","vnetID":"[resourceId(\"Microsoft.Network/virtualNetworks\",variables(\"virtualNetworkName\"))]","subnetRef":"[concat(variables(\"vnetID\"),\"/subnets/\",variables(\"subnetName\"))]","publicIPAddressID":"[resourceId(\"Microsoft.Network/publicIPAddresses\",variables(\"publicIPAddressName\"))]","lbID":"[resourceId(\"Microsoft.Network/loadBalancers\",variables(\"loadBalancerName\"))]","nicId":"[resourceId(\"Microsoft.Network/networkInterfaces\",variables(\"nicName\"))]","frontEndIPConfigID":"[concat(variables(\"lbID\"),\"/frontendIPConfigurations/loadBalancerFrontEnd\")]","backEndIPConfigID":"[concat(variables(\"nicId\"),\"/ipConfigurations/ipconfig1\")]","apiVersion":"2015-06-15"},"resources":[{"apiVersion":"[variables(\"apiVersion\")]","type":"Microsoft.Network/publicIPAddresses","name":"[variables(\"publicIPAddressName\")]","location":"[resourceGroup().location]","properties":{"publicIPAllocationMethod":"[parameters(\"publicIPAddressType\")]","dnsSettings":{"domainNameLabel":"[parameters(\"dnsNameforLBIP\")]"}}},{"apiVersion":"[variables(\"apiVersion\")]","type":"Microsoft.Network/virtualNetworks","name":"[variables(\"virtualNetworkName\")]","location":"[resourceGroup().location]","properties":{"addressSpace":{"addressPrefixes":["[parameters(\"addressPrefix\")]"]},"subnets":[{"name":"[variables(\"subnetName\")]","properties":{"addressPrefix":"[parameters(\"subnetPrefix\")]"}}]}},{"apiVersion":"[variables(\"apiVersion\")]","type":"Microsoft.Network/networkInterfaces","name":"[variables(\"nicName\")]","location":"[resourceGroup().location]","dependsOn":["[concat(\"Microsoft.Network/virtualNetworks/\", variables(\"virtualNetworkName\"))]","[concat(\"Microsoft.Network/loadBalancers/\", variables(\"loadBalancerName\"))]"],"properties":{"ipConfigurations":[{"name":"ipconfig1","properties":{"privateIPAllocationMethod":"Dynamic","subnet":{"id":"[variables(\"subnetRef\")]"},"loadBalancerBackendAddressPools":[{"id":"[concat(variables(\"lbID\"), \"/backendAddressPools/LoadBalancerBackend\")]"}],"loadBalancerInboundNatRules":[{"id":"[concat(variables(\"lbID\"),\"/inboundNatRules/RDP\")]"}]}}]}},{"apiVersion":"[variables(\"apiVersion\")]","name":"[variables(\"loadBalancerName\")]","type":"Microsoft.Network/loadBalancers","location":"[resourceGroup().location]","dependsOn":["[concat(\"Microsoft.Network/publicIPAddresses/\", variables(\"publicIPAddressName\"))]"],"properties":{"frontendIPConfigurations":[{"name":"loadBalancerFrontEnd","properties":{"publicIPAddress":{"id":"[variables(\"publicIPAddressID\")]"}}}],"backendAddressPools":[{"name":"loadBalancerBackEnd"}],"inboundNatRules":[{"name":"RDP","properties":{"frontendIPConfiguration":{"id":"[variables(\"frontEndIPConfigID\")]"},"protocol":"tcp","frontendPort":3389,"backendPort":3389,"enableFloatingIP":false}}]}}]}', | |
params => { | |
'dnsNameforLBIP' => 'stuffandthings02', | |
'publicIPAddressType' => 'Dynamic', | |
'addressPrefix' => '10.0.0.0/16', | |
'subnetPrefix' => '10.0.0.0/24', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment