File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ See `variables.tf` for the full argument reference.
1414
1515``` hcl
1616module "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 = {
Original file line number Diff line number Diff line change 11data "aws_iam_openid_connect_provider" "github" {
2- url = " https://token.actions.githubusercontent.com"
2+ url = " https://token.actions.githubusercontent.com"
33}
44
55data "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}
Original file line number Diff line number Diff 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-
3125variable "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
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ See `variables.tf` for the full argument reference.
1010
1111``` hcl
1212module "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
You can’t perform that action at this time.
0 commit comments