下面是我陷入捕获function_id
和aws_appsync_function.appsync_functions
引用创建的代码aws_appsync_resolver
#---- Create AppSync Functions -----
resource "aws_appsync_function" "appsync_functions" {
for_each = var.appsync_function
name = each.value.name
api_id = aws_appsync_graphql_api.appsync.id
data_source = each.value.data_source
request_mapping_template = file(each.value.request_template_path)
response_mapping_template = file(each.value.response_template_path)
description = each.value.description
}
#---- Create AppSync Resolvers -----
resource "aws_appsync_resolver" "appsync_pipeline_resolver" {
type = "Query"
api_id = aws_appsync_graphql_api.appsync.id
field = var.appsync_resolver.trailheadItemById.name
request_template = file(var.appsync_resolver.trailheadItemById.request_template_path)
response_template = file(var.appsync_resolver.trailheadItemById.response_template_path)
kind = "PIPELINE"
for_each = var.appsync_function
pipeline_config {
functions = aws_appsync_function.appsync_functions[each.key].name==var.appsync_resolver.trailheadItemById.name ? aws_appsync_function.appsync_functions["trailheadItemById"].function_id : ""
}
}
上面的代码捕获了我放在 pipeline_config 下的所有 function_id 和条件不起作用!我可以获得语法方面的帮助来完成这项工作吗?
谢谢你。