File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 1
- provider "aws" {
2
- region = " us-west-2"
3
- }
4
-
5
1
# #############################################################
6
2
# Data sources to get VPC, subnets and security group details
7
3
# #############################################################
8
- data "aws_vpc" "default" {
9
- default = true
4
+ data "aws_vpc" "vpc" {
5
+ tags {
6
+ Env = " ${ var . environment } "
7
+ }
10
8
}
11
9
12
10
data "aws_subnet_ids" "all" {
13
- vpc_id = " ${ data . aws_vpc . default . id } "
11
+ vpc_id = " ${ data . aws_vpc . vpc . id } "
14
12
}
15
13
16
14
data "aws_security_group" "default" {
17
- vpc_id = " ${ data . aws_vpc . default . id } "
15
+ vpc_id = " ${ data . aws_vpc . vpc . id } "
18
16
name = " default"
19
17
}
20
18
@@ -44,7 +42,8 @@ data "aws_ami" "amazon_linux" {
44
42
module "example_asg" {
45
43
source = " ../../"
46
44
47
- name = " example-with-elb"
45
+ name = " example-with-elb"
46
+ environment = " ${ var . environment } "
48
47
49
48
# Launch configuration
50
49
#
@@ -82,7 +81,7 @@ module "example_asg" {
82
81
desired_capacity = 1
83
82
wait_for_capacity_timeout = 0
84
83
85
- tags = [
84
+ tags_ag = [
86
85
{
87
86
key = " Environment"
88
87
value = " dev"
You can’t perform that action at this time.
0 commit comments