Skip to content

Commit 0e37ae7

Browse files
authored
fix: Take app_id_client_regex from user_pool_config (#35) (#38)
1 parent c41b990 commit 0e37ae7

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

examples/complete/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Note that this example may create resources which cost money. Run `terraform des
4444
| Name | Type |
4545
|------|------|
4646
| [aws_cognito_user_pool.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool) | resource |
47+
| [aws_cognito_user_pool_client.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool_client) | resource |
4748
| [aws_route53_record.api](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
4849
| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource |
4950
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |

examples/complete/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ module "appsync" {
135135
authentication_type = "AMAZON_COGNITO_USER_POOLS"
136136

137137
user_pool_config = {
138-
user_pool_id = aws_cognito_user_pool.this.id
138+
user_pool_id = aws_cognito_user_pool.this.id
139+
app_id_client_regex = aws_cognito_user_pool_client.this.id
139140
}
140141
}
141142
}
@@ -264,6 +265,11 @@ resource "aws_cognito_user_pool" "this" {
264265
name = "user-pool-${random_pet.this.id}"
265266
}
266267

268+
resource "aws_cognito_user_pool_client" "this" {
269+
name = "user-pool-client-${random_pet.this.id}"
270+
user_pool_id = aws_cognito_user_pool.this.id
271+
}
272+
267273
#module "aws_lambda_function1" {
268274
# source = "terraform-aws-modules/cloudwatch/aws//examples/fixtures/aws_lambda_function"
269275
#}

examples/complete/outputs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ output "appsync_api_key_id" {
3939
output "appsync_api_key_key" {
4040
description = "Map of API Keys"
4141
value = module.appsync.appsync_api_key_key
42+
sensitive = true
4243
}
4344

4445
# Datasources

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ resource "aws_appsync_graphql_api" "this" {
5151
content {
5252
default_action = var.user_pool_config["default_action"]
5353
user_pool_id = var.user_pool_config["user_pool_id"]
54-
app_id_client_regex = lookup(var.openid_connect_config, "app_id_client_regex", null)
55-
aws_region = lookup(var.openid_connect_config, "aws_region", null)
54+
app_id_client_regex = lookup(var.user_pool_config, "app_id_client_regex", null)
55+
aws_region = lookup(var.user_pool_config, "aws_region", null)
5656
}
5757
}
5858

0 commit comments

Comments
 (0)