github.com/dougneal/terraform@v0.6.15-0.20170330092735-b6a3840768a4/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  resource "azurerm_resource_group" "test" {
    19    name     = "acctestRG1"
    20    location = "West US"
    21  }
    22  
    23  resource "azurerm_container_service" "test" {
    24    name                   = "acctestcontservice1"
    25    location               = "${azurerm_resource_group.test.location}"
    26    resource_group_name    = "${azurerm_resource_group.test.name}"
    27    orchestration_platform = "DCOS"
    28  
    29    master_profile {
    30      count      = 1
    31      dns_prefix = "acctestmaster1"
    32    }
    33  
    34    linux_profile {
    35      admin_username = "acctestuser1"
    36  
    37      ssh_key {
    38        key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld"
    39      }
    40    }
    41  
    42    agent_pool_profile {
    43      name       = "default"
    44      count      = 1
    45      dns_prefix = "acctestagent1"
    46      fqdn       = "you.demo.com"
    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  ```
    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      fqdn       = "you.demo.com"
    92      vm_size    = "Standard_A0"
    93    }
    94  
    95    service_principal {
    96      client_id     = "00000000-0000-0000-0000-000000000000"
    97      client_secret = "00000000000000000000000000000000"
    98    }
    99  
   100    diagnostics_profile {
   101      enabled = false
   102    }
   103  
   104    tags {
   105      Environment = "Production"
   106    }
   107  }
   108  ```
   109  
   110  ## Example Usage (Swarm)
   111  ```
   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      fqdn       = "you.demo.com"
   141      vm_size    = "Standard_A0"
   142    }
   143  
   144    diagnostics_profile {
   145      enabled = false
   146    }
   147  
   148    tags {
   149      Environment = "Production"
   150    }
   151  }
   152  ```
   153  
   154  ## Argument Reference
   155  
   156  The following arguments are supported:
   157  
   158  * `name` - (Required) The name of the Container Service instance to create. Changing this forces a new resource to be created.
   159  
   160  * `location` - (Required) The location where the Container Service instance should be created. Changing this forces a new resource to be created.
   161  
   162  * `resource_group_name` - (Required) Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
   163  
   164  * `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.
   165  
   166  * `master_profile` - (Required) A Master Profile block as documented below.
   167  
   168  * `linux_profile` - (Required) A Linux Profile block as documented below.
   169  
   170  * `agent_pool_profile` - (Required) One or more Agent Pool Profile's block as documented below.
   171  
   172  * `service_principal` - (only Required when you're using `Kubernetes` as an Orchestration Platform) A Service Principal block as documented below.
   173  
   174  * `diagnostics_profile` - (Required) A VM Diagnostics Profile block as documented below.
   175  
   176  * `tags` - (Optional) A mapping of tags to assign to the resource.
   177  
   178  
   179  `master_profile` supports the following:
   180  
   181  * `count` - (Required) Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1.
   182  * `dns_prefix` - (Required) The DNS Prefix to use for the Container Service master nodes.
   183  
   184  `linux_profile` supports the following:
   185  
   186  * `admin_username` - (Required) The Admin Username for the Cluster.
   187  * `ssh_key` - (Required) An SSH Key block as documented below.
   188  
   189  `ssh_key` supports the following:
   190  
   191  * `key_data` - (Required) The Public SSH Key used to access the cluster. The certificate must be in PEM format with or without headers.
   192  
   193  `agent_pool_profile` supports the following:
   194  
   195  * `name` - (Required) Unique name of the agent pool profile in the context of the subscription and resource group.
   196  * `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.
   197  * `dns_prefix` - (Required) The DNS Prefix given to Agents in this Agent Pool.
   198  * `vm_size` - (Required) The VM Size of each of the Agent Pool VM's (e.g. Standard_F1 / Standard_D2v2).
   199  
   200  `service_principal` supports the following:
   201  
   202  * `client_id` - (Required) The ID for the Service Principal.
   203  * `client_secret` - (Required) The secret password associated with the service principal.
   204  
   205  `diagnostics_profile` supports the following:
   206  
   207  * `enabled` - (Required) Should VM Diagnostics be enabled for the Container Service VM's
   208  
   209  ## Attributes Reference
   210  
   211  The following attributes are exported:
   212  
   213  * `id` - The Container Service ID.
   214  
   215  * `master_profile.fqdn` - FDQN for the master.
   216  
   217  * `agent_pool_profile.fqdn` - FDQN for the agent pool.
   218  
   219  * `diagnostics_profile.storage_uri` - The URI of the storage account where diagnostics are stored.