-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathiam_role_policy_attachment.tf
113 lines (96 loc) · 4.38 KB
/
iam_role_policy_attachment.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
#########################################
# IAM Role Attachment for RDS Monitoring
#########################################
resource "aws_iam_role_policy_attachment" "rds_enhanced_monitoring" {
role = "${aws_iam_role.rds_enhanced_monitoring.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole"
}
#########################################
# IAM Role Attachment for bastion
#########################################
resource "aws_iam_role_policy_attachment" "bastion_service_role1" {
role = "${aws_iam_role.bastion_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
}
resource "aws_iam_role_policy_attachment" "bastion_service_role2" {
role = "${aws_iam_role.bastion_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/AmazonS3FullAccess"
}
resource "aws_iam_role_policy_attachment" "bastion_service_role3" {
role = "${aws_iam_role.bastion_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchLogsFullAccess"
}
resource "aws_iam_role_policy_attachment" "bastion_service_role4" {
role = "${aws_iam_role.bastion_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchEventsFullAccess"
}
resource "aws_iam_role_policy_attachment" "bastion_service_role5" {
role = "${aws_iam_role.bastion_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/AmazonInspectorFullAccess"
}
#########################################
# IAM Role Attachment for app
#########################################
resource "aws_iam_role_policy_attachment" "app_service_role1" {
role = "${aws_iam_role.app_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
}
resource "aws_iam_role_policy_attachment" "app_service_role2" {
role = "${aws_iam_role.app_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/AmazonS3FullAccess"
}
resource "aws_iam_role_policy_attachment" "app_service_role3" {
role = "${aws_iam_role.app_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchLogsFullAccess"
}
resource "aws_iam_role_policy_attachment" "app_service_role4" {
role = "${aws_iam_role.app_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchEventsFullAccess"
}
resource "aws_iam_role_policy_attachment" "app_service_role5" {
role = "${aws_iam_role.app_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/AmazonInspectorFullAccess"
}
#########################################
# IAM Role Attachment for container
#########################################
resource "aws_iam_role_policy_attachment" "container_service_role1" {
role = "${aws_iam_role.container_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
}
resource "aws_iam_role_policy_attachment" "container_service_role2" {
role = "${aws_iam_role.container_instance.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
}
#########################################
# IAM Role Attachment for ecs-task
#########################################
resource "aws_iam_role_policy_attachment" "ecs_task_role_attach1" {
role = "${aws_iam_role.ecs_task_role.name}"
policy_arn = "arn:aws:iam::aws:policy/AmazonS3FullAccess"
}
resource "aws_iam_role_policy_attachment" "ecs_task_role_attach2" {
role = "${aws_iam_role.ecs_task_role.name}"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchEventsFullAccess"
}
#########################################
# IAM Role Attachment for ecs-service-as
#########################################
resource "aws_iam_role_policy_attachment" "ecs_service_autoscaling_role" {
role = "${aws_iam_role.ecs_autoscale_role.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceAutoscaleRole"
}
#########################################
# IAM Role Attachment for ecs-event
#########################################
resource "aws_iam_role_policy_attachment" "ecs_event_role" {
role = "${aws_iam_role.ecs_evnet_role.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceEventsRole"
}
#########################################
# IAM Role Attachment for lambda
#########################################
resource "aws_iam_role_policy_attachment" "lambda_exe_attachment" {
role = "${aws_iam_role.lambda_exe_role.name}"
policy_arn = "arn:aws:iam::aws:policy/AWSLambdaExecute"
}