-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiam_codecommit.tf
More file actions
35 lines (30 loc) · 1022 Bytes
/
iam_codecommit.tf
File metadata and controls
35 lines (30 loc) · 1022 Bytes
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
resource "aws_iam_policy" "AllowIndividualUserToListTheirOwnCodeCommit" {
name = "AllowIndividualUserToListTheirOwnCodeCommit"
path = "/"
policy = data.aws_iam_policy_document.AllowIndividualUserToListTheirOwnCodeCommit.json
}
data "aws_iam_policy_document" "AllowIndividualUserToListTheirOwnCodeCommit" {
statement {
actions = [
"iam:ListSSHPublicKeys",
]
resources = [
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:user/$${aws:username}",
]
}
}
resource "aws_iam_policy" "AllowIndividualUserToManageTheirOwnCodeCommit" {
name = "AllowIndividualUserToManageTheirOwnCodeCommit"
path = "/"
policy = data.aws_iam_policy_document.AllowIndividualUserToManageTheirOwnCodeCommit.json
}
data "aws_iam_policy_document" "AllowIndividualUserToManageTheirOwnCodeCommit" {
statement {
actions = [
"iam:UploadSSHPublicKey",
]
resources = [
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:user/$${aws:username}",
]
}
}