Skip to content

Commit

Permalink
fix: Take app_id_client_regex from user_pool_config (#35) (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
x539 authored Jul 9, 2022
1 parent c41b990 commit 0e37ae7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Type |
|------|------|
| [aws_cognito_user_pool.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool) | resource |
| [aws_cognito_user_pool_client.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool_client) | resource |
| [aws_route53_record.api](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource |
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |
Expand Down
8 changes: 7 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ module "appsync" {
authentication_type = "AMAZON_COGNITO_USER_POOLS"

user_pool_config = {
user_pool_id = aws_cognito_user_pool.this.id
user_pool_id = aws_cognito_user_pool.this.id
app_id_client_regex = aws_cognito_user_pool_client.this.id
}
}
}
Expand Down Expand Up @@ -264,6 +265,11 @@ resource "aws_cognito_user_pool" "this" {
name = "user-pool-${random_pet.this.id}"
}

resource "aws_cognito_user_pool_client" "this" {
name = "user-pool-client-${random_pet.this.id}"
user_pool_id = aws_cognito_user_pool.this.id
}

#module "aws_lambda_function1" {
# source = "terraform-aws-modules/cloudwatch/aws//examples/fixtures/aws_lambda_function"
#}
Expand Down
1 change: 1 addition & 0 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ output "appsync_api_key_id" {
output "appsync_api_key_key" {
description = "Map of API Keys"
value = module.appsync.appsync_api_key_key
sensitive = true
}

# Datasources
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ resource "aws_appsync_graphql_api" "this" {
content {
default_action = var.user_pool_config["default_action"]
user_pool_id = var.user_pool_config["user_pool_id"]
app_id_client_regex = lookup(var.openid_connect_config, "app_id_client_regex", null)
aws_region = lookup(var.openid_connect_config, "aws_region", null)
app_id_client_regex = lookup(var.user_pool_config, "app_id_client_regex", null)
aws_region = lookup(var.user_pool_config, "aws_region", null)
}
}

Expand Down

0 comments on commit 0e37ae7

Please sign in to comment.