Skip to content

Commit e8814bd

Browse files
Add permissions specifications
1 parent 5e3e09f commit e8814bd

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,26 @@ This module allows you to create a Github OIDC provider for your AWS account, th
8888
| Name | Description | Type | Default | Required |
8989
|------|-------------|------|---------|:--------:|
9090
| <a name="input_create_iam_roles"></a> [create\_iam\_roles](#input\_create\_iam\_roles) | Whether or not to create IAM roles. | `bool` | `true` | no |
91-
| <a name="input_create_oidc_provider"></a> [create\_oidc\_provider](#input\_create\_oidc\_provider) | Whether or not to create the associated oidc provider. If true, variable 'oidc\_provider\_arn is required' | `bool` | `true` | no |
91+
| <a name="input_create_oidc_provider"></a> [create\_oidc\_provider](#input\_create\_oidc\_provider) | Whether or not to create the associated oidc provider. If true, variable 'oidc\_provider\_arn' is required | `bool` | `true` | no |
9292
| <a name="input_oidc_provider_arn"></a> [oidc\_provider\_arn](#input\_oidc\_provider\_arn) | Used if create\_oidc\_provider is true | `string` | `""` | no |
93-
| <a name="input_permissions"></a> [permissions](#input\_permissions) | Github Repositories than can assumerole | `map(any)` | n/a | yes |
93+
| <a name="input_permissions"></a> [permissions](#input\_permissions) | Permissions configuration. See 'Permissions specifications' below | `map(any)` | n/a | yes |
9494

9595
## Outputs
9696

9797
| Name | Description |
9898
|------|-------------|
9999
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | OIDC provider ARN |
100100
| <a name="output_roles_arns"></a> [roles\_arns](#output\_roles\_arns) | Roles to be assumed by github actions |
101-
<!-- END_TF_DOCS -->
101+
<!-- END_TF_DOCS -->
102+
103+
## Permissions specifications
104+
```hcl
105+
permissions = map(object({
106+
"role_name": string, # optional, default: "githubActions-iamRole"
107+
"allowed_branches": list(string), # optional, default: ["master"]
108+
"repositories": map(object({ # optional, default: ["*":{}]
109+
"role_name": string, # optional, defaults to the organisation role_name
110+
"allowed_branches": list(string), # optional, defaults to the organisation allowed_branches
111+
}))
112+
}))
113+
```

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
variable "permissions" {
2-
description = "Github Repositories than can assumerole"
2+
description = "Permissions configuration. See 'Permissions specifications' below"
33
type = map(any)
44
}
55

66
variable "create_oidc_provider" {
7-
description = "Whether or not to create the associated oidc provider. If true, variable 'oidc_provider_arn is required'"
7+
description = "Whether or not to create the associated oidc provider. If true, variable 'oidc_provider_arn' is required"
88
type = bool
99
default = true
1010
}

0 commit comments

Comments
 (0)