File tree 3 files changed +13
-1
lines changed
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
# - SECURITY GROUPS ---------------------------------------------------- #
2
2
3
3
resource "aws_security_group" "alpha_ec2" {
4
+ # WARNING: generation was aws_vpc.ec2 => need to be aws_vpc.vpc
4
5
depends_on = [aws_vpc . alpha ]
5
6
name = " ${ lookup (var. global , " name" )} -ec2"
6
7
description = " ${ lookup (var. global , " name" )} -ec2"
Original file line number Diff line number Diff line change 1
1
variable "global" {
2
2
type = map (string )
3
3
default = {
4
+ # WARN: need to be alpha-lowercase with comma: NO spaces or Uppercase
4
5
name = " tfgui-alpha"
5
6
region = " us-east-1"
6
7
}
@@ -9,17 +10,22 @@ variable "global" {
9
10
variable "vpc" {
10
11
type = map (string )
11
12
default = {
13
+ # WARN: need to be 'default'
12
14
tenancy = " default"
13
15
cidr = " 10.0.0.0/24"
14
16
pub_subnet = " 10.0.0.128/26"
15
17
prv_subnet = " 10.0.0.192/26"
16
- eip_vpc = true
18
+ # to be added respectively in public and private
19
+ pub_availability_zone = " us-east-1a"
20
+ prv_availability_zone = " us-east-1b"
21
+ eip_vpc = true
17
22
}
18
23
}
19
24
20
25
variable "ec2" {
21
26
type = map (string )
22
27
default = {
28
+ # WARN: need to be specific IDs (maybe use select form)
23
29
ami = " ami-052efd3df9dad4825"
24
30
type = " t2.micro"
25
31
public_ip = true
@@ -41,6 +47,7 @@ variable "rds" {
41
47
version = " 13"
42
48
family = " postgres13"
43
49
username = " alpha"
50
+ # WARN: need to be > 8 characters
44
51
password = " alphaalphaalpha"
45
52
publicly_accessible = false
46
53
skip_final_snapshot = true
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ resource "aws_nat_gateway" "alpha" {
39
39
resource "aws_subnet" "alpha_pub" {
40
40
vpc_id = aws_vpc. alpha . id
41
41
cidr_block = lookup (var. vpc , " pub_subnet" )
42
+ # new var added in vpc group
43
+ availability_zone = lookup (var. vpc , " pub_availability_zone" )
42
44
tags = {
43
45
Name = " ${ lookup (var. global , " name" )} -vpc-pub"
44
46
}
@@ -47,6 +49,8 @@ resource "aws_subnet" "alpha_pub" {
47
49
resource "aws_subnet" "alpha_prv" {
48
50
vpc_id = aws_vpc. alpha . id
49
51
cidr_block = lookup (var. vpc , " prv_subnet" )
52
+ # new var added in vpc group
53
+ availability_zone = lookup (var. vpc , " prv_availability_zone" )
50
54
tags = {
51
55
Name = " ${ lookup (var. global , " name" )} -vpc-prv"
52
56
}
You can’t perform that action at this time.
0 commit comments