Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: configure Azure file share backup #1886

Merged
merged 3 commits into from Feb 14, 2024
Merged

Conversation

thekaveman
Copy link
Member

@thekaveman thekaveman commented Feb 12, 2024

Closes #1816

What this PR does

  1. Defines an Azure Recovery Services Vault; this is where snapshots are stored. The default Geo-redundant storage is configured, so that backups are stored across various Azure geographic regions for maximum availability in case of e.g. a data center outage. The cost difference for our level of transactions and storage is mostly irrelevant at this point.
  2. Links the existing Storage Account, containing the file(s) to be backed up, to this new Recovery Services Vault.
  3. Creates an Azure File Share backup and retention policy: a daily snapshot taken at 14:00 UTC (roughly 6-7am Pacific), keeping 1 backup per day and 5 per week (1 for each weekday). The thinking here is we likely make changes throughout the day, so the snapshot will be at the beginning of a new day, capturing the end-state of any previous day's changes.

I also added a quick update to our Terraform docs for getting setup with a local terraform.tfvars file, which is required to run e.g. terraform plan locally.

Relevant Azure docs

Relevant Terraform docs

the vault is where backups are stored
the policy defines the frequency and retention of backups

these are linked to the storage account via azurerm_backup_container_storage_account
@thekaveman thekaveman self-assigned this Feb 12, 2024
@github-actions github-actions bot added infrastructure Terraform, Azure, etc. documentation [auto] Improvements or additions to documentation and removed infrastructure Terraform, Azure, etc. labels Feb 12, 2024
@thekaveman thekaveman added this to the Admin tool: foundation milestone Feb 12, 2024
@thekaveman thekaveman added the infrastructure Terraform, Azure, etc. label Feb 12, 2024
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

Copy link

@thekaveman thekaveman marked this pull request as ready for review February 12, 2024 22:34
@thekaveman thekaveman requested a review from a team as a code owner February 12, 2024 22:34
Copy link
Member

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. The plan that ran for this PR looks good too. Thanks for updating the docs with notes about .tfvars 👍

@thekaveman thekaveman merged commit 2d77311 into dev Feb 14, 2024
13 checks passed
@thekaveman thekaveman deleted the feat/azure-storage-backup branch February 14, 2024 00:31
@thekaveman
Copy link
Member Author

thekaveman commented Feb 14, 2024

It looks like the terraform apply ran successfully, and created the new resources. I'm now seeing this under

Home > Storage accounts > sacdtcalitpd001 > File shares > benefits-data > Backup

image

The retention policies are a little out of line with what I had expected / understood from the docs 🤔

What I intended:

  • Daily backups taken on weekdays are retained for 5 days

What we got:

  • Daily backups retained for 1 day
  • Weekly backups taken on weekdays are retained for 5 weeks

This seems fine, we could look at reducing the 5 weeks down to 1 or 2 if we really are getting "weekly" backups every weekday...

I'm definitely confused by the wording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation [auto] Improvements or additions to documentation infrastructure Terraform, Azure, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable back up for Azure file share
2 participants