-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacqa-repo1-aws-tf12-part2.tf
154 lines (152 loc) · 4.61 KB
/
acqa-repo1-aws-tf12-part2.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Part1 and Part2 need to be used together in an environment. Part1 has the provider, so Part2 doesn't need it. Hence commenting.
provider "aws" {
region = "ca-central-1" //Canada
}
# Create AWS Certificate Manager
resource "aws_acm_certificate" "acqa-test-acm1" {
domain_name = "acqatest.com"
validation_method = "DNS"
tags = var.tags
lifecycle {
create_before_destroy = true
}
}
# Create SSM parameter resource
resource "aws_ssm_parameter" "acqa-test-ssmparam3" {
name = "acqa-test-ssmparam3"
type = "String"
value = "bar"
tags = var.tags
}
# Create customer gateway
resource "aws_customer_gateway" "acqa-test-cgateway1" {
bgp_asn = 65000
ip_address = "172.83.124.10"
type = "ipsec.1"
# Tags
tags = var.tags
}
#Transit Gateway
resource "aws_ec2_transit_gateway" "acqa-test-ec2-tgateway1" {
description = "acqa-test-ec2-tgateway1"
# Tags
tags = var.tags
}
# Budget
resource "aws_budgets_budget" "acqa-test-budget3" {
name = "acqa-test-budget3"
budget_type = "COST"
limit_amount = "1200.0"
limit_unit = "USD"
time_period_end = "2087-06-15_00:00"
time_period_start = "2017-07-01_00:00"
time_unit = "MONTHLY"
cost_filters = {
Service = "Amazon Elastic Compute Cloud - Compute"
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 100
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["test@example.com"]
}
}
# IOT Thing
resource "aws_iot_thing" "acqa-test-iotthing1" {
name = "acqa-test-iotthing1"
attributes = {
First = "acqa-test-iotthing1"
}
}
# Cloud9 Environment
resource "aws_cloud9_environment_ec2" "acqa-test-c9ev3" {
instance_type = "t2.micro"
name = "acqa-test-c9ev3"
# Tags
tags = var.tags
}
# # RDS - Mysql
# resource "aws_db_instance" "acqatestrdsmysqlone" {
# allocated_storage = 200
# identifier = "acqatestrdsmysqlone"
# storage_type = "gp2"
# engine = "mysql"
# engine_version = "5.7"
# instance_class = "db.m5.xlarge"
# name = "acqatestrdsmysqlone"
# username = "foo"
# password = "foobarbaz"
# parameter_group_name = "default.mysql5.7"
# tags = {
# ACQAResource = "true"
# Name = "acqatestrdsmysqlone"
# Owner = "ACQA"
# }
# skip_final_snapshot = true
# final_snapshot_identifier = "acqatestrdsmysqlonesnapshot"
# domain = "<domain>"
# # enabled_cloudwatch_logs_exports = "<enabled_cloudwatch_logs_exports>"
# storage_encrypted = true
# performance_insights_enabled = true
# backup_retention_period = 30
# deletion_protection = true
# }
# # RDS - PGSQL
# resource "aws_db_instance" "acqatestrdspgsqlone" {
# allocated_storage = 200
# identifier = "acqatestrdspgsqlone"
# storage_type = "gp2"
# engine = "postgres"
# engine_version = "13.4"
# instance_class = "db.m5.xlarge"
# name = "acqatestrdspgsqlone"
# username = "foo"
# password = "foobarbaz"
# parameter_group_name = "default.postgres9.6"
# tags = {
# ACQAResource = "true"
# Name = "acqatestrdspgsqlone"
# Owner = "ACQA"
# }
# skip_final_snapshot = true
# final_snapshot_identifier = "acqatestrdspgsqlonesnapshot"
# domain = "<domain>"
# # enabled_cloudwatch_logs_exports = "<enabled_cloudwatch_logs_exports>"
# storage_encrypted = true
# performance_insights_enabled = true
# backup_retention_period = 30
# deletion_protection = true
# }
resource "aws_security_group" "km_alb_sg1" {
name = "km_alb_sg1"
description = "controls access to the ALB"
vpc_id = "vpc-0dcfc6c7488b848c7"
ingress {
protocol = "tcp"
from_port = 443
to_port = 443
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
# Example SES Domain Identity
resource "aws_ses_domain_identity" "acqa-test-asdi1" {
domain = "acqatestasdi1.com"
}
# Simple Email Service Domain
resource "aws_ses_domain_mail_from" "acqa-test-sesdom1" {
domain = aws_ses_domain_identity.acqa-test-asdi1.domain
mail_from_domain = "bounce.${aws_ses_domain_identity.acqa-test-asdi1.domain}"
}