Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add type descriptions for complex input #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ module "appsync" {
# Note: dynamic references (module.aws_lambda_function2.lambda_function_arn) do not work unless you create this resource in advance
function_arn = "arn:aws:lambda:eu-west-1:835367859851:function:index_2"
# service_role_arn = "arn:aws:iam::835367859851:role/lambda1-service"
service_role_name = "lambda2-custom-name-service-role"
}

dynamodb1 = {
Expand Down
33 changes: 30 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,36 @@ variable "resolver_caching_ttl" {

# Datasources
variable "datasources" {
description = "Map of datasources to create"
type = any
default = {}
description = <<EOF
Map of datasources to create. The key is the name of the datasource and the value is a map of the datasource configuration. The configuration map must contain the following keys:
- type: The type of the datasource. Valid values are: AWS_LAMBDA, AMAZON_DYNAMODB, AMAZON_ELASTICSEARCH, AMAZON_OPENSEARCH_SERVICE, AMAZON_EVENTBRIDGE, RELATIONAL_DATABASE
- service_role_name: The name of the service role, to override default.
- service_role_arn: The ARN of an existing service role
- endpoint: The endpoint of the datasource. Required for AWS_LAMBDA, AMAZON_ELASTICSEARCH, AMAZON_OPENSEARCH_SERVICE
- region: The region of the datasource. Required for AMAZON_DYNAMODB, AMAZON_ELASTICSEARCH, AMAZON_OPENSEARCH_SERVICE
- table_name: The name of the table. Required for AMAZON_DYNAMODB
- event_bus_name: The name of the event bus. Required for AMAZON_EVENTBRIDGE
- cluster_arn: The ARN of the cluster. Required for RELATIONAL_DATABASE
- secret_arn: The ARN of the secret. Required for RELATIONAL_DATABASE
- database_name: The name of the database. Required for RELATIONAL_DATABASE
- schema: The schema of the database. Required for RELATIONAL_DATABASE
EOF
type = object({
name = object({
type = string
endpoint = optional(string)
region = optional(string)
table_name = optional(string)
event_bus_name = optional(string)
cluster_arn = optional(string)
secret_arn = optional(string)
database_name = optional(string)
schema = optional(string)
service_role_name = optional(string)
service_role_arn = optional(string)
})
})
default = {}
}

# Resolvers
Expand Down
Loading