Skip to content

Commit 1816d35

Browse files
Merge pull request #5 from gozer/issue/4/iam-role-name
Add `iam_role_name` option, default stays the same
2 parents 40be9f9 + d59d216 commit 1816d35

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Here's the gist of using it directly from github.
138138
| bucket | Backup and Restore bucket. | `string` | n/a | yes |
139139
| cluster\_name | Cluster name. | `string` | n/a | yes |
140140
| description | Namespace description | `string` | `"velero-back-up-and-restore"` | no |
141+
| iam\_role\_name | Name of the Velero IAM role | `string` | `""` | no |
141142
| name | namespace name | `string` | `"velero"` | no |
142143
| namespace\_deploy | whther or not to deploy namespace | `bool` | `false` | no |
143144
| openid\_connect\_provider\_uri | OpenID Connect Provider for EKS to enable IRSA. | `string` | n/a | yes |
@@ -157,10 +158,10 @@ Here's the gist of using it directly from github.
157158

158159
<!-- START makefile-doc -->
159160
```
160-
$ make help
161+
$ make help
161162
hooks Commit hooks setup
162163
validate Validate with pre-commit hooks
163-
changelog Update changelog
164+
changelog Update changelog
164165
```
165166
<!-- END makefile-doc -->
166167

iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ data aws_iam_policy_document policy {
6262
}
6363

6464
resource aws_iam_role this {
65-
name = format("%s-%s", var.cluster_name, var.name)
65+
name = var.iam_role_name == "" ? format("%s-%s", var.cluster_name, var.name) : var.iam_role_name
6666
assume_role_policy = data.aws_iam_policy_document.assume_role.json
6767
tags = merge(var.tags,
6868
{ Attached = var.name },

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@ variable "bucket" {
5959
description = "Backup and Restore bucket."
6060
type = string
6161
}
62+
63+
variable "iam_role_name" {
64+
description = "Name of the Velero IAM role"
65+
type = string
66+
default = ""
67+
}

0 commit comments

Comments
 (0)