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

Shanice/upgrade terraform #8102

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

shanice-skylight
Copy link
Collaborator

@shanice-skylight shanice-skylight commented Sep 3, 2024

DEVOPS PULL REQUEST

Related Issue

Changes Proposed

  • Update Terraform to the latest.

Additional Information

  • I tested these upgrades locally and didn't run into any issues with the upgrade or state migration.
  • I plan to merge this off hour

Testing

  • Deployed the changes to the following environments [dev1, dev4, dev2, dev3 ] and completed smoke testing

  • The following workflows have been tested on the environments mentioned above:

      - creating a new org
      - creating a new facility
      - adding a patient
      - bulk uploading patients
      - submitting a single entry test
      - submitting a bulk csv result upload
      - self registering a patient
    

@shanice-skylight shanice-skylight marked this pull request as ready for review September 19, 2024 17:40
@shanice-skylight shanice-skylight self-assigned this Sep 19, 2024
@shanice-skylight
Copy link
Collaborator Author

Currently smoke testing dev2

Copy link
Collaborator

@rin-skylight rin-skylight left a comment

Choose a reason for hiding this comment

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

Unfortunately, if we want to push a full upgrade, there is still additional work to do. 1.9.6 was released yesterday.

with:
terraform_version: 1.3.3
terraform_version: 1.9.5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Heads up, applicable to all files: TF is now on version 1.9.6.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes made to 1.9.6

@@ -85,9 +85,9 @@ runs:
run: ./build_and_push.sh

- name: Terraform setup
uses: hashicorp/setup-terraform@v2.0.3
uses: hashicorp/setup-terraform@v3.1.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Heads up, applicable to all files: setup-terraform is now on version 3.1.2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes made to 3.1.2

@@ -6,18 +6,10 @@ resource "azurerm_monitor_diagnostic_setting" "collect_appserviceconsolelogs" {

enabled_log {
category = "AppServiceConsoleLogs"
retention_policy {
Copy link
Collaborator

Choose a reason for hiding this comment

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

To clarify... are we removing this because it is deprecated? 🤔

And are we not replacing it with azurerm_storage_management_policy as suggested because it is being deprecated in v4? See also (https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/migrate-to-azure-storage-lifecycle-policy?tabs=portal)

With this being removed, is there any way to configure this or are we relying on some defaults somewhere? 👀

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a good callout. We can't change retention policies for logs without threatening our ATO. Definitely need to make sure we're accounting for it somewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Due to this PR only upgrading terraform and setup-terraform and not the azure provider, we're fine because we're still using hashicorp/azurerm 3.100.0. In the PR I'll push out after this one, I'll address all of the deprecated attributes. The attributes that come up as not supported would affect this PR

In the ticket for the azurerm provider upgrade, I added your comment in the details so I'll make sure its included and verify it stays within the requirements of the ATO. Thank you both for bringing this to my attention, good catch.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not so sure that logic makes sense. If you change the code here, you will change the retention policy, regardless of whether you are just intending to upgrade provider versions.

Take a look at your most recent deploy: https://github.com/CDCgov/prime-simplereport/actions/runs/10953277197/job/30413331322#step:3:1

The terraform apply phase shows multiple places where we can see retention adjustments. There are also places where OMHS-placed tags are getting blown away. I don't think these changes can be propagated up to Prod in their current state.

Can we figure out what's going on here before we proceed further?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I misunderstood, and agree with waiting to push this forward. The resource @emyl3 referenced has to be added and figure out why the OMHS-placed tags are being removed during terraform apply.

Copy link

sonarcloud bot commented Sep 20, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants