module variable
This commit is contained in:
parent
f5acff9695
commit
d5c8bb24a0
2 changed files with 6 additions and 2 deletions
|
@ -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}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
module "my_module" {
|
module "my_module" {
|
||||||
source = "../module1"
|
source = "../module1"
|
||||||
|
instance_name = "cedric-instance1"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue