Skip to content

Commit 501a4a4

Browse files
authored
Merge pull request #3 from ManagedKube/provider-conditional
Provider conditional
2 parents c358550 + ccf2ad3 commit 501a4a4

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ No requirements.
4747
|------|-------------|------|---------|:--------:|
4848
| <a name="input_aws_policy_json"></a> [aws\_policy\_json](#input\_aws\_policy\_json) | The AWS policy in a json format | `string` | `"{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"*\",\n \"Resource\": \"*\"\n }\n ]\n}\n"` | no |
4949
| <a name="input_client_id_list"></a> [client\_id\_list](#input\_client\_id\_list) | n/a | `list` | <pre>[<br> "sts.amazonaws.com"<br>]</pre> | no |
50+
| <a name="input_create_identity_provider"></a> [create\_identity\_provider](#input\_create\_identity\_provider) | This switch allows you to create or not create the identity provider. Only one can exist. If you are creating multiple Github OIDC Federations, only one of the instantiations should create this or the Terraform run will fail. | `bool` | `true` | no |
5051
| <a name="input_name"></a> [name](#input\_name) | The name for the various resources | `string` | `"github_oidc"` | no |
5152
| <a name="input_tags"></a> [tags](#input\_tags) | Tags | `map(any)` | `{}` | no |
5253
| <a name="input_thumbprint_list"></a> [thumbprint\_list](#input\_thumbprint\_list) | This is the thumbprint returned if you were to create an "identity provider" in AWS and gave it this url: https://token.actions.githubusercontent.com | `list` | <pre>[<br> "a031c46782e6e6c662c2c87c76da9aa62ccabd8e"<br>]</pre> | no |

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
resource "aws_iam_openid_connect_provider" "this" {
2+
count = var.create_identity_provider ? 1 : 0
3+
24
url = var.url
35

46
client_id_list = var.client_id_list

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@ variable "tags" {
4848
default = {}
4949
description = "Tags"
5050
}
51+
52+
variable "create_identity_provider" {
53+
type = bool
54+
default = true
55+
description = "This switch allows you to create or not create the identity provider. Only one can exist. If you are creating multiple Github OIDC Federations, only one of the instantiations should create this or the Terraform run will fail."
56+
}

0 commit comments

Comments
 (0)