Created
September 10, 2020 08:25
-
-
Save m4r10k/f7a83297eb61a7e1fef42205bd772b86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------- artifacts -------- | |
resource "google_storage_bucket" "artifacts-<your source google project id>-backup" { | |
name = "artifacts-<your source google project id>-backup" | |
project = "<your google backup project number>" | |
location = "EUROPE-WEST4" | |
storage_class = "STANDARD" | |
force_destroy = false | |
versioning { | |
enabled = true | |
} | |
lifecycle_rule { | |
condition { | |
age = "90" | |
with_state = "ARCHIVED" | |
} | |
action { | |
type = "Delete" | |
} | |
} | |
} | |
resource "google_storage_bucket_iam_member" "artifacts-<your source google project id>-backup-objectAdmin" { | |
bucket = google_storage_bucket.artifacts-<your source google project id>-backup.name | |
role = "roles/storage.objectAdmin" | |
member = "serviceAccount:${data.google_storage_transfer_project_service_account.default.email}" | |
depends_on = [google_storage_bucket.artifacts-<your source google project id>-backup] | |
} | |
resource "google_storage_bucket_iam_member" "artifacts-<your source google project id>-backup-legacyBucketReader" { | |
bucket = google_storage_bucket.artifacts-<your source google project id>-backup.name | |
role = "roles/storage.legacyBucketReader" | |
member = "serviceAccount:${data.google_storage_transfer_project_service_account.default.email}" | |
depends_on = [google_storage_bucket.artifacts-<your source google project id>-backup] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment