AWS DAX Subnet Group

This page shows how to write Terraform and CloudFormation for DAX Subnet Group and write them securely.

aws_dax_subnet_group (Terraform)

The Subnet Group in DAX can be configured in Terraform with the resource name aws_dax_subnet_group. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L7
resource "aws_dax_subnet_group" "this" {
  description = var.description
  name        = var.name
  subnet_ids  = var.subnet_ids
}

aws_dax_subnet_group.example.tf#L1
resource "aws_dax_subnet_group" "example" {
  name        = var.subnet_group_name
  description = ""
  subnet_ids  = var.subnet_ids
}
main.tf#L2
resource "aws_dax_subnet_group" "subnet_group" {
  name       = var.name
  subnet_ids = var.subnet_ids
}
# Create DAX Subnet Group
resource "aws_dax_parameter_group" "parameter_group" {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a DAX Subnet Group resource.

Tips: Best Practices for The Other AWS DAX Resources

In addition to the aws_dax_cluster, AWS DAX has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

aws_dax_cluster

Ensure to enable at rest encryption of DynamoDB Accelerator

It's better to enable at rest encryption of DynamoDB Accelerator to protect your data from unauthorized access to the underlying storage.

Review your AWS DAX settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

AWS::DAX::SubnetGroup (CloudFormation)

The SubnetGroup in DAX can be configured in CloudFormation with the resource name AWS::DAX::SubnetGroup. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

CSD-DAX-CLUSTER.yml#L78
    Type: AWS::DAX::SubnetGroup
    Properties:
      SubnetGroupName:
        Fn::Join:
        - "-"
        - - CsdDaxSubnetGroup
dax.yml#L71
    Type: AWS::DAX::SubnetGroup
    Properties:
      SubnetIds:
        - Ref: daxSubnet1
        - Ref: daxSubnet2
  DaxVpcSecurityGroup:
CSD-DAX-CLUSTER.yml#L46
    Type: AWS::DAX::SubnetGroup
    Properties:
      SubnetGroupName: DaxSubnetGroup
      Description: Subnet Group For DAX Cluster
      SubnetIds:
      - Fn::ImportValue: "CsdNetwork-DaxSubnet1Id"
vpc.yml#L145
    Type: AWS::DAX::SubnetGroup
    Properties:
      Description: Subnet Group for CCUConnect
      SubnetGroupName: ${self:custom.prefix}-group
      SubnetIds:
        - !Ref PrivateSubnet1
template.yml#L12
    Type: AWS::DAX::SubnetGroup
    Properties:
      SubnetGroupName: my-dax-subnet-group
      Description: !Ref AWS::StackName
      SubnetIds:
        - Fn::ImportValue: !Sub ${NetworkStackName}-DatastoreSubnet1Id
DAXSubnetGroupSpecification.json#L3
    "AWS::DAX::SubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html",
      "Properties": {
        "Description": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html#cfn-dax-subnetgroup-description",
DAXSubnetGroupSpecification.json#L3
    "AWS::DAX::SubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html",
      "Properties": {
        "Description": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html#cfn-dax-subnetgroup-description",
DAXSubnetGroupSpecification.json#L3
    "AWS::DAX::SubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html",
      "Properties": {
        "Description": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html#cfn-dax-subnetgroup-description",
DAXSubnetGroupSpecification.json#L3
    "AWS::DAX::SubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html",
      "Properties": {
        "Description": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html#cfn-dax-subnetgroup-description",
DAXSubnetGroupSpecification.json#L3
    "AWS::DAX::SubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html",
      "Properties": {
        "Description": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-subnetgroup.html#cfn-dax-subnetgroup-description",

Parameters

Explanation in CloudFormation Registry

Creates a new subnet group.

Frequently asked questions

What is AWS DAX Subnet Group?

AWS DAX Subnet Group is a resource for DAX of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS DAX Subnet Group?

For Terraform, the niveklabs/aws, JamesWoolfenden/terraform-aws-dax and devops-made-easy/terraform-aws-dax source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the mmanoj880/BaseInfra, yai333/AppsyncDax and mmanoj880/BaseInfraWM source code examples are useful. See the CloudFormation Example section for further details.