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