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

Terraform module updates #4692

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Terraform module updates #4692

wants to merge 7 commits into from

Conversation

asteel-gsa
Copy link
Contributor

@asteel-gsa asteel-gsa commented Feb 7, 2025

This PR encapsulates the necessary changes to upgrade our modules from v1.1.0 to v2.1.0 in sandbox. The process is detailed in the new doc docs/infra/terraform-module-upgrade.md

This will require 1-2 members of the team to do a call and walkthrough exactly what is happening behind the scenes. Once we move this into main, we will need to repeat these steps in preview on a call and ensure everything works the same way. Because we have to import the resource, I believe each environment will need changes to the main.tf file, and it is recommended that we proceed carefully.

My hunch at this time, is to perform these steps locally, run the apply locally, and then open a PR to keep things in sync.

For the new network policy for app -> clamav, I believe we will need to add this into the terraform for non-sandbox envs:

data "cloudfoundry_app" "fac-app" {
    name_or_id = "gsa-fac"
    space      = data.cloudfoundry_space.space.id
}

resource "cloudfoundry_network_policy" "app-network-policy" {
  provider = cloudfoundry-community
  policy {
    source_app      = data.cloudfoundy_app.fac-app.id
    destination_app = module.clamav.app_id
    port            = "61443"
    protocol        = "tcp"
  }
}

Sets the new provider into the terraform providers.tf and runs a dual provider setup,
forcing any resource that does not natively interact with the new provider using:

provider = cloudfoundry-community
- Removes app_name_or_id for network policies
- Reintroduces external network policy for clamav -> proxy
- Deployed successfully around 9a with v2.0.0 clamav module and was able to successfully
validate a file at around 916a without any issues
Copy link
Contributor

github-actions bot commented Feb 7, 2025

Terraform plan for dev

Plan: 1 to add, 0 to change, 1 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.dev.module.cors.null_resource.cors_header must be replaced
-/+ resource "null_resource" "cors_header" {
!~      id       = "*******************" -> (known after apply)
!~      triggers = { # forces replacement
!~          "always_run" = "2025-02-05T21:48:20Z" -> (known after apply)
        }
    }

Plan: 1 to add, 0 to change, 1 to destroy.

📝 Plan generated in Pull Request Checks #4352

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Terraform plan for meta

No changes. Your infrastructure matches the configuration.
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

📝 Plan generated in Pull Request Checks #4352

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
api 98% 90%
audit 97% 87%
audit.cross_validation 98% 88%
audit.fixtures 84% 50%
audit.intakelib 91% 82%
audit.intakelib.checks 92% 85%
audit.intakelib.common 98% 82%
audit.intakelib.transforms 100% 95%
audit.management.commands 78% 17%
audit.migrations 100% 100%
audit.models 94% 76%
audit.templatetags 100% 100%
audit.views 72% 54%
census_historical_migration 96% 65%
census_historical_migration.migrations 100% 100%
census_historical_migration.sac_general_lib 92% 84%
census_historical_migration.transforms 95% 90%
census_historical_migration.workbooklib 68% 69%
config 77% 37%
curation 100% 100%
curation.curationlib 93% 100%
curation.migrations 100% 100%
dissemination 91% 70%
dissemination.migrations 97% 25%
dissemination.searchlib 76% 66%
dissemination.templatetags 100% 100%
djangooidc 53% 38%
djangooidc.tests 100% 94%
report_submission 93% 88%
report_submission.migrations 100% 100%
report_submission.templatetags 74% 100%
support 91% 66%
support.migrations 100% 100%
support.models 96% 50%
tools 98% 50%
users 95% 92%
users.fixtures 100% 83%
users.management 100% 100%
users.management.commands 100% 100%
users.migrations 100% 100%
Summary 91% (18267 / 20043) 77% (2267 / 2952)

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.

1 participant