From cc4de33c4988d5adc99744480a5cb74612b4dbdc Mon Sep 17 00:00:00 2001 From: vikasgoyal09 <15920057+vikasgoyal09@users.noreply.github.com> Date: Thu, 24 Feb 2022 17:39:51 +0530 Subject: [PATCH 1/3] Fixed:- Error creating AppSync Function: NotFoundException: No data source found named Appsync function resource should be dependent on data sources added fix for the above error --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index 5ee3a66..32285d7 100644 --- a/main.tf +++ b/main.tf @@ -207,6 +207,7 @@ resource "aws_appsync_resolver" "this" { # Functions resource "aws_appsync_function" "this" { + depends_on = [aws_appsync_datasource.this] for_each = var.create_graphql_api ? var.functions : {} api_id = aws_appsync_graphql_api.this[0].id From 9efe45a924f5ab9fe8cbcd543d357d66fd4bd6bd Mon Sep 17 00:00:00 2001 From: vikasgoyal09 <15920057+vikasgoyal09@users.noreply.github.com> Date: Wed, 20 Apr 2022 16:03:01 +0530 Subject: [PATCH 2/3] Update main.tf fix: indentation --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 32285d7..e321be0 100644 --- a/main.tf +++ b/main.tf @@ -207,9 +207,9 @@ resource "aws_appsync_resolver" "this" { # Functions resource "aws_appsync_function" "this" { - depends_on = [aws_appsync_datasource.this] for_each = var.create_graphql_api ? var.functions : {} + depends_on = [aws_appsync_datasource.this] api_id = aws_appsync_graphql_api.this[0].id data_source = lookup(each.value, "data_source", null) name = each.key From c8c04c88a1329ce16ad22bcb4927db25ac12c0d5 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Thu, 21 Apr 2022 10:17:28 +0200 Subject: [PATCH 3/3] Fixed code style a bit --- .pre-commit-config.yaml | 4 ++-- main.tf | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a010fd..a0925b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.64.0 + rev: v1.68.1 hooks: - id: terraform_fmt - id: terraform_validate @@ -23,7 +23,7 @@ repos: - '--args=--only=terraform_standard_module_structure' - '--args=--only=terraform_workspace_remote' - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.2.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer diff --git a/main.tf b/main.tf index e321be0..962e569 100644 --- a/main.tf +++ b/main.tf @@ -209,7 +209,6 @@ resource "aws_appsync_resolver" "this" { resource "aws_appsync_function" "this" { for_each = var.create_graphql_api ? var.functions : {} - depends_on = [aws_appsync_datasource.this] api_id = aws_appsync_graphql_api.this[0].id data_source = lookup(each.value, "data_source", null) name = each.key @@ -218,4 +217,6 @@ resource "aws_appsync_function" "this" { request_mapping_template = lookup(each.value, "request_mapping_template", null) response_mapping_template = lookup(each.value, "response_mapping_template", null) + + depends_on = [aws_appsync_datasource.this] }