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

Feature/657- Module for creating storage account management policy #658

Conversation

abdulrabbani00
Copy link
Contributor

Overview

This module contains all the code needed for the storage account management policy. A few notes:

Code Structure

  • I do not loop through the management_policies block since users can only have one management_policy (modules/storage_account/storage_account.tf).
  • I nest my blocks one level deeper due to the dynamic block. For example, in examples/storage_accounts/107-storage-account-management-policy/configuration.tfvars, line 51, 52:
    • I tried to simply loop through base_blob, but in modules/storage_account/management_policy/management_policy.tf lines 31 and 32, I am unable to use the dynamic block to validate that base_blob exists and loop through it. Therefore I must have a buffer called blob_specs.
    • If there is a cleaner way to do this please let me know. Currently, the extra layer is annoying me but I was unable to find a cleaner solution.

Abdul Rabbani added 3 commits August 27, 2021 19:24
This module contains all the code needed for storage account management.
Terraform is not clear on which blocks/parameters are optional. Action is not optional, but I made everything else optional.
@arnaudlh arnaudlh linked an issue Aug 30, 2021 that may be closed by this pull request
@LaurentLesle LaurentLesle self-requested a review August 30, 2021 09:40
@LaurentLesle LaurentLesle added the enhancement New feature or request label Aug 30, 2021
@arnaudlh arnaudlh changed the base branch from master to patch.5.4.3 August 31, 2021 18:00
@abdulrabbani00
Copy link
Contributor Author

This PR is not ready, please do not merge. I have found a bug that needs to be resolved.

@abdulrabbani00
Copy link
Contributor Author

Bug resolved. I had commented out the code that validated whether or not a management_policy block existed.

@arnaudlh arnaudlh deleted the branch aztfmod:patch.5.4.4 September 6, 2021 14:33
@arnaudlh arnaudlh closed this Sep 6, 2021
@arnaudlh arnaudlh reopened this Sep 6, 2021
@arnaudlh arnaudlh changed the base branch from patch.5.4.3 to patch.5.4.4 September 6, 2021 14:48
@arnaudlh arnaudlh added this to In progress in Milestone 2109 via automation Sep 14, 2021
@arnaudlh arnaudlh added this to the 5.4.4 milestone Sep 14, 2021
Milestone 2109 automation moved this from In progress to Reviewer approved Sep 14, 2021
@arnaudlh
Copy link
Member

Looks good to me, in a future version, we probably want to have a management_policies specified separately at associated to a storage account via object key.

@arnaudlh arnaudlh merged commit 43a335c into aztfmod:patch.5.4.4 Sep 14, 2021
Milestone 2109 automation moved this from Reviewer approved to Done Sep 14, 2021
@abdulrabbani00 abdulrabbani00 deleted the feature/657-storage-management-policy branch September 14, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add storage account lifecycle management
3 participants