Search code examples
terraformamazon-auroraaws-aurora-serverless

how to enable Aurora Activity Stream in terraform script?


Is there a way to create a database using terraform with the activity stream enabled by default?

I'm unable to find any relatable option in the docs for Aurora RDS: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_instance

From the aws cli is possible to do it, but it will be a hassle if there are multiple DB, and go one by one.

https://docs.aws.amazon.com/cli/latest/reference/rds/start-activity-stream.html


Solution

  • The feature you're asking about is in development at the moment and not yet released to the terrafor-aws-provider. Here's the link to existing PullRequest: https://github.com/hashicorp/terraform-provider-aws/pull/22097

    While this feature is not yet released, you can try to use local-exec provisioner to execute the command line on the resource's creation: https://www.terraform.io/language/resources/provisioners/local-exec.

    Worth to mention, that this approach is not encouraged by terraform's creators.

    As soon as the feature will be introduced, you can adjust your code accordingly.