» aws_elasticache_subnet_group

Provides an ElastiCache Subnet Group resource.

» Example Usage

resource "aws_vpc" "foo" {
  cidr_block = "10.0.0.0/16"

  tags {
    Name = "tf-test"
  }
}

resource "aws_subnet" "foo" {
  vpc_id            = "${aws_vpc.foo.id}"
  cidr_block        = "10.0.0.0/24"
  availability_zone = "us-west-2a"

  tags {
    Name = "tf-test"
  }
}

resource "aws_elasticache_subnet_group" "bar" {
  name       = "tf-test-cache-subnet"
  subnet_ids = ["${aws_subnet.foo.id}"]
}

» Argument Reference

The following arguments are supported:

  • name – (Required) Name for the cache subnet group. Elasticache converts this name to lowercase.
  • description – (Optional) Description for the cache subnet group. Defaults to "Managed by Terraform".
  • subnet_ids – (Required) List of VPC Subnet IDs for the cache subnet group

» Attributes Reference

The following attributes are exported:

» Import

ElastiCache Subnet Groups can be imported using the name, e.g.

$ terraform import aws_elasticache_subnet_group.bar tf-test-cache-subnet