Skip to content

Instantly share code, notes, and snippets.

@onelharrison
Created January 17, 2022 01:57
Show Gist options
  • Save onelharrison/5e71c04fbad1832237ea0431f9f02eea to your computer and use it in GitHub Desktop.
Save onelharrison/5e71c04fbad1832237ea0431f9f02eea to your computer and use it in GitHub Desktop.
resource "random_id" "aws_resource_id" {
byte_length = 4
}
resource "aws_s3_bucket" "snowflake_backups_bucket" {
bucket = "snowflake-backups-${lower(random_id.aws_resource_id.id)}"
acl = "private"
versioning {
enabled = true
}
lifecycle_rule {
id = "backups"
enabled = true
tags = {
rule = "backups"
autoclean = "true"
}
transition {
days = 7
storage_class = "GLACIER"
}
expiration {
days = 30
}
}
lifecycle {
prevent_destroy = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment