Skip to content

Commit 626d03f

Browse files
feat: Added support for lambda_authorization_config (#24)
1 parent c85c2b6 commit 626d03f

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ $ terraform apply
112112
| Name | Version |
113113
|------|---------|
114114
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
115-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.46 |
115+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.70 |
116116
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
117117

118118
## Providers
119119

120120
| Name | Version |
121121
|------|---------|
122-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.46 |
122+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.70 |
123123

124124
## Modules
125125

@@ -160,6 +160,7 @@ No modules.
160160
| <a name="input_graphql_api_tags"></a> [graphql\_api\_tags](#input\_graphql\_api\_tags) | Map of tags to add to GraphQL API | `map(string)` | `{}` | no |
161161
| <a name="input_iam_permissions_boundary"></a> [iam\_permissions\_boundary](#input\_iam\_permissions\_boundary) | ARN for iam permissions boundary | `string` | `null` | no |
162162
| <a name="input_lambda_allowed_actions"></a> [lambda\_allowed\_actions](#input\_lambda\_allowed\_actions) | List of allowed IAM actions for datasources type AWS\_LAMBDA | `list(string)` | <pre>[<br> "lambda:invokeFunction"<br>]</pre> | no |
163+
| <a name="input_lambda_authorizer_config"></a> [lambda\_authorizer\_config](#input\_lambda\_authorizer\_config) | Nested argument containing Lambda authorizer configuration. | `map(string)` | `{}` | no |
163164
| <a name="input_log_cloudwatch_logs_role_arn"></a> [log\_cloudwatch\_logs\_role\_arn](#input\_log\_cloudwatch\_logs\_role\_arn) | Amazon Resource Name of the service role that AWS AppSync will assume to publish to Amazon CloudWatch logs in your account. | `string` | `null` | no |
164165
| <a name="input_log_exclude_verbose_content"></a> [log\_exclude\_verbose\_content](#input\_log\_exclude\_verbose\_content) | Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level. | `bool` | `false` | no |
165166
| <a name="input_log_field_log_level"></a> [log\_field\_log\_level](#input\_log\_field\_log\_level) | Field logging level. Valid values: ALL, ERROR, NONE. | `string` | `null` | no |

examples/complete/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ module "appsync" {
2525

2626
authentication_type = "OPENID_CONNECT"
2727

28+
lambda_authorizer_config = {
29+
authorizer_uri = "arn:aws:lambda:eu-west-1:835367859851:function:appsync_auth_1"
30+
}
31+
2832
openid_connect_config = {
2933
issuer = "https://www.issuer1.com/"
3034
client_id = "client_id1"

main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ resource "aws_appsync_graphql_api" "this" {
2424
}
2525
}
2626

27+
dynamic "lambda_authorizer_config" {
28+
for_each = length(keys(var.lambda_authorizer_config)) == 0 ? [] : [true]
29+
30+
content {
31+
authorizer_uri = var.lambda_authorizer_config["authorizer_uri"]
32+
authorizer_result_ttl_in_seconds = lookup(var.lambda_authorizer_config, "authorizer_result_ttl_in_seconds", null)
33+
identity_validation_expression = lookup(var.lambda_authorizer_config, "identity_validation_expression", null)
34+
}
35+
}
36+
2737
dynamic "openid_connect_config" {
2838
for_each = length(keys(var.openid_connect_config)) == 0 ? [] : [true]
2939

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ variable "log_exclude_verbose_content" {
6464
default = false
6565
}
6666

67+
variable "lambda_authorizer_config" {
68+
description = "Nested argument containing Lambda authorizer configuration."
69+
type = map(string)
70+
default = {}
71+
}
72+
6773
variable "openid_connect_config" {
6874
description = "Nested argument containing OpenID Connect configuration."
6975
type = map(string)

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 2.46"
7+
version = ">= 3.70"
88
}
99
random = {
1010
source = "hashicorp/random"

0 commit comments

Comments
 (0)