Skip to content

Commit 0305729

Browse files
authored
feat: allowing for us to provision local users (#41)
* feat: allowing for us to provision local users * docs: updating the documentation to reflect the changes
1 parent de3fece commit 0305729

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ The `terraform-docs` utility is used to generate this README. Follow the below s
152152
| <a name="input_quicksight_subscription_authentication_method"></a> [quicksight\_subscription\_authentication\_method](#input\_quicksight\_subscription\_authentication\_method) | The identity for the QuickSight quicksight\_subscription edition | `string` | `"IAM_AND_QUICKSIGHT"` | no |
153153
| <a name="input_quicksight_subscription_edition"></a> [quicksight\_subscription\_edition](#input\_quicksight\_subscription\_edition) | The edition for the QuickSight quicksight\_subscription | `string` | `"ENTERPRISE"` | no |
154154
| <a name="input_quicksight_subscription_email"></a> [quicksight\_subscription\_email](#input\_quicksight\_subscription\_email) | The email address for the QuickSight quicksight\_subscription edition | `string` | `null` | no |
155-
| <a name="input_quicksight_users"></a> [quicksight\_users](#input\_quicksight\_users) | Map of user accounts to be registered in QuickSight | <pre>map(object({<br> role = optional(string, "READER")<br> }))</pre> | `{}` | no |
155+
| <a name="input_quicksight_users"></a> [quicksight\_users](#input\_quicksight\_users) | Map of user accounts to be registered in QuickSight | <pre>map(object({<br> identity_type = optional(string, "IAM")<br> namespace = optional(string, "default")<br> role = optional(string, "READER")<br> }))</pre> | `{}` | no |
156156
| <a name="input_quicksights_username"></a> [quicksights\_username](#input\_quicksights\_username) | The username for the QuickSight user | `string` | `"admin"` | no |
157157
| <a name="input_saml_metadata"></a> [saml\_metadata](#input\_saml\_metadata) | The configuration for the SAML identity provider | `string` | `null` | no |
158158
| <a name="input_stack_name_cloud_intelligence"></a> [stack\_name\_cloud\_intelligence](#input\_stack\_name\_cloud\_intelligence) | The name of the CloudFormation stack to create the dashboards | `string` | `"CI-Cloud-Intelligence-Dashboards"` | no |

quicksights.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ resource "aws_quicksight_user" "users" {
1515
for_each = var.quicksight_users
1616

1717
email = each.key
18-
iam_arn = aws_iam_role.cudos_sso[0].arn
19-
identity_type = "IAM"
20-
session_name = each.key
21-
user_role = each.value.role
18+
iam_arn = each.value.identity_type == "IAM" ? aws_iam_role.cudos_sso[0].arn : null
19+
identity_type = each.value.identity_type
20+
namespace = try(each.value.namespace, "default")
21+
session_name = each.value.identity_type == "IAM" ? each.key : null
22+
user_name = each.value.identity_type == "QUICKSIGHT" ? try(each.value.user_name, null) : null
23+
user_role = try(each.value.role, null)
2224

2325
provider = aws.cost_analysis
2426
}

variables.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ variable "quicksights_username" {
226226
variable "quicksight_users" {
227227
description = "Map of user accounts to be registered in QuickSight"
228228
type = map(object({
229-
role = optional(string, "READER")
229+
identity_type = optional(string, "IAM")
230+
namespace = optional(string, "default")
231+
role = optional(string, "READER")
230232
}))
231233
default = {}
232234
}

0 commit comments

Comments
 (0)