File tree Expand file tree Collapse file tree 3 files changed +33
-8
lines changed
ecs-fargate-wordpress-rds-terraform Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,16 @@ resource "aws_ecs_cluster" "default" {
2
2
name = " ${ var . ecs_cluster_name } "
3
3
}
4
4
5
+ resource "aws_cloudwatch_log_group" "ecs_log_group" {
6
+ name = " /ecs/wp-ecs-tf"
7
+ retention_in_days = 7
8
+
9
+ tags = {
10
+ Environment = " production"
11
+ Application = " wp"
12
+ }
13
+ }
14
+
5
15
data "aws_iam_role" "existing_ecs_task_execution_role" {
6
16
name = " ecsTaskExecutionRole"
7
17
}
Original file line number Diff line number Diff line change 1
- variable "region" {
2
- description = " AWS Region"
3
- default = " your-region"
4
- }
5
-
6
1
variable "aws_access_key" {
7
2
description = " AWS access key"
8
3
default = " your-access-key"
@@ -13,6 +8,26 @@ variable "aws_secret_key" {
13
8
default = " your-secret-key"
14
9
}
15
10
11
+ variable "region" {
12
+ description = " AWS Region"
13
+ default = " us-east-1"
14
+ }
15
+
16
+ variable "zone1" {
17
+ description = " AWS Zone 1"
18
+ default = " us-east-1a"
19
+ }
20
+
21
+ variable "zone2" {
22
+ description = " AWS Zone 2"
23
+ default = " us-east-1b"
24
+ }
25
+
26
+ variable "zone3" {
27
+ description = " AWS Zone 3"
28
+ default = " us-east-1c"
29
+ }
30
+
16
31
// VPC
17
32
variable "vpc_cidr_block" {
18
33
description = " VPC network"
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ resource "aws_internet_gateway" "default" {
21
21
resource "aws_subnet" "wp-public-a-tf" {
22
22
vpc_id = " ${ aws_vpc . default . id } "
23
23
cidr_block = " ${ var . public_subnet_a_cidr_block } "
24
- availability_zone = " ap-southeast-2a "
24
+ availability_zone = " ${ var . zone1 } "
25
25
26
26
tags = {
27
27
Name = " wp-public-a-tf"
@@ -31,7 +31,7 @@ resource "aws_subnet" "wp-public-a-tf" {
31
31
resource "aws_subnet" "wp-public-b-tf" {
32
32
vpc_id = " ${ aws_vpc . default . id } "
33
33
cidr_block = " ${ var . public_subnet_b_cidr_block } "
34
- availability_zone = " ap-southeast-2b "
34
+ availability_zone = " ${ var . zone2 } "
35
35
36
36
tags = {
37
37
Name = " wp-public-b-tf"
@@ -41,7 +41,7 @@ resource "aws_subnet" "wp-public-b-tf" {
41
41
resource "aws_subnet" "wp-public-c-tf" {
42
42
vpc_id = " ${ aws_vpc . default . id } "
43
43
cidr_block = " ${ var . public_subnet_c_cidr_block } "
44
- availability_zone = " ap-southeast-2c "
44
+ availability_zone = " ${ var . zone3 } "
45
45
46
46
tags = {
47
47
Name = " wp-public-c-tf"
You can’t perform that action at this time.
0 commit comments