GithubHelp home page GithubHelp logo

jnavarrof / terraform-module-versions Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

An example how to use different provider versions accross modules and root module.

Makefile 15.23% HCL 30.39% Shell 54.39%

terraform-module-versions's Introduction

Using Terraform provider modules versions

An example how to use different provider versions accross modules and root module.

Generate terraform projects

A make rule will generate two terraform example projects (projec0 and project1) using two different terraform modules.

$ make generate
scripts/generate.sh

$tree -L 2 -d development                                                        
development
├── project0
└── project1

3 directories

Example: Compatible project

This example shows an example of one project using compatible module versions, accross all modules and root version.

$ cd development/project0
$ terraform init 
Initializing modules...
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/null versions matching ">= 2.0.0, ~> 3.0, < 3.2.0"...
- Installing hashicorp/null v3.1.1...
- Installed hashicorp/null v3.1.1 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Example: Project with modules using incompatible provider

This example shows an example of one project using incompatible module versions that cannot be solved by terraform during the terrarform init step.

$ cd development/project1
$ terraform init     
Initializing modules...
- module1 in ../../modules/no-resource
- module2 in ../../modules/no-resource-new

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/null versions matching ">= 2.0.0, ~> 3.0, < 3.0.0, < 3.2.0"...
╷
│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider hashicorp/null: no available releases match the given constraints >= 2.0.0, ~> 3.0, < 3.0.0, < 3.2.0

terraform-module-versions's People

Contributors

jnavarrof avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.