简体   繁体   中英

How to disable automatic secret rotation of AWS Secrets Manager using Terraform?

I have a secret stored in AWS Secrets Manager deployed using a Terraform module which enables secret rotation. I don't have access to the source code of that module so I can't modify it. I want to disable the secret rotation using Terraform. Which resource should I use ? The aws_secretsmanager_secret_rotation requires all 3 arguments as shown below and doesn't have any parameter to disable the rotation. The automatically_after_days attribute accepts value between 1 to 365, so, passing 0 is not an option either.

resource "aws_secretsmanager_secret_rotation" "example" {
  secret_id           = aws_secretsmanager_secret.example.id
  rotation_lambda_arn = aws_lambda_function.example.arn

  rotation_rules {
    automatically_after_days = 30
  }
}

您可以完全跳过“aws_secretsmanager_secret_rotation”资源,terraform 将自动禁用旋转。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM