Skip to content

Commit

Permalink
Merge pull request #71 from hackforla/add-cognito-17
Browse files Browse the repository at this point in the history
Adding Cognito module to Terraform
  • Loading branch information
chelseybeck authored May 30, 2024
2 parents 4ff6abb + 93963ae commit d8471c1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
19 changes: 19 additions & 0 deletions terraform-modules/cognito/main.tf
Original file line number Diff line number Diff line change
@@ -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.
}
9 changes: 9 additions & 0 deletions terraform-modules/cognito/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
17 changes: 17 additions & 0 deletions terraform-modules/cognito/variables.tf
Original file line number Diff line number Diff line change
@@ -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 = ""
}

0 comments on commit d8471c1

Please sign in to comment.