Skip to content

(#38) Update project and vpc modules to TF 13 #46

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

Merged
merged 5 commits into from
Feb 1, 2021
Merged

Conversation

jeffmccune
Copy link
Member

This patch upgrades the CFT Project Factory and Network modules for use
with Terraform 13.

Closes: #38

@jeffmccune jeffmccune added the enhancement New feature or request label Feb 1, 2021
@jeffmccune jeffmccune self-assigned this Feb 1, 2021
Apply these versions with TF 0.12 and then TF 0.13 to avoid the
following error.

```
Error: Provider configuration not present

To work with
module.host.module.project.module.project-factory.null_resource.preconditions
its original provider configuration at
provider["registry.terraform.io/-/null"] is required, but it has been removed.
This occurs when a provider configuration is removed while objects created by
that provider still exist in the state. Re-add the provider configuration to
destroy
module.host.module.project.module.project-factory.null_resource.preconditions,
after which you can remove the provider configuration again.
```

Changes are expected:

```
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.host.module.project.module.project-factory.null_resource.preconditions will be destroyed
  - resource "null_resource" "preconditions" {
      - id       = "8839499245402532934" -> null
      - triggers = {
          - "billing_account"  = "XXXXXXXXXXXXXXXXXXXX"
          - "credentials_path" = ""
          - "folder_id"        = "folders/XXXXXXXXXXXX"
          - "org_id"           = "XXXXXXXXXXXX"
          - "shared_vpc"       = ""
        } -> null
    }

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

Do you want to perform these actions in workspace "dev"?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.host.module.project.module.project-factory.null_resource.preconditions: Destroying... [id=8839499245402532934]
module.host.module.project.module.project-factory.null_resource.preconditions: Destruction complete after 0s
```
Also run `terraform 0.13upgrade` to generate version information.
Without this patch autoscaling is enabled even when running
`num_instances=0` with the multiregion example.
Fix the following warning with 0.13.6

```
Warning: Interpolation-only expressions are deprecated

  on ../../modules/50_compute/main.tf line 33, in data "template_file" "startup-script-config":
  33:   template = "${file("${path.module}/templates/startup-script-config.tpl")}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.
```
@jeffmccune jeffmccune merged commit 165fad5 into main Feb 1, 2021
@jeffmccune jeffmccune deleted the jm/38_tf13 branch February 1, 2021 21:48
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
None yet
Development

Successfully merging this pull request may close these issues.

Terraform 0.13 compatibility
1 participant