File tree 2 files changed +18
-10
lines changed 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1
1
provider "aws" {
2
- region = " eu-west-1 "
2
+ region = local . region
3
3
}
4
4
5
5
locals {
6
6
name = " app"
7
7
environment = " test"
8
+ region = " eu-west-1"
8
9
}
9
10
10
11
# #-----------------------------------------------------------------------------
11
12
# # Vpc Module call.
12
13
# #-----------------------------------------------------------------------------
13
14
module "vpc" {
14
- source = " clouddrove/vpc/aws"
15
- version = " 2.0.0"
16
- name = local. name
17
- environment = local. environment
15
+ source = " clouddrove/vpc/aws"
16
+ version = " 2.0.0"
17
+
18
+ enable = true
19
+ name = local. name
20
+ environment = local. environment
21
+
18
22
cidr_block = " 10.0.0.0/16"
19
23
enable_flow_log = true # Flow logs will be stored in cloudwatch log group. Variables passed in default.
20
24
create_flow_log_cloudwatch_iam_role = true
@@ -31,11 +35,15 @@ module "vpc" {
31
35
# tfsec:ignore:aws-ec2-no-excessive-port-access
32
36
# tfsec:ignore:aws-ec2-no-public-ingress-acl
33
37
module "subnets" {
34
- source = " ./../../"
35
- name = local. name
36
- environment = local. environment
38
+ source = " ./../../"
39
+
40
+ enable = true
41
+ name = local. name
42
+ environment = local. environment
43
+
37
44
nat_gateway_enabled = true
38
- availability_zones = [" eu-west-1a" , " eu-west-1b" , " eu-west-1c" ]
45
+ single_nat_gateway = true
46
+ availability_zones = [" ${ local . region } a" , " ${ local . region } b" , " ${ local . region } c" ]
39
47
vpc_id = module. vpc . vpc_id
40
48
type = " public-private"
41
49
igw_id = module. vpc . igw_id
Original file line number Diff line number Diff line change 7
7
locals {
8
8
public_count = var. enable == true && (var. type == " public" || var. type == " public-private" ) ? length (var. availability_zones ) : 0
9
9
private_count = var. enable == true && (var. type == " private" || var. type == " public-private" ) ? length (var. availability_zones ) : 0
10
- nat_gateway_count = var. single_nat_gateway ? 1 : (var. enable == true && (var. type == " private" || var. type == " public-private" ) && var. nat_gateway_enabled == true ? length (var. availability_zones ) : 0 )
10
+ nat_gateway_count = var. enable == true && var . single_nat_gateway ? 1 : (var. enable == true && (var. type == " private" || var. type == " public-private" ) && var. nat_gateway_enabled == true ? length (var. availability_zones ) : 0 )
11
11
}
12
12
# #-----------------------------------------------------------------------------
13
13
# # Labels module called that will be used for naming and tags.
You can’t perform that action at this time.
0 commit comments