github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/r/elasticache_subnet_group.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_elasticache_subnet_group" 4 sidebar_current: "docs-aws-resource-elasticache-subnet-group" 5 description: |- 6 Provides an ElastiCache Subnet Group resource. 7 --- 8 9 # aws\_elasticache\_subnet\_group 10 11 Provides an ElastiCache Subnet Group resource. 12 13 ~> **NOTE:** ElastiCache Subnet Groups are only for use when working with an 14 ElastiCache cluster **inside** of a VPC. If you are on EC2 Classic, see the 15 [ElastiCache Security Group resource](elasticache_security_group.html). 16 17 ## Example Usage 18 19 ```hcl 20 resource "aws_vpc" "foo" { 21 cidr_block = "10.0.0.0/16" 22 23 tags { 24 Name = "tf-test" 25 } 26 } 27 28 resource "aws_subnet" "foo" { 29 vpc_id = "${aws_vpc.foo.id}" 30 cidr_block = "10.0.0.0/24" 31 availability_zone = "us-west-2a" 32 33 tags { 34 Name = "tf-test" 35 } 36 } 37 38 resource "aws_elasticache_subnet_group" "bar" { 39 name = "tf-test-cache-subnet" 40 subnet_ids = ["${aws_subnet.foo.id}"] 41 } 42 ``` 43 44 ## Argument Reference 45 46 The following arguments are supported: 47 48 * `name` – (Required) Name for the cache subnet group. Elasticache converts this name to lowercase. 49 * `description` – (Optional) Description for the cache subnet group. Defaults to "Managed by Terraform". 50 * `subnet_ids` – (Required) List of VPC Subnet IDs for the cache subnet group 51 52 ## Attributes Reference 53 54 The following attributes are exported: 55 56 * `description` 57 * `name` 58 * `subnet_ids` 59 60 61 ## Import 62 63 ElastiCache Subnet Groups can be imported using the `name`, e.g. 64 65 ``` 66 $ terraform import aws_elasticache_subnet_group.bar tf-test-cache-subnet 67 ```