IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
342 stars 673 forks source link

`ibm_resource_key` data lookup fails when setting `provider_visability` to `private` #5828

Open ocofaigh opened 3 days ago

ocofaigh commented 3 days ago
2024/11/28 18:59:46 Terraform plan | Error: Get "https://private.resource-controller.cloud.ibm.com/v1/resource_keys": dial tcp: lookup private.resource-controller.cloud.ibm.com on 172.21.0.10:53: no such host
 2024/11/28 18:59:46 Terraform plan | 
 2024/11/28 18:59:46 Terraform plan |   with data.ibm_resource_key.elastic_credentials[0],
 2024/11/28 18:59:46 Terraform plan |   on main.tf line 190, in data "ibm_resource_key" "elastic_credentials":
 2024/11/28 18:59:46 Terraform plan |  190: data "ibm_resource_key" "elastic_credentials" {
 2024/11/28 18:59:46 Terraform plan | 
 2024/11/28 18:59:46 Terraform plan | ---
 2024/11/28 18:59:46 Terraform plan | id: terraform-b22cb499
 2024/11/28 18:59:46 Terraform plan | summary: 'Get
 2024/11/28 18:59:46 Terraform plan | "https://private.resource-controller.cloud.ibm.com/v1/resource_keys":
 2024/11/28 18:59:46 Terraform plan |   dial tcp: lookup private.resource-controller.cloud.ibm.com on 172.21.0.10:53: no
 2024/11/28 18:59:46 Terraform plan |   such host'
 2024/11/28 18:59:46 Terraform plan | severity: error
 2024/11/28 18:59:46 Terraform plan | resource: (Data) ibm_resource_key
 2024/11/28 18:59:46 Terraform plan | operation: read
 2024/11/28 18:59:46 Terraform plan | component:
 2024/11/28 18:59:46 Terraform plan |   name: github.com/IBM-Cloud/terraform-provider-ibm
 2024/11/28 18:59:46 Terraform plan |   version: 1.71.2
 2024/11/28 18:59:46 Terraform plan | ---

Community Note

Terraform CLI and Terraform IBM Provider Version

tf 1.9.2 ibm provider 1.71.2

Affected Resource(s)

Terraform Configuration Files

https://github.com/terraform-ibm-modules/terraform-ibm-rag-sample-da/blob/3375c65abf5222ea1efed40a106da2ca5d426ae8/solutions/banking/main.tf#L189-L194

Debug Output

Panic Output

Expected Behavior

No error

Actual Behavior

See error at top of issue

Steps to Reproduce

  1. terraform apply

Important Factoids

References

ocofaigh commented 2 days ago

@hkantare We also see this with the ibm_is_vpc data lookup. Can we get clarification on this? Are these bugs? Or known limitations that prevent us from using private visibility ?

2024-11-29T12:18:49.2570973Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1m[ERROR] Error Fetching vpc An error occurred while performing the 'authenticate' step: Post "https://private.iam.cloud.ibm.com/identity/token": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
2024-11-29T12:18:49.2573134Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0mnull
2024-11-29T12:18:49.2574034Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m�[0m
2024-11-29T12:18:49.2574890Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m
2024-11-29T12:18:49.2575954Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m�[0m  with data.ibm_is_vpc.vpc_by_id,
2024-11-29T12:18:49.2577255Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m  on main.tf line 25, in data "ibm_is_vpc" "vpc_by_id":
2024-11-29T12:18:49.2578613Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m  25: data "ibm_is_vpc" "vpc_by_id" �[4m{�[0m�[0m
2024-11-29T12:18:49.2580019Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m
2024-11-29T12:18:49.2580970Z TestRunVsiExtention 2024-11-29T12:18:49Z logger.go:66: �[31m│�[0m �[0m---
hkantare commented 6 hours ago

@ocofaigh Are these endpoints n't reachable when we run Terraform Actions from Schematics?