diff --git a/terraform-modules/cognito/main.tf b/terraform-modules/cognito/main.tf new file mode 100644 index 0000000..de781f6 --- /dev/null +++ b/terraform-modules/cognito/main.tf @@ -0,0 +1,19 @@ +resource "aws_cognito_user_pool" "main" { + name = var.user_pool_name + + // Add additional configurations here according to project needs +} + +resource "aws_cognito_user_pool_client" "main" { + name = var.client_name + user_pool_id = aws_cognito_user_pool.main.id + + // Configure client here + // For example: + generate_secret = false + allowed_oauth_flows = ["code", "implicit"] + allowed_oauth_scopes = ["email", "openid"] + allowed_oauth_flows_user_pool_client = true + + // Other configurations like callback URLs, logout URLs, etc. +} \ No newline at end of file diff --git a/terraform-modules/cognito/outputs.tf b/terraform-modules/cognito/outputs.tf new file mode 100644 index 0000000..756a4fa --- /dev/null +++ b/terraform-modules/cognito/outputs.tf @@ -0,0 +1,9 @@ +output "user_pool_id" { + description = "The ID of the Cognito User Pool" + value = aws_cognito_user_pool.main.id +} + +output "user_pool_client_id" { + description = "The ID of the Cognito User Pool Client" + value = aws_cognito_user_pool_client.main.id +} \ No newline at end of file diff --git a/terraform-modules/cognito/variables.tf b/terraform-modules/cognito/variables.tf new file mode 100644 index 0000000..689dfc2 --- /dev/null +++ b/terraform-modules/cognito/variables.tf @@ -0,0 +1,17 @@ +variable "region" { + description = "AWS region" + type = string + default = "us-west-2" +} + +variable "user_pool_name" { + description = "Name of the Cognito User Pool" + type = string + default = "" +} + +variable "client_name" { + description = "Name of the Cognito User Pool Client" + type = string + default = "" +} \ No newline at end of file