Resource: 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

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import ElastiCache Subnet Groups using the name. For example:

import {
  to = aws_elasticache_subnet_group.bar
  id = "tf-test-cache-subnet"
}

Using terraform import, import ElastiCache Subnet Groups using the name. For example:

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