AWSTemplateFormatVersion: 2010-09-09 Description: AppSync setup Parameters: FunctionStack: Description: The stack name that deploys the Lambda functions to invoke. Type: String Resources: DataSourceRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Action: sts:AssumeRole Effect: Allow Principal: Service: appsync.amazonaws.com Policies: - PolicyName: LambdaInvoker PolicyDocument: Version: 2012-10-17 Statement: - Action: lambda:InvokeFunction Effect: Allow Resource: RoleName: !Sub '${AWS::StackName}-lambda-role' GqlApi: Type: AWS::AppSync::GraphQLApi Properties: AuthenticationType: AWS_IAM Name: !Ref AWS::StackName GqlSchema: Type: AWS::AppSync::GraphQLSchema Properties: ApiId: !GetAtt GqlApi.ApiId Definition: | type Mutation { } type Query { } input AnnotationInput { deprecation: deprecationInput description: String } type Annotation { deprecation: deprecation description: String } input ApiJsonInput { annotations: [annotationInput] apidoc: apidocInput attributes: [attributeInput] baseUrl: String description: String enums: [enumInput] headers: [headerInput] imports: [importInput] info: infoInput interfaces: [interfaceInput] models: [modelInput] name: String namespace: String resources: [resourceInput] unions: [unionInput] } type ApiJson { annotations: [annotation]! apidoc: apidoc attributes: [attribute]! baseUrl: String description: String enums: [enum]! headers: [header]! imports: [import]! info: info interfaces: [interface]! models: [model]! name: String! namespace: String resources: [resource]! unions: [union]! } input ApidocInput { version: String } type Apidoc { version: String! } input AttributeInput { name: String value: AWSJSON } type Attribute { name: String! value: AWSJSON! } input BodyInput { attributes: [attributeInput] deprecation: deprecationInput description: String type: String } type Body { attributes: [attribute] deprecation: deprecation description: String type: String! } input ContactInput { email: String name: String url: String } type Contact { email: String name: String url: String } input DeprecationInput { description: String } type Deprecation { description: String } input EnumInput { attributes: [attributeInput] deprecation: deprecationInput description: String plural: String values: [enum_valueInput] } type Enum { attributes: [attribute] deprecation: deprecation description: String plural: String values: [enum_value]! } input EnumValueInput { attributes: [attributeInput] deprecation: deprecationInput description: String name: String value: String } type EnumValue { attributes: [attribute] deprecation: deprecation description: String name: String! value: String } input FieldInput { annotations: [String] attributes: [attributeInput] default: String deprecation: deprecationInput description: String example: String maximum: Int minimum: Int name: String required: Boolean type: String } type Field { annotations: [String] attributes: [attribute] default: String deprecation: deprecation description: String example: String maximum: Int minimum: Int name: String! required: Boolean! type: String! } input HeaderInput { attributes: [attributeInput] deprecation: deprecationInput description: String name: String required: Boolean type: String } type Header { attributes: [attribute] deprecation: deprecation description: String name: String! required: Boolean! type: String! } input ImportInput { uri: String } type Import { uri: String! } input InfoInput { contact: contactInput license: licenseInput } type Info { contact: contact license: license } input InterfaceInput { attributes: [attributeInput] deprecation: deprecationInput description: String fields: [fieldInput] plural: String } type Interface { attributes: [attribute] deprecation: deprecation description: String fields: [field] plural: String } input LicenseInput { name: String url: String } type License { name: String! url: String } input ModelInput { attributes: [attributeInput] deprecation: deprecationInput description: String fields: [fieldInput] interfaces: [String] plural: String } type Model { attributes: [attribute] deprecation: deprecation description: String fields: [field]! interfaces: [String] plural: String } input OperationInput { attributes: [attributeInput] body: bodyInput deprecation: deprecationInput description: String method: String parameters: [parameterInput] path: String responses: [responseInput] } type Operation { attributes: [attribute] body: body deprecation: deprecation description: String method: String! parameters: [parameter] path: String! responses: [response] } input ParameterInput { attributes: [attributeInput] default: String deprecation: deprecationInput description: String example: String location: parameter_location maximum: Int minimum: Int name: String required: Boolean type: String } type Parameter { attributes: [attribute] default: String deprecation: deprecation description: String example: String location: parameter_location! maximum: Int minimum: Int name: String! required: Boolean! type: String! } input ResourceInput { attributes: [attributeInput] deprecation: deprecationInput description: String operations: [operationInput] path: String } type Resource { attributes: [attribute] deprecation: deprecation description: String operations: [operation]! path: String } input ResponseInput { attributes: [attributeInput] deprecation: deprecationInput description: String headers: [headerInput] type: String } type Response { attributes: [attribute] deprecation: deprecation description: String headers: [header] type: String! } input UnionInput { attributes: [attributeInput] deprecation: deprecationInput description: String discriminator: String interfaces: [String] plural: String types: [union_typeInput] } type Union { attributes: [attribute] deprecation: deprecation description: String discriminator: String interfaces: [String] plural: String types: [union_type]! } input UnionTypeInput { attributes: [attributeInput] default: Boolean deprecation: deprecationInput description: String discriminatorValue: String type: String } type UnionType { attributes: [attribute] default: Boolean! deprecation: deprecation description: String discriminatorValue: String type: String! } enum ParameterLocation { FORM HEADER PATH QUERY } schema { query: Query mutation: Mutation } DependsOn: - GqlApi Outputs: ApiEndpoint: Description: The endpoint for the AppSync API. Value: !GetAtt GqlApi.GraphQLUrl