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

[DRAFT] Terraform Provider Upgrade (Checking Meta Plan) #4406

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

Conversation

asteel-gsa
Copy link
Contributor

Upgrades the provider in bootstrap, bootstrap-env, and meta modules, then regenerated the local files using meta module

Copy link
Contributor

github-actions bot commented Oct 22, 2024

Terraform plan for meta

Plan: 8 to add, 0 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create

Terraform will perform the following actions:

  # module.environments["dev"].local_file.main-tf will be created
+   resource "local_file" "main-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            # Add resources to this module describing what you want in the corresponding 
            # space in cloud.gov. You should probably just reference a shared module as in the
            # example below to keep consistency across spaces, but you can also vary the 
            # content for each environment as needed.
            
            module "dev" {
              source        = "../shared/modules/env"
              cf_space_name = "dev"
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../dev/dev.tf-example"
+       id                   = (known after apply)
    }

  # module.environments["dev"].local_file.providers-tf will be created
+   resource "local_file" "providers-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            terraform {
              required_version = "~> 1.0"
              required_providers {
                cloudfoundry = {
                  source  = "cloudfoundry-community/cloudfoundry"
                  version = "~>0.53.1"
                }
              }
            
              backend "s3" {
                # The rest of the backend parameters must be supplied when you initialize:
                #   terraform init --backend-config=../shared/config/backend.tfvars \
                #    --backend-config=key=terraform.tfstate.$(basename $(pwd))
                #
                # For more info, see:
                # https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration
                encrypt = "true"
              }
            }
            
            provider "cloudfoundry" {
              api_url  = "https://api.fr.cloud.gov"
              user     = var.cf_user
              password = var.cf_password
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../dev/providers-managed.tf"
+       id                   = (known after apply)
    }

  # module.environments["preview"].local_file.main-tf will be created
+   resource "local_file" "main-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            # Add resources to this module describing what you want in the corresponding 
            # space in cloud.gov. You should probably just reference a shared module as in the
            # example below to keep consistency across spaces, but you can also vary the 
            # content for each environment as needed.
            
            module "preview" {
              source        = "../shared/modules/env"
              cf_space_name = "preview"
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../preview/preview.tf-example"
+       id                   = (known after apply)
    }

  # module.environments["preview"].local_file.providers-tf will be created
+   resource "local_file" "providers-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            terraform {
              required_version = "~> 1.0"
              required_providers {
                cloudfoundry = {
                  source  = "cloudfoundry-community/cloudfoundry"
                  version = "~>0.53.1"
                }
              }
            
              backend "s3" {
                # The rest of the backend parameters must be supplied when you initialize:
                #   terraform init --backend-config=../shared/config/backend.tfvars \
                #    --backend-config=key=terraform.tfstate.$(basename $(pwd))
                #
                # For more info, see:
                # https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration
                encrypt = "true"
              }
            }
            
            provider "cloudfoundry" {
              api_url  = "https://api.fr.cloud.gov"
              user     = var.cf_user
              password = var.cf_password
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../preview/providers-managed.tf"
+       id                   = (known after apply)
    }

  # module.environments["production"].local_file.main-tf will be created
+   resource "local_file" "main-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            # Add resources to this module describing what you want in the corresponding 
            # space in cloud.gov. You should probably just reference a shared module as in the
            # example below to keep consistency across spaces, but you can also vary the 
            # content for each environment as needed.
            
            module "production" {
              source        = "../shared/modules/env"
              cf_space_name = "production"
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../production/production.tf-example"
+       id                   = (known after apply)
    }

  # module.environments["production"].local_file.providers-tf will be created
+   resource "local_file" "providers-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            terraform {
              required_version = "~> 1.0"
              required_providers {
                cloudfoundry = {
                  source  = "cloudfoundry-community/cloudfoundry"
                  version = "~>0.53.1"
                }
              }
            
              backend "s3" {
                # The rest of the backend parameters must be supplied when you initialize:
                #   terraform init --backend-config=../shared/config/backend.tfvars \
                #    --backend-config=key=terraform.tfstate.$(basename $(pwd))
                #
                # For more info, see:
                # https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration
                encrypt = "true"
              }
            }
            
            provider "cloudfoundry" {
              api_url  = "https://api.fr.cloud.gov"
              user     = var.cf_user
              password = var.cf_password
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../production/providers-managed.tf"
+       id                   = (known after apply)
    }

  # module.environments["staging"].local_file.main-tf will be created
+   resource "local_file" "main-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            # Add resources to this module describing what you want in the corresponding 
            # space in cloud.gov. You should probably just reference a shared module as in the
            # example below to keep consistency across spaces, but you can also vary the 
            # content for each environment as needed.
            
            module "staging" {
              source        = "../shared/modules/env"
              cf_space_name = "staging"
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../staging/staging.tf-example"
+       id                   = (known after apply)
    }

  # module.environments["staging"].local_file.providers-tf will be created
+   resource "local_file" "providers-tf" {
+       content              = <<-EOT
            # The content of this file is managed by Terraform. If you modify it, it may
            # be reverted the next time Terraform runs. If you want to make changes, do it
            # in ../meta/bootstrap-env/templates.
            
            terraform {
              required_version = "~> 1.0"
              required_providers {
                cloudfoundry = {
                  source  = "cloudfoundry-community/cloudfoundry"
                  version = "~>0.53.1"
                }
              }
            
              backend "s3" {
                # The rest of the backend parameters must be supplied when you initialize:
                #   terraform init --backend-config=../shared/config/backend.tfvars \
                #    --backend-config=key=terraform.tfstate.$(basename $(pwd))
                #
                # For more info, see:
                # https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration
                encrypt = "true"
              }
            }
            
            provider "cloudfoundry" {
              api_url  = "https://api.fr.cloud.gov"
              user     = var.cf_user
              password = var.cf_password
            }
        EOT
+       content_base64sha256 = (known after apply)
+       content_base64sha512 = (known after apply)
+       content_md5          = (known after apply)
+       content_sha1         = (known after apply)
+       content_sha256       = (known after apply)
+       content_sha512       = (known after apply)
+       directory_permission = "0777"
+       file_permission      = "0644"
+       filename             = "./../staging/providers-managed.tf"
+       id                   = (known after apply)
    }

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

Warning: Argument is deprecated

  with module.s3-backups.cloudfoundry_service_instance.bucket,
  on /tmp/terraform-data-dir/modules/s3-backups/s3/main.tf line 14, in resource "cloudfoundry_service_instance" "bucket":
  14:   recursive_delete = var.recursive_delete

Since CF API v3, recursive delete is always done on the cloudcontroller side.
This will be removed in future releases

📝 Plan generated in Pull Request Checks #3862

Copy link
Contributor

github-actions bot commented Oct 22, 2024

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" = "2024-10-22T12:25:56Z" -> (known after apply)
        }
    }

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

Warning: Argument is deprecated

  with module.dev-backups-bucket.cloudfoundry_service_instance.bucket,
  on /tmp/terraform-data-dir/modules/dev-backups-bucket/s3/main.tf line 14, in resource "cloudfoundry_service_instance" "bucket":
  14:   recursive_delete = var.recursive_delete

Since CF API v3, recursive delete is always done on the cloudcontroller side.
This will be removed in future releases

(and 6 more similar warnings elsewhere)

📝 Plan generated in Pull Request Checks #3862

@asteel-gsa
Copy link
Contributor Author

asteel-gsa commented Oct 24, 2024

Reran this locally, and received the following, using the management deployer account.

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.

@mogul does this look right to you? Is the bootstrap module expected to be rerun in git, and then post merge it will have no more meta changes? These files were auto generated with meta module calling resource "local_file" "providers-tf" Meta TF Plan

Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
api 98% 90%
audit 97% 87%
audit.cross_validation 98% 86%
audit.fixtures 84% 50%
audit.intakelib 90% 81%
audit.intakelib.checks 92% 85%
audit.intakelib.common 98% 82%
audit.intakelib.transforms 100% 94%
audit.management.commands 78% 17%
audit.migrations 100% 100%
audit.models 93% 75%
audit.templatetags 100% 100%
audit.views 61% 39%
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 78% 17%
curation 100% 100%
curation.curationlib 57% 100%
curation.migrations 100% 100%
dissemination 91% 72%
dissemination.migrations 97% 25%
dissemination.searchlib 74% 64%
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 95% 78%
support.management.commands 96% 100%
support.migrations 100% 100%
support.models 97% 83%
tools 98% 50%
users 98% 100%
users.fixtures 100% 83%
users.management 100% 100%
users.management.commands 100% 100%
users.migrations 100% 100%
Summary 91% (17135 / 18910) 77% (2112 / 2760)

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