cloud
入力変数を受け入れ、それに応じて適用するクロスクラウド Terraform モジュール (Google および aws 用) を作成しています。次に例を示します。
variable "cloud" {}
resource "google_example" {
count = "${var.cloud == "google" ? 1 : 0}"
}
resource "aws_example" {
count = "${var.cloud == "aws" ? 1 : 0}"
}
このアプローチの問題は、両方ではなく、選択したクラウドの資格情報のみを提供したいということです-cloud=aws
たとえば、次の設定を取得します。
Error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
選択されていないクラウドのクラウド プロバイダー資格情報を偽造する方法はありますか? または、ある種の Terraform テンプレートを実装する必要がありますか?