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: add retention policy to gcs module [DA-3815] #29

Merged
merged 11 commits into from
Sep 25, 2024

Conversation

thadchais
Copy link
Contributor

@thadchais thadchais commented Sep 23, 2024

Pull Request Submission Checklist

Please confirm that you have done the following before requesting reviews:

  • I have confirmed that the PR type is appropriate for the change I am making according to the Honest Pull Request and Commit Message Naming Conventions.
  • I have typed an adequate description that explains why I am making this change.
  • I have installed and run standard pre-commit hooks that lints and validates my code.
  • All entities that I am working with are up-to-date in Backstage; if updates are needed, I have linked the relevant PRs. Backstage guide

Description

This PR introduces the following changes to the gcp_gcs_bucket module:

  • Retention Lock Configuration:
    Added a retention_policy block to the google_storage_bucket resource to enable retention lock on the bucket.
    Introduced two new variables: retention_lock_enabled and retention_lock_duration_seconds to control the retention lock settings.

  • Object Versioning:

Added a new variable: object_versioning_enabled to control the versioning of objects in the bucket.

Why

Retention Lock: Ensures that objects in the bucket are protected from deletion for a specified period, enhancing data security and compliance with data retention policies.

Data Engineers use this feature to backup data platform and secure the archived data. Here is the design document

Object Versioning: Allows multiple versions of an object to be stored, enabling retrieval, restoration, or permanent deletion of specific versions of objects.

APPENDIX

The variable var.object_versioning_enabled is a boolean variable that, when set to true, enables versioning for the Google Cloud Storage bucket. This means that multiple versions of an object can be stored in the bucket, allowing you to retrieve, restore, or permanently delete specific versions of objects.

Mutually Exclusive with Retention Lock

The retention_policy block, which includes the retention_lock_enabled and retention_lock_duration_seconds variables, is used to enforce a retention lock on the bucket. This lock ensures that objects cannot be deleted or replaced for a specified period.

However, the retention_policy and object versioning are mutually exclusive. This means you cannot enable both at the same time for a single bucket. If retention_lock_enabled is set to true, you cannot enable object_versioning_enabled, and vice versa. This restriction is in place because the retention policy enforces strict deletion rules that conflict with the flexibility provided by object versioning.

More detail: Considerations with other features

Completed DA-3820 fixed Terratest workflow


This change is Reviewable

@thadchais thadchais requested a review from a team as a code owner September 23, 2024 07:27
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

Copy link

@olli-honest olli-honest left a comment

Choose a reason for hiding this comment

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

Should this be covered by the test case as well here?

modules/gcp_gcs_bucket/inputs.tf Show resolved Hide resolved
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

MXfive
MXfive previously approved these changes Sep 23, 2024
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 23, 2024
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@thadchais thadchais force-pushed the thadchai/da-3815-add-retention-lock-to-gcs-module branch from 2722113 to a9b2a66 Compare September 23, 2024 10:46
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

ChristianWitts
ChristianWitts previously approved these changes Sep 24, 2024
olli-honest
olli-honest previously approved these changes Sep 24, 2024
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@thadchais thadchais changed the title feat: add retention policy to gcs module [DA-3815] feat: add retention policy to gcs module [DA-3815] Sep 24, 2024
@sunilhonest sunilhonest changed the title feat: add retention policy to gcs module [DA-3815] feat: add retention policy to gcs module [DA-3815] Sep 24, 2024
@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@honestbank-bot
Copy link
Contributor

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖Success! The configuration is valid.

Terraform Plan 📖failure

Show Plan

Pusher: @thadchais, Action: pull_request, Working Directory: ``, Workflow: terraform

@thadchais thadchais merged commit 47fa270 into main Sep 25, 2024
6 checks passed
@thadchais thadchais deleted the thadchai/da-3815-add-retention-lock-to-gcs-module branch September 25, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants