Skip to content

Commit f05a84b

Browse files
authored
chore: fix docs and remove repo_owners (#18)
1 parent 07eaee6 commit f05a84b

4 files changed

Lines changed: 8 additions & 33 deletions

File tree

github-oidc-iam-role/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See `variables.tf` for the full argument reference.
1414

1515
```hcl
1616
module "oidc_github_iam_role" {
17-
source = "github.com/script47/aws-tf-modules/oidc-github-iam-role"
17+
source = "github.com/script47/aws-tf-modules/github-oidc-iam-role"
1818
1919
role_name = "my-role"
2020
@@ -44,12 +44,8 @@ module "oidc_github_iam_role" {
4444
"arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess"
4545
]
4646
47-
repo_owners = [
48-
"my-owner"
49-
]
50-
5147
sub = [
52-
"repo:my-owner/my-repo:ref:refs/heads/*"
48+
"repo:my-owner/my-repo:ref:*"
5349
]
5450
5551
tags = {

github-oidc-iam-role/data.tf

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
data "aws_iam_openid_connect_provider" "github" {
2-
url = "https://token.actions.githubusercontent.com"
2+
url = "https://token.actions.githubusercontent.com"
33
}
44

55
data "aws_iam_policy_document" "assume_role_policy" {
66
statement {
7-
effect = "Allow"
8-
7+
effect = "Allow"
98
actions = ["sts:AssumeRoleWithWebIdentity"]
109

1110
principals {
@@ -19,24 +18,10 @@ data "aws_iam_policy_document" "assume_role_policy" {
1918
values = ["sts.amazonaws.com"]
2019
}
2120

22-
dynamic "condition" {
23-
for_each = length(var.repo_owners) > 0 ? [1] : []
24-
25-
content {
26-
test = "StringEquals"
27-
variable = "token.actions.githubusercontent.com:repository_owner"
28-
values = var.repo_owners
29-
}
30-
}
31-
32-
dynamic "condition" {
33-
for_each = length(var.sub) > 0 ? [1] : []
34-
35-
content {
21+
condition {
3622
test = "StringLike"
3723
variable = "token.actions.githubusercontent.com:sub"
38-
values = var.sub
39-
}
24+
values = var.sub
4025
}
4126
}
4227
}

github-oidc-iam-role/variables.tf

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@ variable "policy_arns" {
2222
default = []
2323
}
2424

25-
variable "repo_owners" {
26-
type = set(string)
27-
description = "Set of repo owners for the assume role policy"
28-
default = []
29-
}
30-
3125
variable "sub" {
3226
type = set(string)
33-
description = "The sub pattern for the assume role policy (e.g. org/repo:ref:refs/heads/master)"
27+
description = "The sub pattern for the assume role policy"
3428
default = []
3529
}
3630

github-oidc-provider/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See `variables.tf` for the full argument reference.
1010

1111
```hcl
1212
module "oidc_github_provider" {
13-
source = "github.com/script47/aws-tf-modules/oidc-github-provider"
13+
source = "github.com/script47/aws-tf-modules/github-oidc-provider"
1414
1515
thumbprints = []
1616

0 commit comments

Comments
 (0)