mirror of
https://github.com/Sea-Haven-Industries/file-share.git
synced 2026-10-02 06:03:14 +00:00
* fix(infra): run nightly snapshots as a stack-local DLM role (PLAT-77) The lifecycle policy assumed a service-linked role AWS does not provide, so it stayed in ERROR and never snapshotted the data volume. * fix(infra): scope DLM snapshot sharing to snapshot ARNs ModifySnapshotAttribute on every resource can share a snapshot. The boundary allows it only on snapshot ARNs.
29 lines
557 B
HCL
29 lines
557 B
HCL
resource "aws_dlm_lifecycle_policy" "nightly" {
|
|
description = "Nightly EBS snapshots for file share"
|
|
execution_role_arn = aws_iam_role.dlm.arn
|
|
state = "ENABLED"
|
|
|
|
policy_details {
|
|
resource_types = ["VOLUME"]
|
|
|
|
target_tags = {
|
|
"file-share-backup" = "true"
|
|
}
|
|
|
|
schedule {
|
|
name = "file-share-nightly"
|
|
|
|
create_rule {
|
|
interval = 24
|
|
interval_unit = "HOURS"
|
|
times = ["06:00"]
|
|
}
|
|
|
|
retain_rule {
|
|
count = 30
|
|
}
|
|
|
|
copy_tags = true
|
|
}
|
|
}
|
|
}
|