1
0
Fork 0

module variable

This commit is contained in:
Cedric Girard 2020-05-13 10:45:51 +02:00
parent f5acff9695
commit d5c8bb24a0
Signed by: X-dark
GPG key ID: E7D0E125DB9519E4
2 changed files with 6 additions and 2 deletions

View file

@ -2,11 +2,14 @@ provider "aws" {
region = "eu-west-2" region = "eu-west-2"
} }
resource "aws_instance" "cedric-instance1" { variable "instance_name" {}
resource "aws_instance" "instance1" {
ami = "ami-01a6e31ac994bbc09" ami = "ami-01a6e31ac994bbc09"
instance_type = "t2.micro" instance_type = "t2.micro"
key_name = "cedric" key_name = "cedric"
tags = { tags = {
Name = "cedric-module-instance1" Name = "${var.instance_name}"
} }
} }

View file

@ -1,3 +1,4 @@
module "my_module" { module "my_module" {
source = "../module1" source = "../module1"
instance_name = "cedric-instance1"
} }