terraform-google-modules / terraform-example-foundation

Shows how the CFT modules can be composed to build a secure cloud foundation
https://cloud.google.com/architecture/security-foundations
Apache License 2.0
1.2k stars 706 forks source link

When running the "plan" on 1-org there are a number of warnings flagging potential issues downstream #1188

Closed mromascanu123 closed 3 months ago

mromascanu123 commented 4 months ago

TL;DR

When running ./tf-wrapper plan production on 1-org here are some of the errors and warnings we observe in the log. Can't tell if benign or "by design" but it's worrying

2024-04-11T13:12:51.304Z [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]

2024-04-11T13:13:38.320Z [DEBUG] provider.terraform-provider-google_v4.84.0_x5: 2024/04/11 13:13:38 [DEBUG] Read bucket bkt-prj-c-logging-3n5z-org-logs-a0f7 at location https://www.googleapis.com/storage/v1/b/bkt-prj-c-logging-3n5z-org-logs-a0f7 2024-04-11T13:13:38.321Z [DEBUG] provider.terraform-provider-google_v4.84.0_x5 2024-04-11T13:13:38.330Z [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for module.logs_export.module.destination_storage[0].google_storage_bucket.bucket, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

2024-04-11T13:13:39.151Z [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for module.logs_export.module.destination_logbucket[0].google_logging_linked_dataset.linked_dataset[0], but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

Expected behavior

Clean execution of "plan" phase

Observed behavior

Errors and warnings which might be environment-related or code-related, hard to say

Terraform Configuration

Nothing special (see attached screenshot)

Terraform Version

$ terraform version
Terraform v1.6.0
on linux_amd64

Additional information

terraform_tfvars

daniel-cit commented 3 months ago

See No provider config schema available message for builtin provider should not be labelled ERROR in output

See Context around the log entry “…tolerating it because it is using the legacy plugin SDK.”

eeaton commented 3 months ago

Thanks for the investigation Daniel. To the best of my understanding from the errors and links, it looks like the root cause is upstream in the Google provider.

From another thread I found the following. """The latest version of the hashicorp/aws provider is still using the legacy SDK for a lot of resource types, because that provider is very large and most of it was written a long time ago. Therefore seeing this warning would be expected for most resource types in that provider."""

Although the comment is about the AWS provider, I expect the explanation is likely consistent with the Google provider. It does not look like something we can address in this repo, until the upstream provider removes all dependencies on the legacy SDK.

I'll close this issue, but please re-open if there are any concerns.