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