File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff 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\_ deploy | whther or not to deploy iam role | ` bool ` | ` true ` | no |
141142| iam\_ role\_ name | Name of the Velero IAM role | ` string ` | ` "" ` | no |
142143| name | namespace name | ` string ` | ` "velero" ` | no |
143144| namespace\_ deploy | whther or not to deploy namespace | ` bool ` | ` false ` | no |
Original file line number Diff line number Diff line change @@ -62,7 +62,9 @@ data aws_iam_policy_document policy {
6262}
6363
6464resource aws_iam_role this {
65+ count = var. iam_deploy ? 1 : 0
6566 name = var. iam_role_name == " " ? format (" %s-%s" , var. cluster_name , var. name ) : var. iam_role_name
67+
6668 assume_role_policy = data. aws_iam_policy_document . assume_role . json
6769 tags = merge (var. tags ,
6870 { Attached = var.name },
@@ -72,7 +74,8 @@ resource aws_iam_role this {
7274}
7375
7476resource aws_iam_role_policy this {
77+ count = var. iam_deploy ? 1 : 0
7578 name = format (" %s-%s" , var. cluster_name , var. name )
76- role = aws_iam_role. this . id
79+ role = element ( aws_iam_role. this . * . id , 0 )
7780 policy = data. aws_iam_policy_document . policy . json
7881}
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ variable "app_deploy" {
1515 type = bool
1616}
1717
18+ variable "iam_deploy" {
19+ default = true
20+ description = " whther or not to deploy iam role"
21+ type = bool
22+ }
23+
1824variable "name" {
1925 default = " velero"
2026 description = " namespace name"
You can’t perform that action at this time.
0 commit comments