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

No data source found when trying to make custom resolver for elastic search #1046

Closed
uchar opened this issue Mar 15, 2019 · 3 comments · Fixed by aws-amplify/docs#546
Closed
Labels
documentation Add or update documentation graphql-transformer-v1 Issue related to GraphQL Transformer v1

Comments

@uchar
Copy link

uchar commented Mar 15, 2019

I'm trying to use geolocation in aws-amplify api base on this documentation : add-a-custom-geolocation-search-resolver-that-targets-an-elasticsearch-domain-created-by-searchable
For value of ElasticSearchDomain I used the output domain of this command :
aws es list-domain-names

My CustomResouce.json file is :
`

"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
	"AppSyncApiId": {
		"Type": "String",
		"Description": "The id of the AppSync API associated with this project."
	},
	"AppSyncApiName": {
		"Type": "String",
		"Description": "The name of the AppSync API",
		"Default": "AppSyncSimpleTransform"
	},
	"env": {
		"Type": "String",
		"Description": "The environment name. e.g. Dev, Test, or Production",
		"Default": "NONE"
	},
	"S3DeploymentBucket": {
		"Type": "String",
		"Description": "The S3 bucket containing all deployment assets for the project."
	},
	"S3DeploymentRootKey": {
		"Type": "String",
		"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
	}
},
"Resources": {
	"QueryNearbyUsers": {
		"Type": "AWS::AppSync::Resolver",
		"Properties": {
			"ApiId": {
				"Ref": "AppSyncApiId"
			},
			"DataSourceName": "api-ref-elasti-******",
			"TypeName": "Query",
			"FieldName": "nearbyUsers",
			"RequestMappingTemplateS3Location": {
				"Fn::Sub": [
					"s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/Query.nearbyUsers.req.vtl",
					{
						"S3DeploymentBucket": {
							"Ref": "S3DeploymentBucket"
						},
						"S3DeploymentRootKey": {
							"Ref": "S3DeploymentRootKey"
						}
					}
				]
			},
			"ResponseMappingTemplateS3Location": {
				"Fn::Sub": [
					"s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/Query.nearbyUsers.res.vtl",
					{
						"S3DeploymentBucket": {
							"Ref": "S3DeploymentBucket"
						},
						"S3DeploymentRootKey": {
							"Ref": "S3DeploymentRootKey"
						}
					}
				]
			}
		}
	}
},
"Conditions": {
	"HasEnvironmentParameter": {
		"Fn::Not": [
			{
				"Fn::Equals": [
					{
						"Ref": "env"
					},
					"NONE"
				]
			}
		]
	}
},
"Outputs": {
	"EmptyOutput": {
		"Description": "An empty output. You may delete this if you have at least one resource above.",
		"Value": ""
	}
}

`
But after trying to use amplify push it give me this error :

Resource Name: QueryNearbyUsers (AWS::AppSync::Resolver) Event Type: create Reason: No data source found named *** (Service: AWSAppSync; Status Code: 404; Error Code: NotFoundException; Request ID: 920993d8-46ef-11e9-82c8-e977f5face03)

Shouldn't it work ?! If not where can I findElasticSearchDomain value ?!

@uchar
Copy link
Author

uchar commented Mar 15, 2019

Ok I fixed it, it seems there is a typo in documentation and It should be :

"DataSourceName": "ElasticSearchDomain",

not :

"DataSourceName": "ElasticsearchDomain",

now it's working fine.. so many hours wasted on such a simple typo.

@yuth yuth added documentation Add or update documentation graphql-transformer-v1 Issue related to GraphQL Transformer v1 labels Mar 15, 2019
@yuth
Copy link
Contributor

yuth commented Mar 19, 2019

@uchar Thanks for the pointing the issue in Docs. I have updated the doc site to fix typo

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Add or update documentation graphql-transformer-v1 Issue related to GraphQL Transformer v1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants