github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/r/opsworks_stack.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_opsworks_stack" 4 sidebar_current: "docs-aws-resource-opsworks-stack" 5 description: |- 6 Provides an OpsWorks stack resource. 7 --- 8 9 # aws\_opsworks\_stack 10 11 Provides an OpsWorks stack resource. 12 13 ## Example Usage 14 15 ```hcl 16 resource "aws_opsworks_stack" "main" { 17 name = "awesome-stack" 18 region = "us-west-1" 19 service_role_arn = "${aws_iam_role.opsworks.arn}" 20 default_instance_profile_arn = "${aws_iam_instance_profile.opsworks.arn}" 21 22 custom_json = <<EOT 23 { 24 "foobar": { 25 "version": "1.0.0" 26 } 27 } 28 EOT 29 } 30 ``` 31 32 ## Argument Reference 33 34 The following arguments are supported: 35 36 * `name` - (Required) The name of the stack. 37 * `region` - (Required) The name of the region where the stack will exist. 38 * `service_role_arn` - (Required) The ARN of an IAM role that the OpsWorks service will act as. 39 * `default_instance_profile_arn` - (Required) The ARN of an IAM Instance Profile that created instances 40 will have by default. 41 * `agent_version` - (Optional) If set to `"LATEST"`, OpsWorks will automatically install the latest version. 42 * `berkshelf_version` - (Optional) If `manage_berkshelf` is enabled, the version of Berkshelf to use. 43 * `color` - (Optional) Color to paint next to the stack's resources in the OpsWorks console. 44 * `default_availability_zone` - (Optional) Name of the availability zone where instances will be created 45 by default. This is required unless you set `vpc_id`. 46 * `configuration_manager_name` - (Optional) Name of the configuration manager to use. Defaults to "Chef". 47 * `configuration_manager_version` - (Optional) Version of the configuratino manager to use. Defaults to "11.4". 48 * `custom_cookbooks_source` - (Optional) When `use_custom_cookbooks` is set, provide this sub-object as 49 described below. 50 * `custom_json` - (Optional) User defined JSON passed to "Chef". Use a "here doc" for multiline JSON. 51 * `default_os` - (Optional) Name of OS that will be installed on instances by default. 52 * `default_root_device_type` - (Optional) Name of the type of root device instances will have by default. 53 * `default_ssh_key_name` - (Optional) Name of the SSH keypair that instances will have by default. 54 * `default_subnet_id` - (Optional) Id of the subnet in which instances will be created by default. Mandatory 55 if `vpc_id` is set, and forbidden if it isn't. 56 * `hostname_theme` - (Optional) Keyword representing the naming scheme that will be used for instance hostnames 57 within this stack. 58 * `manage_berkshelf` - (Optional) Boolean value controlling whether Opsworks will run Berkshelf for this stack. 59 * `use_custom_cookbooks` - (Optional) Boolean value controlling whether the custom cookbook settings are 60 enabled. 61 * `use_opsworks_security_groups` - (Optional) Boolean value controlling whether the standard OpsWorks 62 security groups apply to created instances. 63 * `vpc_id` - (Optional) The id of the VPC that this stack belongs to. 64 * `custom_json` - (Optional) Custom JSON attributes to apply to the entire stack. 65 66 The `custom_cookbooks_source` block supports the following arguments: 67 68 * `type` - (Required) The type of source to use. For example, "archive". 69 * `url` - (Required) The URL where the cookbooks resource can be found. 70 * `username` - (Optional) Username to use when authenticating to the source. 71 * `password` - (Optional) Password to use when authenticating to the source. 72 * `ssh_key` - (Optional) SSH key to use when authenticating to the source. 73 * `revision` - (Optional) For sources that are version-aware, the revision to use. 74 75 ## Attributes Reference 76 77 The following attributes are exported: 78 79 * `id` - The id of the stack. 80 81 ## Import 82 83 OpsWorks stacks can be imported using the `id`, e.g. 84 85 ``` 86 $ terraform import aws_opsworks_stack.bar 00000000-0000-0000-0000-000000000000 87 ```