0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

TerraformでRDSのロググループの保存期間を設定

Posted at

何の記事?

TerraformでRDSのロググループ(エラーログとかのやつ)の保存期間を変えたいけど、CLIでしかできないらしいどうしよう、を解決する記事。

解決法

Provisionerを使ってTerraformでCLIを実行する

コード

保存期間を一年に設定したい場合

resource "aws_rds_cluster_instance" "cluster_instances" {
  #この辺は省略
    
  provisioner "local-exec" {
    command = "aws logs put-retention-policy --log-group-name /aws/rds/cluster/rds-name/error --retention-in-days 365"
  }
}

まとめ

リソースで指定できないものは、Provisionerを使えばTerraformだけで大抵のことはできそう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?