-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrole.tf
31 lines (24 loc) · 1008 Bytes
/
role.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
resource "aws_iam_role" "replicate_to_sg_role" {
name = "s3-cross-region-replication-to-sg"
assume_role_policy = data.aws_iam_policy_document.assume_role.json
}
resource "aws_iam_policy" "replicate_to_sg_policy" {
name = "s3-crr-role-policy-replication-to-sg"
policy = data.aws_iam_policy_document.replicate_to_sg.json
}
resource "aws_iam_role_policy_attachment" "attachment-a" {
role = aws_iam_role.replicate_to_sg_role.name
policy_arn = aws_iam_policy.replicate_to_sg_policy.arn
}
resource "aws_iam_role" "replicate_to_hk_role" {
name = "s3-cross-region-replication-to-hk"
assume_role_policy = data.aws_iam_policy_document.assume_role.json
}
resource "aws_iam_policy" "replicate_to_hk_policy" {
name = "s3-crr-role-policy-replication-to-hk"
policy = data.aws_iam_policy_document.replicate_to_hk.json
}
resource "aws_iam_role_policy_attachment" "attachment-b" {
role = aws_iam_role.replicate_to_hk_role.name
policy_arn = aws_iam_policy.replicate_to_hk_policy.arn
}