ilyesedina / Terraform

12 hands on labs from a Terraform course to improve my skills
0 stars 0 forks source link

DPQUAL-614/ Sixth Lab #11

Closed dkEdiIly closed 8 months ago

dkEdiIly commented 8 months ago

Terraform Modules

Reference server module terraform/server/server.tf from the root configuration file See witch directories are being recognized by terraform run terraform providers

Providers required by configuration:
├── provider[registry.terraform.io/hashicorp/local] 2.1.0
├── provider[registry.terraform.io/hashicorp/tls] 3.1.0
├── provider[registry.terraform.io/hashicorp/aws] ~> 4.0
├── provider[registry.terraform.io/hashicorp/http] ~> 2.1.0
├── provider[registry.terraform.io/hashicorp/random] ~> 3.1.0
├── module.server
│   └── provider[registry.terraform.io/hashicorp/aws]
└── module.subnet_addrs

terraform state list to see the newly created resources terraform state show module.server.aws_instance.web

Terraform Module Sources

Official doc

tree to see the folder structure

├── MyAWSKey.pem
├── credentials.auto.tfvars
├── main.tf
├── modules
│   └── server
│       └── server.tf
├── output.tf
├── providers.tf
├── readme.md
├── terraform.tfstate
├── terraform.tfstate.backup
├── terraform.tfstate.d
│   └── development
│       ├── terraform.tfstate
│       └── terraform.tfstate.backup
├── variables.tf
└── versions.tf

Terraform Module Scope

Resources within Child Modules

terraform console
> module.autoscaling

Terraform Module Versions

Terraform assumes version numbers follow the Semantic Versioning 2.0 convention. Major.Minor.Patch