Resource: aws_memorydb_subnet_group

Provides a MemoryDB Subnet Group.

More information about subnet groups can be found in the MemoryDB User Guide.

Example Usage

resource "aws_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}

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

resource "aws_memorydb_subnet_group" "example" {
  name       = "my-subnet-group"
  subnet_ids = [aws_subnet.example.id]
}

Argument Reference

The following arguments are required:

The following arguments are optional:

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 a subnet group using its name. For example:

import {
  to = aws_memorydb_subnet_group.example
  id = "my-subnet-group"
}

Using terraform import, import a subnet group using its name. For example:

% terraform import aws_memorydb_subnet_group.example my-subnet-group