shalb / cluster.dev

Cloud-native infrastructure templating. Creating cloud installers for SaaS. Replication of complex cloud-native infrastructures.
https://docs.cluster.dev/
GNU Affero General Public License v3.0
401 stars 36 forks source link

Support for required_providers block inside terraform #202

Open romanprog opened 1 year ago

romanprog commented 1 year ago

Now (deprecated in terraform >1.0):

provider "aws" {
  region  = "eu-central-1"
  version = "4.67.0"
}

Should be:

provider "aws" {
  region  = "eu-central-1"
}

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

Cdev unit code example:

  -
    name: redis-{{ $name }}
    type: tfmodule
    providers:
    - aws:
        region: {{ $variables.region }}
    required_providers:
    - aws:
        source: "hashicorp/aws"
        version: "4.67.0"
    source: cloudposse/elasticache-redis/aws
    version: "0.49.0"
    inputs:
      zone_id: []