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 name: String } type Annotation { deprecation: deprecation description: String name: String! } input ApidocInput { version: String } type Apidoc { version: String! } input ApplicationInput { key: String } type Application { key: String! } input AttributeInput { deprecation: deprecationInput description: String name: String value: AWSJSON } type Attribute { deprecation: deprecation description: String 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 name: String plural: String values: [enum_valueInput] } type Enum { attributes: [attribute]! deprecation: deprecation description: String name: 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] default: String deprecation: deprecationInput description: String name: String required: Boolean type: String } type Header { attributes: [attribute]! default: String deprecation: deprecation description: String name: String! required: Boolean! type: String! } input ImportInput { annotations: [annotationInput] application: applicationInput enums: [String] interfaces: [String] models: [String] namespace: String organization: organizationInput unions: [String] uri: String version: String } type Import { annotations: [annotation] application: application! enums: [String]! interfaces: [String] models: [String]! namespace: String! organization: organization! unions: [String]! uri: String! version: String! } input InfoInput { contact: contactInput license: licenseInput } type Info { contact: contact license: license } input InterfaceInput { attributes: [attributeInput] deprecation: deprecationInput description: String fields: [fieldInput] name: String plural: String } type Interface { attributes: [attribute]! deprecation: deprecation description: String fields: [field]! name: String! 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] name: String plural: String } type Model { attributes: [attribute]! deprecation: deprecation description: String fields: [field]! interfaces: [String] name: String! plural: String! } input OperationInput { attributes: [attributeInput] body: bodyInput deprecation: deprecationInput description: String method: method parameters: [parameterInput] path: String responses: [responseInput] } type Operation { attributes: [attribute]! body: body deprecation: deprecation description: String method: method! parameters: [parameter]! path: String! responses: [response]! } input OrganizationInput { key: String } type Organization { key: String! } 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 plural: String type: String } type Resource { attributes: [attribute]! deprecation: deprecation description: String operations: [operation]! path: String plural: String! type: String! } input ResponseInput { attributes: [attributeInput] code: deprecation: deprecationInput description: String headers: [headerInput] type: String } type Response { attributes: [attribute] code: ! deprecation: deprecation description: String headers: [header] type: String! } input ServiceInput { annotations: [annotationInput] apidoc: apidocInput application: applicationInput attributes: [attributeInput] baseUrl: String description: String enums: [enumInput] headers: [headerInput] imports: [importInput] info: infoInput interfaces: [interfaceInput] models: [modelInput] name: String namespace: String organization: organizationInput resources: [resourceInput] unions: [unionInput] version: String } type Service { annotations: [annotation] apidoc: apidoc application: application! attributes: [attribute]! baseUrl: String description: String enums: [enum]! headers: [header]! imports: [import]! info: info! interfaces: [interface] models: [model]! name: String! namespace: String! organization: organization! resources: [resource]! unions: [union]! version: String! } input UnionInput { attributes: [attributeInput] deprecation: deprecationInput description: String discriminator: String interfaces: [String] name: String plural: String types: [union_typeInput] } type Union { attributes: [attribute]! deprecation: deprecation description: String discriminator: String interfaces: [String] name: 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 Method { CONNECT DELETE GET HEAD OPTIONS PATCH POST PUT TRACE } enum ParameterLocation { FORM HEADER PATH QUERY } enum ResponseCodeOption { DEFAULT } schema { query: Query mutation: Mutation } DependsOn: - GqlApi Outputs: ApiEndpoint: Description: The endpoint for the AppSync API. Value: !GetAtt GqlApi.GraphQLUrl