merge(v, {
3 | type = split(".", k)[0]
4 | field = join(".", slice(split(".", k), 1, length(split(".", k))))
5 | }) } : tomap({})
6 | }
7 |
8 | # GraphQL API
9 | resource "aws_appsync_graphql_api" "this" {
10 | count = var.create_graphql_api ? 1 : 0
11 |
12 | name = var.name
13 | authentication_type = var.authentication_type
14 | schema = var.schema
15 | xray_enabled = var.xray_enabled
16 |
17 | dynamic "log_config" {
18 | for_each = var.logging_enabled ? [true] : []
19 |
20 | content {
21 | cloudwatch_logs_role_arn = var.create_logs_role ? aws_iam_role.logs[0].arn : var.log_cloudwatch_logs_role_arn
22 | field_log_level = var.log_field_log_level
23 | exclude_verbose_content = var.log_exclude_verbose_content
24 | }
25 | }
26 |
27 | dynamic "openid_connect_config" {
28 | for_each = length(keys(var.openid_connect_config)) == 0 ? [] : [true]
29 |
30 | content {
31 | issuer = var.openid_connect_config["issuer"]
32 | client_id = lookup(var.openid_connect_config, "client_id", null)
33 | auth_ttl = lookup(var.openid_connect_config, "auth_ttl", null)
34 | iat_ttl = lookup(var.openid_connect_config, "iat_ttl", null)
35 | }
36 | }
37 |
38 | dynamic "user_pool_config" {
39 | for_each = length(keys(var.user_pool_config)) == 0 ? [] : [true]
40 |
41 | content {
42 | default_action = var.user_pool_config["default_action"]
43 | user_pool_id = var.user_pool_config["user_pool_id"]
44 | app_id_client_regex = lookup(var.openid_connect_config, "app_id_client_regex", null)
45 | aws_region = lookup(var.openid_connect_config, "aws_region", null)
46 | }
47 | }
48 |
49 | dynamic "additional_authentication_provider" {
50 | for_each = var.additional_authentication_provider
51 |
52 | content {
53 | authentication_type = additional_authentication_provider.value.authentication_type
54 |
55 | dynamic "openid_connect_config" {
56 | for_each = length(keys(lookup(additional_authentication_provider.value, "openid_connect_config", {}))) == 0 ? [] : [additional_authentication_provider.value.openid_connect_config]
57 |
58 | content {
59 | issuer = openid_connect_config.value.issuer
60 | client_id = lookup(openid_connect_config.value, "client_id", null)
61 | auth_ttl = lookup(openid_connect_config.value, "auth_ttl", null)
62 | iat_ttl = lookup(openid_connect_config.value, "iat_ttl", null)
63 | }
64 | }
65 |
66 | dynamic "user_pool_config" {
67 | for_each = length(keys(lookup(additional_authentication_provider.value, "user_pool_config", {}))) == 0 ? [] : [additional_authentication_provider.value.user_pool_config]
68 |
69 | content {
70 | user_pool_id = user_pool_config.value.user_pool_id
71 | app_id_client_regex = lookup(user_pool_config.value, "app_id_client_regex", null)
72 | aws_region = lookup(user_pool_config.value, "aws_region", null)
73 | }
74 | }
75 | }
76 | }
77 |
78 | tags = merge({ Name = var.name }, var.graphql_api_tags)
79 | }
80 |
81 | # API Key
82 | resource "aws_appsync_api_key" "this" {
83 | for_each = var.create_graphql_api && var.authentication_type == "API_KEY" ? var.api_keys : {}
84 |
85 | api_id = aws_appsync_graphql_api.this[0].id
86 | description = each.key
87 | expires = each.value
88 | }
89 |
90 | # Datasource
91 | resource "aws_appsync_datasource" "this" {
92 | for_each = var.create_graphql_api ? var.datasources : {}
93 |
94 | api_id = aws_appsync_graphql_api.this[0].id
95 | name = each.key
96 | type = each.value.type
97 | description = lookup(each.value, "description", null)
98 | service_role_arn = lookup(each.value, "service_role_arn", tobool(lookup(each.value, "create_service_role", contains(["AWS_LAMBDA", "AMAZON_DYNAMODB", "AMAZON_ELASTICSEARCH"], each.value.type))) ? aws_iam_role.service_role[each.key].arn : null)
99 |
100 | dynamic "http_config" {
101 | for_each = each.value.type == "HTTP" ? [true] : []
102 |
103 | content {
104 | endpoint = each.value.endpoint
105 | }
106 | }
107 |
108 | dynamic "lambda_config" {
109 | for_each = each.value.type == "AWS_LAMBDA" ? [true] : []
110 |
111 | content {
112 | function_arn = each.value.function_arn
113 | }
114 | }
115 |
116 | dynamic "dynamodb_config" {
117 | for_each = each.value.type == "AMAZON_DYNAMODB" ? [true] : []
118 |
119 | content {
120 | table_name = each.value.table_name
121 | region = lookup(each.value, "region", null)
122 | use_caller_credentials = lookup(each.value, "use_caller_credentials", null)
123 | }
124 | }
125 |
126 | dynamic "elasticsearch_config" {
127 | for_each = each.value.type == "AMAZON_ELASTICSEARCH" ? [true] : []
128 |
129 | content {
130 | endpoint = each.value.endpoint
131 | region = lookup(each.value, "region", null)
132 | }
133 | }
134 | }
135 |
136 | # Resolvers
137 | resource "aws_appsync_resolver" "this" {
138 | for_each = local.resolvers
139 |
140 | api_id = aws_appsync_graphql_api.this[0].id
141 | type = each.value.type
142 | field = each.value.field
143 | kind = lookup(each.value, "kind", null)
144 |
145 | request_template = lookup(each.value, "request_template", tobool(lookup(each.value, "direct_lambda", false)) ? var.direct_lambda_request_template : "{}")
146 | response_template = lookup(each.value, "response_template", tobool(lookup(each.value, "direct_lambda", false)) ? var.direct_lambda_response_template : "{}")
147 |
148 | data_source = lookup(each.value, "data_source", null) != null ? aws_appsync_datasource.this[each.value.data_source].name : lookup(each.value, "data_source_arn", null)
149 |
150 | dynamic "pipeline_config" {
151 | for_each = lookup(each.value, "functions", null) != null ? [true] : []
152 |
153 | content {
154 | functions = [for k in each.value.functions :
155 | contains(keys(aws_appsync_function.this), k) ? aws_appsync_function.this[k].function_id : k]
156 | }
157 | }
158 |
159 | dynamic "caching_config" {
160 | for_each = lookup(each.value, "caching_keys", null) != null ? [true] : []
161 |
162 | content {
163 | caching_keys = each.value.caching_keys
164 | ttl = lookup(each.value, "caching_ttl", var.resolver_caching_ttl)
165 | }
166 | }
167 | }
168 |
169 | # Functions
170 | resource "aws_appsync_function" "this" {
171 | for_each = var.create_graphql_api ? var.functions : {}
172 |
173 | api_id = aws_appsync_graphql_api.this[0].id
174 | data_source = lookup(each.value, "data_source", null)
175 | name = each.key
176 | description = lookup(each.value, "description", null)
177 | function_version = lookup(each.value, "function_version", "2018-05-29")
178 |
179 | request_mapping_template = lookup(each.value, "request_mapping_template", null)
180 | response_mapping_template = lookup(each.value, "response_mapping_template", null)
181 | }
182 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AWS AppSync Terraform module
2 |
3 | Terraform module which creates AWS AppSync resources and connects them together.
4 |
5 | This Terraform module is part of [serverless.tf framework](https://serverless.tf), which aims to simplify all operations when working with the serverless in Terraform.
6 |
7 | ## Usage
8 |
9 | ### Complete AppSync with datasources and resolvers
10 |
11 | ```hcl
12 | module "appsync" {
13 | source = "terraform-aws-modules/appsync/aws"
14 |
15 | name = "dev-appsync"
16 |
17 | schema = file("schema.graphql")
18 |
19 | api_keys = {
20 | default = null # such key will expire in 7 days
21 | }
22 |
23 | additional_authentication_provider = {
24 | iam = {
25 | authentication_type = "AWS_IAM"
26 | }
27 |
28 | openid_connect_1 = {
29 | authentication_type = "OPENID_CONNECT"
30 |
31 | openid_connect_config = {
32 | issuer = "https://www.issuer1.com/"
33 | client_id = "client_id1"
34 | }
35 | }
36 | }
37 |
38 | datasources = {
39 | registry_terraform_io = {
40 | type = "HTTP"
41 | endpoint = "https://registry.terraform.io"
42 | }
43 |
44 | lambda_create_zip = {
45 | type = "AWS_LAMBDA"
46 | function_arn = "arn:aws:lambda:eu-west-1:135367859850:function:index_1"
47 | }
48 |
49 | dynamodb1 = {
50 | type = "AMAZON_DYNAMODB"
51 | table_name = "my-table"
52 | region = "eu-west-1"
53 | }
54 |
55 | elasticsearch1 = {
56 | type = "AMAZON_ELASTICSEARCH"
57 | endpoint = "https://search-my-domain.eu-west-1.es.amazonaws.com"
58 | region = "eu-west-1"
59 | }
60 | }
61 |
62 | resolvers = {
63 | "Query.getZip" = {
64 | data_source = "lambda_create_zip"
65 | direct_lambda = true
66 | }
67 |
68 | "Query.getModuleFromRegistry" = {
69 | data_source = "registry_terraform_io"
70 | request_template = file("vtl-templates/request.Query.getModuleFromRegistry.vtl")
71 | response_template = file("vtl-templates/response.Query.getModuleFromRegistry.vtl")
72 | }
73 | }
74 | }
75 | ```
76 |
77 | ## Conditional creation
78 |
79 | Sometimes you need to have a way to create resources conditionally but Terraform 0.12 does not allow usage of `count` inside `module` block, so the solution is to specify `create_graphql_api` argument.
80 |
81 | ```hcl
82 | module "appsync" {
83 | source = "terraform-aws-modules/appsync/aws"
84 |
85 | create_graphql_api = false # to disable all resources
86 |
87 | # ... omitted
88 | }
89 | ```
90 |
91 | ## Relationship between Data-Source and Resolver resources
92 |
93 | `datasources` define keys which can be referenced in `resolvers`. For initial configuration and parameters updates Terraform is able to understand the order of resources correctly.
94 |
95 | In order to change name of keys in both places (eg from `lambda-old` to `lambda-new`), you will need to change key in both variables, and then run Terraform with partial configuration (using `-target`) to handle the migration in the `aws_appsync_resolver` resource (eg, `Post.id`):
96 |
97 | ```shell
98 | # Create new resources and update resolver
99 | $ terraform apply -target="module.appsync.aws_appsync_resolver.this[\"Post.id\"]" -target="module.appsync.aws_appsync_datasource.this[\"lambda-new\"]" -target="module.appsync.aws_iam_role.service_role[\"lambda-new\"]" -target="module.appsync.aws_iam_role_policy.this[\"lambda-new\"]"
100 |
101 | # Delete orphan resources ("lambda-old")
102 | $ terraform apply
103 | ```
104 |
105 | ## Examples
106 |
107 | - [Complete](https://github.com/terraform-aws-modules/terraform-aws-appsync/tree/master/examples/complete) - Create AppSync with datasources, resolvers, and authorization providers in various combinations.
108 |
109 |
110 | ## Requirements
111 |
112 | | Name | Version |
113 | |------|---------|
114 | | [terraform](#requirement\_terraform) | >= 0.13.1 |
115 | | [aws](#requirement\_aws) | >= 2.46 |
116 | | [random](#requirement\_random) | >= 2.0 |
117 |
118 | ## Providers
119 |
120 | | Name | Version |
121 | |------|---------|
122 | | [aws](#provider\_aws) | >= 2.46 |
123 |
124 | ## Modules
125 |
126 | No modules.
127 |
128 | ## Resources
129 |
130 | | Name | Type |
131 | |------|------|
132 | | [aws_appsync_api_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appsync_api_key) | resource |
133 | | [aws_appsync_datasource.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appsync_datasource) | resource |
134 | | [aws_appsync_function.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appsync_function) | resource |
135 | | [aws_appsync_graphql_api.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appsync_graphql_api) | resource |
136 | | [aws_appsync_resolver.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appsync_resolver) | resource |
137 | | [aws_iam_role.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
138 | | [aws_iam_role.service_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
139 | | [aws_iam_role_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
140 | | [aws_iam_role_policy_attachment.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
141 | | [aws_caller_identity.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
142 | | [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
143 | | [aws_iam_policy_document.service_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
144 |
145 | ## Inputs
146 |
147 | | Name | Description | Type | Default | Required |
148 | |------|-------------|------|---------|:--------:|
149 | | [additional\_authentication\_provider](#input\_additional\_authentication\_provider) | One or more additional authentication providers for the GraphqlApi. | `any` | `{}` | no |
150 | | [api\_keys](#input\_api\_keys) | Map of API keys to create | `map(string)` | `{}` | no |
151 | | [authentication\_type](#input\_authentication\_type) | The authentication type to use by GraphQL API | `string` | `"API_KEY"` | no |
152 | | [create\_graphql\_api](#input\_create\_graphql\_api) | Whether to create GraphQL API | `bool` | `true` | no |
153 | | [create\_logs\_role](#input\_create\_logs\_role) | Whether to create service role for Cloudwatch logs | `bool` | `true` | no |
154 | | [datasources](#input\_datasources) | Map of datasources to create | `any` | `{}` | no |
155 | | [direct\_lambda\_request\_template](#input\_direct\_lambda\_request\_template) | VTL request template for the direct lambda integrations | `string` | `"{\n \"version\" : \"2017-02-28\",\n \"operation\": \"Invoke\",\n \"payload\": {\n \"arguments\": $util.toJson($ctx.arguments),\n \"identity\": $util.toJson($ctx.identity),\n \"source\": $util.toJson($ctx.source),\n \"request\": $util.toJson($ctx.request),\n \"prev\": $util.toJson($ctx.prev),\n \"info\": {\n \"selectionSetList\": $util.toJson($ctx.info.selectionSetList),\n \"selectionSetGraphQL\": $util.toJson($ctx.info.selectionSetGraphQL),\n \"parentTypeName\": $util.toJson($ctx.info.parentTypeName),\n \"fieldName\": $util.toJson($ctx.info.fieldName),\n \"variables\": $util.toJson($ctx.info.variables)\n },\n \"stash\": $util.toJson($ctx.stash)\n }\n}\n"` | no |
156 | | [direct\_lambda\_response\_template](#input\_direct\_lambda\_response\_template) | VTL response template for the direct lambda integrations | `string` | `"$util.toJson($ctx.result)\n"` | no |
157 | | [dynamodb\_allowed\_actions](#input\_dynamodb\_allowed\_actions) | List of allowed IAM actions for datasources type AMAZON\_DYNAMODB | `list(string)` | [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:DeleteItem",
"dynamodb:UpdateItem",
"dynamodb:Query",
"dynamodb:Scan",
"dynamodb:BatchGetItem",
"dynamodb:BatchWriteItem"
]
| no |
158 | | [elasticsearch\_allowed\_actions](#input\_elasticsearch\_allowed\_actions) | List of allowed IAM actions for datasources type AMAZON\_ELASTICSEARCH | `list(string)` | [
"es:ESHttpDelete",
"es:ESHttpHead",
"es:ESHttpGet",
"es:ESHttpPost",
"es:ESHttpPut"
]
| no |
159 | | [functions](#input\_functions) | Map of functions to create | `any` | `{}` | no |
160 | | [graphql\_api\_tags](#input\_graphql\_api\_tags) | Map of tags to add to GraphQL API | `map(string)` | `{}` | no |
161 | | [iam\_permissions\_boundary](#input\_iam\_permissions\_boundary) | ARN for iam permissions boundary | `string` | `null` | no |
162 | | [lambda\_allowed\_actions](#input\_lambda\_allowed\_actions) | List of allowed IAM actions for datasources type AWS\_LAMBDA | `list(string)` | [
"lambda:invokeFunction"
]
| no |
163 | | [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 |
164 | | [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 |
165 | | [log\_field\_log\_level](#input\_log\_field\_log\_level) | Field logging level. Valid values: ALL, ERROR, NONE. | `string` | `null` | no |
166 | | [logging\_enabled](#input\_logging\_enabled) | Whether to enable Cloudwatch logging on GraphQL API | `bool` | `false` | no |
167 | | [logs\_role\_name](#input\_logs\_role\_name) | Name of IAM role to create for Cloudwatch logs | `string` | `null` | no |
168 | | [logs\_role\_tags](#input\_logs\_role\_tags) | Map of tags to add to Cloudwatch logs IAM role | `map(string)` | `{}` | no |
169 | | [name](#input\_name) | Name of GraphQL API | `string` | `""` | no |
170 | | [openid\_connect\_config](#input\_openid\_connect\_config) | Nested argument containing OpenID Connect configuration. | `map(string)` | `{}` | no |
171 | | [resolver\_caching\_ttl](#input\_resolver\_caching\_ttl) | Default caching TTL for resolvers when caching is enabled | `number` | `60` | no |
172 | | [resolvers](#input\_resolvers) | Map of resolvers to create | `any` | `{}` | no |
173 | | [schema](#input\_schema) | The schema definition, in GraphQL schema language format. Terraform cannot perform drift detection of this configuration. | `string` | `""` | no |
174 | | [tags](#input\_tags) | Map of tags to add to all GraphQL resources created by this module | `map(string)` | `{}` | no |
175 | | [user\_pool\_config](#input\_user\_pool\_config) | The Amazon Cognito User Pool configuration. | `map(string)` | `{}` | no |
176 | | [xray\_enabled](#input\_xray\_enabled) | Whether tracing with X-ray is enabled. | `bool` | `false` | no |
177 |
178 | ## Outputs
179 |
180 | | Name | Description |
181 | |------|-------------|
182 | | [appsync\_api\_key\_id](#output\_appsync\_api\_key\_id) | Map of API Key ID (Formatted as ApiId:Key) |
183 | | [appsync\_api\_key\_key](#output\_appsync\_api\_key\_key) | Map of API Keys |
184 | | [appsync\_datasource\_arn](#output\_appsync\_datasource\_arn) | Map of ARNs of datasources |
185 | | [appsync\_function\_arn](#output\_appsync\_function\_arn) | Map of ARNs of functions |
186 | | [appsync\_function\_function\_id](#output\_appsync\_function\_function\_id) | Map of function IDs of functions |
187 | | [appsync\_function\_id](#output\_appsync\_function\_id) | Map of IDs of functions |
188 | | [appsync\_graphql\_api\_arn](#output\_appsync\_graphql\_api\_arn) | ARN of GraphQL API |
189 | | [appsync\_graphql\_api\_fqdns](#output\_appsync\_graphql\_api\_fqdns) | Map of FQDNs associated with the API (no protocol and path) |
190 | | [appsync\_graphql\_api\_id](#output\_appsync\_graphql\_api\_id) | ID of GraphQL API |
191 | | [appsync\_graphql\_api\_uris](#output\_appsync\_graphql\_api\_uris) | Map of URIs associated with the API |
192 | | [appsync\_resolver\_arn](#output\_appsync\_resolver\_arn) | Map of ARNs of resolvers |
193 |
194 |
195 | ## Authors
196 |
197 | Module managed by [Anton Babenko](https://github.com/antonbabenko). Check out [serverless.tf](https://serverless.tf) to learn more about doing serverless with Terraform.
198 |
199 | Please reach out to [Betajob](https://www.betajob.com/) if you are looking for commercial support for your Terraform, AWS, or serverless project.
200 |
201 | ## License
202 |
203 | Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-appsync/tree/master/LICENSE) for full details.
204 |
--------------------------------------------------------------------------------