github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/rancher/r/stack.html.markdown (about) 1 --- 2 layout: "rancher" 3 page_title: "Rancher: rancher_stack" 4 sidebar_current: "docs-rancher-resource-stack" 5 description: |- 6 Provides a Rancher Stack resource. This can be used to create and manage stacks on rancher. 7 --- 8 9 # rancher\_stack 10 11 Provides a Rancher Stack resource. This can be used to create and manage stacks on rancher. 12 13 ## Example Usage 14 15 ```hcl 16 # Create a new empty Rancher stack 17 resource "rancher_stack" "external-dns" { 18 name = "route53" 19 description = "Route53 stack" 20 environment_id = "${rancher_environment.default.id}" 21 catalog_id = "library:route53:7" 22 scope = "system" 23 24 environment { 25 AWS_ACCESS_KEY = "MYKEY" 26 AWS_SECRET_KEY = "MYSECRET" 27 AWS_REGION = "eu-central-1" 28 TTL = "60" 29 ROOT_DOMAIN = "example.com" 30 ROUTE53_ZONE_ID = "" 31 HEALTH_CHECK_INTERVAL = "15" 32 } 33 } 34 ``` 35 36 ## Argument Reference 37 38 The following arguments are supported: 39 40 * `name` - (Required) The name of the stack. 41 * `description` - (Optional) A stack description. 42 * `environment_id` - (Required) The ID of the environment to create the stack for. 43 * `docker_compose` - (Optional) The `docker-compose.yml` content to apply for the stack. 44 * `rancher_compose` - (Optional) The `rancher-compose.yml` content to apply for the stack. 45 * `environment` - (Optional) The environment to apply to interpret the docker-compose and rancher-compose files. 46 * `catalog_id` - (Optional) The catalog ID to link this stack to. When provided, `docker_compose` and `rancher_compose` will be retrieved from the catalog unless they are overridden. 47 * `scope` - (Optional) The scope to attach the stack to. Must be one of **user** or **system**. Defaults to **user**. 48 * `start_on_create` - (Optional) Whether to start the stack automatically. 49 * `finish_upgrade` - (Optional) Whether to automatically finish upgrades to this stack. 50 51 ## Attributes Reference 52 53 The following attributes are exported: 54 55 * `rendered_docker_compose` - The interpolated `docker_compose` applied to the stack. 56 * `rendered_rancher_compose` - The interpolated `rancher_compose` applied to the stack. 57 58 59 ## Import 60 61 Stacks can be imported using the Environment and Stack ID in the form 62 `<environment_id>/<stack_id>` 63 64 ``` 65 $ terraform import rancher_stack.foo 1a5/1e149 66 ``` 67 68 If the credentials for the Rancher provider have access to the global API, then 69 then `environment_id` can be omitted e.g. 70 71 ``` 72 $ terraform import rancher_stack.foo 1e149 73 ```