Skip to content

Commit

Permalink
updated terrform module
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Dec 2, 2022
1 parent 8571612 commit cb22602
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 41 deletions.
50 changes: 16 additions & 34 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,41 @@ provider "aws" {
module "cognito" {
source = "./../"

name = "xcheck-user"
environment = "sandbox"
name = "test-user"
environment = "test"
label_order = ["environment", "name"]

enabled = true
allow_admin_create_user_only = false
advanced_security_mode = "OFF"
domain = "xcheck01"
domain = "test-domain"
software_token_enabled = false
mfa_configuration = "OFF"
deletion_protection = "INACTIVE"
users = {
rbuijs = {
email = "[email protected]"
}
rzeldent = {
email = "[email protected]"
}
test1 = {
email = "[email protected]"
}
test2 = {
email = "[email protected]"
}
}
user_groups = [
{ name = "AMS"
{ name = "test_group_1"
description = ""
},
{ name = "BOG"
{ name = "test_group_2"
description = ""
},
{ name = "CUN"
description = ""
},
{ name = "HND"
description = ""
},
{ name = "ICN"
description = ""
},
{ name = "MBJ"
description = ""
},
{ name = "PUJ"
description = ""
},
{ name = "PVR"
description = ""
},
{ name = "SXM"
{ name = "test_group_3"
description = ""
}
]

clients = [
{
name = "xhrf-reporting"
callback_urls = ["https://reporting.sandbox.x-check.net"]
name = "client_name_1"
callback_urls = [""]
generate_secret = true
logout_urls = []
refresh_token_validity = 30
Expand All @@ -67,8 +49,8 @@ module "cognito" {
allowed_oauth_flows = ["code"]
},
{
name = "xhrf-maintenance"
callback_urls = ["https://maintenance.sandbox.x-check.net"]
name = "client-name_2"
callback_urls = [""]
logout_urls = []
generate_secret = true
logout_urls = []
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ resource "aws_cognito_user_pool" "user_pool" {

mfa_configuration = var.mfa_configuration

deletion_protection = var.deletion_protection
deletion_protection = var.deletion_protection

password_policy {
minimum_length = var.password_minimum_length
Expand Down Expand Up @@ -418,7 +418,7 @@ resource "aws_cognito_user_group" "main" {
description = lookup(element(local.groups, count.index), "description")
precedence = lookup(element(local.groups, count.index), "precedence")
role_arn = lookup(element(local.groups, count.index), "role_arn")
user_pool_id = aws_cognito_user_pool.user_pool.*.id[0]
user_pool_id = aws_cognito_user_pool.user_pool.*.id[0]
}

locals {
Expand Down
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ variable "clients" {
}

variable "users" {
type = any
default = []
type = any
default = []
description = "(optional) describe your variable"
}

variable "use_defaults" {
type = bool
type = bool
default = true
}

Expand Down Expand Up @@ -585,7 +585,7 @@ variable "domain_certificate_arn" {
}

variable "domain_name" {
type = string
default = null
type = string
default = null
description = "(optional) describe your variable"
}

0 comments on commit cb22602

Please sign in to comment.