github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/azurerm/r/container_service.html.markdown (about) 1 --- 2 layout: "azurerm" 3 page_title: "Azure Resource Manager: azurerm_container_service" 4 sidebar_current: "docs-azurerm-resource-container-service" 5 description: |- 6 Creates an Azure Container Service instance. 7 --- 8 9 # azurerm\_container\_service 10 11 Creates an Azure Container Service Instance 12 13 ## Example Usage (DCOS) 14 ``` 15 resource "azurerm_resource_group" "test" { 16 name = "acctestRG1" 17 location = "West US" 18 } 19 20 resource "azurerm_container_service" "test" { 21 name = "acctestcontservice1" 22 location = "${azurerm_resource_group.test.location}" 23 resource_group_name = "${azurerm_resource_group.test.name}" 24 orchestration_platform = "DCOS" 25 26 master_profile { 27 count = 1 28 dns_prefix = "acctestmaster1" 29 } 30 31 linux_profile { 32 admin_username = "acctestuser1" 33 34 ssh_key { 35 key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" 36 } 37 } 38 39 agent_pool_profile { 40 name = "default" 41 count = 1 42 dns_prefix = "acctestagent1" 43 fqdn = "you.demo.com" 44 vm_size = "Standard_A0" 45 } 46 47 diagnostics_profile { 48 enabled = false 49 } 50 51 tags { 52 Environment = "Production" 53 } 54 } 55 ``` 56 57 ## Example Usage (Kubernetes) 58 59 ``` 60 resource "azurerm_resource_group" "test" { 61 name = "acctestRG1" 62 location = "West US" 63 } 64 65 resource "azurerm_container_service" "test" { 66 name = "acctestcontservice1" 67 location = "${azurerm_resource_group.test.location}" 68 resource_group_name = "${azurerm_resource_group.test.name}" 69 orchestration_platform = "Kubernetes" 70 71 master_profile { 72 count = 1 73 dns_prefix = "acctestmaster1" 74 } 75 76 linux_profile { 77 admin_username = "acctestuser1" 78 79 ssh_key { 80 key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" 81 } 82 } 83 84 agent_pool_profile { 85 name = "default" 86 count = 1 87 dns_prefix = "acctestagent1" 88 fqdn = "you.demo.com" 89 vm_size = "Standard_A0" 90 } 91 92 service_principal { 93 client_id = "00000000-0000-0000-0000-000000000000" 94 client_secret = "00000000000000000000000000000000" 95 } 96 97 diagnostics_profile { 98 enabled = false 99 } 100 101 tags { 102 Environment = "Production" 103 } 104 } 105 ``` 106 107 ## Example Usage (Swarm) 108 ``` 109 resource "azurerm_resource_group" "test" { 110 name = "acctestRG1" 111 location = "West US" 112 } 113 114 resource "azurerm_container_service" "test" { 115 name = "acctestcontservice1" 116 location = "${azurerm_resource_group.test.location}" 117 resource_group_name = "${azurerm_resource_group.test.name}" 118 orchestration_platform = "Swarm" 119 120 master_profile { 121 count = 1 122 dns_prefix = "acctestmaster1" 123 } 124 125 linux_profile { 126 admin_username = "acctestuser1" 127 128 ssh_key { 129 key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" 130 } 131 } 132 133 agent_pool_profile { 134 name = "default" 135 count = 1 136 dns_prefix = "acctestagent1" 137 fqdn = "you.demo.com" 138 vm_size = "Standard_A0" 139 } 140 141 diagnostics_profile { 142 enabled = false 143 } 144 145 tags { 146 Environment = "Production" 147 } 148 } 149 ``` 150 151 ## Argument Reference 152 153 The following arguments are supported: 154 155 * `name` - (Required) The name of the Container Service instance to create. Changing this forces a new resource to be created. 156 157 * `location` - (Required) The location where the Container Service instance should be created. Changing this forces a new resource to be created. 158 159 * `resource_group_name` - (Required) Specifies the resource group where the resource exists. Changing this forces a new resource to be created. 160 161 * `orchestration_platform` - (Required) Specifies the Container Orchestration Platform to use. Currently can be either `DCOS`, `Kubernetes` or `Swarm`. Changing this forces a new resource to be created. 162 163 * `master_profile` - (Required) A Master Profile block as documented below. 164 165 * `linux_profile` - (Required) A Linux Profile block as documented below. 166 167 * `agent_pool_profile` - (Required) One or more Agent Pool Profile's block as documented below. 168 169 * `service_principal` - (only Required when you're using `Kubernetes` as an Orchestration Platform) A Service Principal block as documented below. 170 171 * `diagnostics_profile` - (Required) A VM Diagnostics Profile block as documented below. 172 173 * `tags` - (Optional) A mapping of tags to assign to the resource. 174 175 176 `master_profile` supports the following: 177 178 * `count` - (Required) Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 179 * `dns_prefix` - (Required) The DNS Prefix to use for the Container Service master nodes. 180 181 `linux_profile` supports the following: 182 183 * `admin_username` - (Required) The Admin Username for the Cluster. 184 * `ssh_key` - (Required) An SSH Key block as documented below. 185 186 `ssh_key` supports the following: 187 188 * `key_data` - (Required) The Public SSH Key used to access the cluster. The certificate must be in PEM format with or without headers. 189 190 `agent_pool_profile` supports the following: 191 192 * `name` - (Required) Unique name of the agent pool profile in the context of the subscription and resource group. 193 * `count` - (Required) Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. 194 * `dns_prefix` - (Required) The DNS Prefix given to Agents in this Agent Pool. 195 * `vm_size` - (Required) The VM Size of each of the Agent Pool VM's (e.g. Standard_F1 / Standard_D2v2). 196 197 `service_principal` supports the following: 198 199 * `client_id` - (Required) The ID for the Service Principal. 200 * `client_secret` - (Required) The secret password associated with the service principal. 201 202 `diagnostics_profile` supports the following: 203 204 * `enabled` - (Required) Should VM Diagnostics be enabled for the Container Service VM's 205 206 ## Attributes Reference 207 208 The following attributes are exported: 209 210 * `id` - The Container Service ID. 211 212 * `master_profile.fqdn` - FDQN for the master. 213 214 * `agent_pool_profile.fqdn` - FDQN for the agent pool. 215 216 * `diagnostics_profile.storage_uri` - The URI of the storage account where diagnostics are stored.