Resource: aws_rds_cluster_activity_stream

Manages RDS Aurora Cluster Database Activity Streams.

Database Activity Streams have some limits and requirements, refer to the Monitoring Amazon Aurora using Database Activity Streams documentation for detailed limitations and requirements.

Example Usage

resource "aws_rds_cluster" "default" {
  cluster_identifier = "aurora-cluster-demo"
  availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"]
  database_name      = "mydb"
  master_username    = "foo"
  master_password    = "mustbeeightcharaters"
  engine             = "aurora-postgresql"
  engine_version     = "13.4"
}

resource "aws_rds_cluster_instance" "default" {
  identifier         = "aurora-instance-demo"
  cluster_identifier = aws_rds_cluster.default.cluster_identifier
  engine             = aws_rds_cluster.default.engine
  instance_class     = "db.r6g.large"
}

resource "aws_kms_key" "default" {
  description = "AWS KMS Key to encrypt Database Activity Stream"
}

resource "aws_rds_cluster_activity_stream" "default" {
  resource_arn = aws_rds_cluster.default.arn
  mode         = "async"
  kms_key_id   = aws_kms_key.default.key_id

  depends_on = [aws_rds_cluster_instance.default]
}

Argument Reference

For more detailed documentation about each argument, refer to the AWS official documentation.

This argument 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 RDS Aurora Cluster Database Activity Streams using the resource_arn. For example:

import {
  to = aws_rds_cluster_activity_stream.default
  id = "arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster-demo"
}

Using terraform import, import RDS Aurora Cluster Database Activity Streams using the resource_arn. For example:

% terraform import aws_rds_cluster_activity_stream.default arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster-demo