tetratelabs / tetrate-service-bridge-sandbox

Deploy Tetrate Service Bridge Demo on Azure Kubernetes Service (AKS), Google Kubernetes Engine (GKE) and/or Elastic Kubernetes Service (EKS) using Terraform
Apache License 2.0
12 stars 10 forks source link

Only require providers that are actually used #124

Closed nacx closed 2 years ago

nacx commented 2 years ago

When deploying an MP, access to cloud providers is required (AWS, Azure, Google), to retrieve the remote state and load the register_fqn modules. However, we should only require the tooling to be configured for the providers being actually used. For example, when using a full GCP setup and trying to just deploy an MP to GCP, the following errors appear as it attempts to get info from AWS and Azure anyway:

 Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request send failed, Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: connect: host is down
│ 
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on <empty> line 0:
│   (source code not available)
│ 
╵
╷
│ Error: building account: getting authenticated object ID: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2022-01-13T08:57:31.0489514Z and was inactive for 90.00:00:00.
│ Trace ID: e72376a9-89be-43fc-8a74-e03f905e1d00
│ Correlation ID: 3267c560-ae12-4b5e-b5c3-350e4593422d
│ Timestamp: 2022-10-17 22:08:15Z
│ To re-authenticate, please run:
│ az login --scope https://graph.microsoft.com//.default
│ 
│   with provider["registry.terraform.io/hashicorp/azurerm"],
│   on providers.tf line 31, in provider "azurerm":
│   31: provider "azurerm" {
│