I am creating a simple AWS Cloudformation template file for an AppSync API. I would like to create the GraphQL schema in a separate file and reference it from the stack template but have been unable to do so.
The stack template is in a file template.yaml
. The following snippet defines the GraphQL schema:
GraphQLSchema:
Type: AWS::AppSync::GraphQLSchema
Properties:
ApiId: !GetAtt AppSyncAPI.ApiId
DefinitionS3Location: schema.graphql
The GraphQL schema is in the same directory called in a separate file called schema.graphql
.
schema {}
When in use the aws-cli to create the stack, the following error message appears in the Cloudformation events log when creating the GraphQLSchema:
"S3 location not valid for DefinitionS3Location"
How do I reference a local file for the schema and have the aws-cli automatically bundle it together?