Commit 93a6ffd
committed
Support multiple roles per repo
This module currently offers the input variable `var.aws_iam_role_names`
that allows a custom IAM role name to be specified for each repo, and
the input variable `var.github_custom_claim` that allows a custom OIDC
claim to be specified for each repo.
There are some notable limitations to the current implementations of
`var.aws_iam_role_names` and `var.github_custom_claim`:
- Only one role name can be specified per repo
- Only one custom OIDC claim can be specified per repo.
This commit will update `var.aws_iam_role_names` to address these
limitations. Instead of only accepting a single role name per repo, the
variable will now also support a map for each repo. Each key of the map
should be the custom role name, and each value should be a list of
custom claims to add to the role trust policy.
```hcl
aws_iam_role_names = {
"really-long-github-org-name/really-long-github-repo-name" = {
"read-only-role" = ["*"],
"write-role" = ["ref:refs/heads/main", "ref_type:tag"],
"custom-role" = ["*"],
}
}
```
For backwards compatibility, `var.aws_iam_role_names` will continue to
support the old format:
```hcl
aws_iam_role_names = {
"really-long-github-org-name/really-long-github-repo-name" = "custom-role-name"
}
```1 parent bb0d0ba commit 93a6ffd
3 files changed
+56
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
20 | 36 | | |
21 | 37 | | |
22 | 38 | | |
| |||
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
43 | | - | |
| 59 | + | |
44 | 60 | | |
45 | 61 | | |
46 | 62 | | |
| |||
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
58 | | - | |
| 74 | + | |
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
| |||
64 | 80 | | |
65 | 81 | | |
66 | 82 | | |
67 | | - | |
| 83 | + | |
68 | 84 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
9 | 6 | | |
10 | 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 | + | |
11 | 32 | | |
12 | | - | |
13 | | - | |
| 33 | + | |
| 34 | + | |
14 | 35 | | |
15 | 36 | | |
16 | 37 | | |
17 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
18 | 43 | | |
19 | 44 | | |
20 | 45 | | |
| |||
0 commit comments