forked from unfunco/terraform-aws-oidc-github
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
109 lines (94 loc) · 3.42 KB
/
variables.tf
1
2
3
4
5
6
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Copyright © 2021 Daniel Morris
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
variable "attach_admin_policy" {
default = false
description = "Flag to enable/disable the attachment of the AdministratorAccess policy."
type = bool
}
variable "attach_read_only_policy" {
default = true
description = "Flag to enable/disable the attachment of the ReadOnly policy."
type = bool
}
variable "create_oidc_provider" {
default = true
description = "Flag to enable/disable the creation of the GitHub OIDC provider."
type = bool
}
variable "enabled" {
default = true
description = "Flag to enable/disable the creation of resources."
type = bool
}
variable "force_detach_policies" {
default = false
description = "Flag to force detachment of policies attached to the IAM role."
type = string
}
variable "github_repositories" {
description = "List of GitHub organization/repository names authorized to assume the role."
type = list(string)
validation {
// Ensures each element of github_repositories list matches the
// organization/repository format used by GitHub.
condition = length([
for repo in var.github_repositories : 1
if length(regexall("^[A-Za-z0-9_.-]+?/[A-Za-z0-9_.-]+$", repo)) > 0
]) == length(var.github_repositories)
error_message = "Repositories must be specified in the organization/repository format."
}
}
// Refer to the README for information on obtaining the thumbprint.
// This is specified as a variable to allow it to be updated quickly if it is
// unexpectedly changed by GitHub.
// See: https://github.blog/changelog/2022-01-13-github-actions-update-on-oidc-based-deployments-to-aws/
variable "github_thumbprint" {
default = "6938fd4d98bab03faadb97b34396831e3780aea1"
description = "GitHub OpenID TLS certificate thumbprint."
type = string
}
variable "iam_role_name" {
default = "github"
description = "Name of the IAM role to be created. This will be assumable by GitHub."
type = string
}
variable "iam_role_path" {
default = "/"
description = "Path under which to create IAM role."
type = string
}
variable "iam_role_permissions_boundary" {
default = ""
description = "ARN of the permissions boundary to be used by the IAM role."
type = string
}
variable "iam_role_policy_arns" {
default = []
description = "List of IAM policy ARNs to attach to the IAM role."
type = list(string)
}
variable "max_session_duration" {
default = 3600
description = "Maximum session duration in seconds."
type = number
validation {
condition = var.max_session_duration >= 3600 && var.max_session_duration <= 43200
error_message = "Maximum session duration must be between 3600 and 43200 seconds."
}
}
variable "tags" {
default = {}
description = "Map of tags to be applied to all resources."
type = map(string)
}