main.tf 901 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module "s3logging-bucket" {
  2. source = "../.."
  3. bucket_suffix = "system"
  4. lifecycle_rules = [{
  5. id = "cloudtrail-expire"
  6. enabled = true
  7. prefix = "1111111111111-us-east-1-cloudtrail"
  8. # keep all cloudtrail logs for 5 years
  9. expiration = 1825
  10. noncurrent_version_expiration = 1825
  11. },
  12. {
  13. id = "vpcflowlog-expire"
  14. enabled = true
  15. prefix = "1111111111111-us-east-1-vpcflowlog"
  16. # keep flow logs for 90 days
  17. expiration = 90
  18. noncurrent_version_expiration = 90
  19. },
  20. {
  21. id = "tfstate-expire"
  22. enabled = true
  23. prefix = "tfstate-s3-logs"
  24. # keep logs for tfstate access for 5 years
  25. expiration = 1825
  26. noncurrent_version_expiration = 1825
  27. }]
  28. tags = {
  29. terraform_managed = true
  30. owner = "IT Operations"
  31. }
  32. }