terraform --version
Terraform v0.13.0-beta3
+ provider kyma-project.io/kyma-incubator/gardener v0.0.9
+ provider registry.terraform.io/hashicorp/helm v1.2.3
+ provider registry.terraform.io/hashicorp/kubernetes v1.11.3
+ provider registry.terraform.io/hashicorp/local v1.4.0
+ provider registry.terraform.io/hashicorp/tls v2.1.1
main.tf
├── main.tf
├── modules
│ ├── flux
│ │ ├── chart-values
│ │ │ ├── flux-helm-operator-values.yaml.tpl
│ │ │ └── flux-values.yaml.tpl
│ │ ├── locals.tf
│ │ ├── main.tf
│ │ ├── providers.tf
│ │ ├── templates
│ │ │ ├── artifactory-chart-repo-list-development.tpl
│ │ │ ├── artifactory-chart-repo-list-poc.tpl
│ │ │ └── artifactory-chart-repo-list-staging.tpl
│ │ ├── variables.tf
│ │ └── version.tf
│ └── sealed-secrets
│ ├── chart-values
│ │ └── sealed-secrets-values.yaml.tpl
│ ├── locals.tf
│ ├── main.tf
│ ├── outputs.tf
│ ├── providers.tf
│ ├── variables.tf
│ └── version.tf
main.tf
terraform {
required_version = ">= 0.13.0"
required_providers {
gardener = {
source = "kyma-project.io/kyma-incubator/gardener"
version = "0.0.9"
}
}
}
module "sealed-secrets" {
source = "./modules/sealed-secrets"
shoot_credentials_file_path = module.base.shoot_credentials_file_path
adm_namespace_name = module.base.adm_namespace
sealed_secrets_chart_version = var.sealed_secrets_chart_version
sealed_secrets_image_version = var.sealed_secrets_image_version
depends_on = [module.base]
}
module "flux" {
source = "./modules/flux"
shoot_credentials_file_path = module.base.shoot_credentials_file_path
flux_chart_version = var.flux_chart_version
flux_helm_operator_chart_version = var.flux_helm_operator_chart_version
flux_image_version = var.flux_image_version
flux_helm_operator_image_version = var.flux_helm_operator_image_version
flux_gitops_auth_user = var.flux_gitops_auth_user
flux_gitops_auth_key = var.flux_gitops_auth_key
flux_git_repo_url = var.flux_git_repo_url
flux_git_branch = var.flux_git_branch
flux_git_paths = var.flux_git_paths
flux_git_label = var.flux_git_label
artifactory_helm_repo_url = var.artifactory_helm_repo_url
artifactory_helm_repo_username = var.artifactory_helm_repo_username
artifactory_helm_repo_password = var.artifactory_helm_repo_password
artifactory_helm_repo_environment = var.artifactory_helm_repo_environment
depends_on = [module.sealed-secrets]
}
cat modules/flux/providers.tf
provider "helm" {
kubernetes {
config_path = var.shoot_credentials_file_path
load_config_file = "true"
}
}
provider "kubernetes"{
alias = "shootconfig"
config_path = var.shoot_credentials_file_path
load_config_file = "true"
}
Error: Module does not support depends_on
on main.tf line 82, in module "sealed-secrets":
82: source = "./modules/sealed-secrets"
Module "sealed-secrets" cannot be used with depends_on because it contains a
nested provider configuration for "kubernetes.shootconfig", at
modules/sealed-secrets/providers.tf:8,10-22.
This module can be made compatible with depends_on by changing it to receive
all of its provider configurations from the calling module, by using the
"providers" argument in the calling module block.
Error: Module does not support depends_on
on main.tf line 91, in module "flux":
91: source = "./modules/flux"
Module "flux" cannot be used with depends_on because it contains a nested
provider configuration for "helm", at modules/flux/providers.tf:1,10-16.
This module can be made compatible with depends_on by changing it to receive
all of its provider configurations from the calling module, by using the
"providers" argument in the calling module block.
Error: Module does not support depends_on
on main.tf line 91, in module "flux":
91: source = "./modules/flux"
Module "flux" cannot be used with depends_on because it contains a nested
provider configuration for "kubernetes.shootconfig", at
modules/flux/providers.tf:8,10-22.
This module can be made compatible with depends_on by changing it to receive
all of its provider configurations from the calling module, by using the
"providers" argument in the calling module block.
My Question is how do i organize the provider for the modules. ? since it is a common connection setting for each module.
Kevin
1 post - 1 participant