[PATCH v3 08/36] terraform/oci: Work around oracle/oci provider bug
Chuck Lever <[email protected]>
| Newsgroups | dev.linux.lists.kdevops |
|---|---|
| Message-ID | <[email protected]> |
From: Chuck Lever <[email protected]> First, I was getting module.volumes[0].oci_core_volume.kdevops_volume_extra[0]: Creating... ╷ │ Error: 400-CannotParseRequest, Incorrectly formatted request. Please refer to our documentation for help. No idea why, though maybe this is the first time I've tried using us-east1 when my home region is us-central. Nothing I tried changed this result, and there's no obvious problem with the way that the oci_core_volume resource is specified, which hasn't changed in many months. All documentation I consulted stated that because the root module explicitly specifies exactly one provider, child modules are supposed to inherit that provider. But that isn't happening here: $ terraform providers Providers required by configuration: . ├── provider[registry.terraform.io/oracle/oci] ~> 6.0 └── module.volumes └── provider[registry.terraform.io/hashicorp/oci] And looks like it's a bug that was never fixed: https://github.com/oracle/terraform-provider-oci/issues/1608 The only workaround I understood was to switch the root module back to using the hashicorp/oci provider so that the root and "volumes" module use the same provider. Reviewed-by: Luis Chamberlain <[email protected]> Signed-off-by: Chuck Lever <[email protected]> --- terraform/oci/provider.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/oci/provider.tf b/terraform/oci/provider.tf index 08d0d2c526c6..610d2059577a 100644 --- a/terraform/oci/provider.tf +++ b/terraform/oci/provider.tf @@ -2,8 +2,8 @@ terraform { required_version = ">= 0.12.6" required_providers { oci = { - source = "oracle/oci" - version = "~> 6" + source = "hashicorp/oci" + version = "> 7" } } } -- 2.51.0