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 ActionHandlerInput { atType: String url: String } type ActionHandler { atType: String! url: String! } input AddressInput { addressCountry: String addressLocality: String addressRegion: String postOfficeBoxNumber: String postalCode: String streetAddress: String } type Address { addressCountry: String! addressLocality: String! addressRegion: String! postOfficeBoxNumber: String! postalCode: String! streetAddress: String! } input CustomerInput { name: String } type Customer { name: String! } input GotoActionInput { atContext: String atType: String description: String potentialAction: potential_actionInput } type GotoAction { atContext: String! atType: String! description: String! potentialAction: potential_action! } input MerchantInput { name: String } type Merchant { name: String! } input OfferInput { acceptedPaymentMethod: payment_methodInput addOn: offerInput advanceBookingRequirement: String aggregateRating: String availability: String availabilityEnds: AWSDateTime availabilityStarts: AWSDateTime availableAtOrFrom: placeInput availableDeliveryMethod: String businessFunction: String category: String deliveryLeadTime: String eligibleCustomerType: String eligibleDuration: String eligibleQuantity: String eligibleRegion: String eligibleTransactionVolume: String gtin13: String gtin14: String gtin8: String includesObject: String ineligibleRegion: String inventoryLevel: String itemCondition: String itemOffered: productInput mpn: String name: String price: Float priceCurrency: String priceSpecification: price_specificationInput priceValidUntil: String seller: organizationInput serialNumber: String sku: String validFrom: AWSDateTime validThrough: AWSDateTime } type Offer { acceptedPaymentMethod: payment_method addOn: offer advanceBookingRequirement: String aggregateRating: String availability: String availabilityEnds: AWSDateTime availabilityStarts: AWSDateTime availableAtOrFrom: place availableDeliveryMethod: String businessFunction: String category: String deliveryLeadTime: String eligibleCustomerType: String eligibleDuration: String eligibleQuantity: String eligibleRegion: String eligibleTransactionVolume: String gtin13: String gtin14: String gtin8: String includesObject: String ineligibleRegion: String inventoryLevel: String itemCondition: String itemOffered: product! mpn: String name: String! price: Float! priceCurrency: String! priceSpecification: price_specification priceValidUntil: String seller: organization serialNumber: String sku: String validFrom: AWSDateTime validThrough: AWSDateTime } input OneClickActionInput { atContext: String atType: String description: String potentialAction: potential_actionInput } type OneClickAction { atContext: String! atType: String! description: String! potentialAction: potential_action! } input OrderInput { acceptedOffer: [offerInput] billingAddress: addressInput customer: customerInput discount: Float discountCurrency: String isGift: Boolean merchant: merchantInput orderDate: AWSDateTime orderNumber: String orderStatus: String paymentMethod: payment_methodInput paymentMethodId: String price: Float priceCurrency: String priceSpecification: price_specificationInput url: String } type Order { acceptedOffer: [offer]! billingAddress: address customer: customer! discount: Float discountCurrency: String isGift: Boolean! merchant: merchant! orderDate: AWSDateTime! orderNumber: String! orderStatus: String! paymentMethod: payment_method! paymentMethodId: String! price: Float! priceCurrency: String! priceSpecification: price_specification url: String! } input OrganizationInput { address: addressInput legalName: String } type Organization { address: address! legalName: String! } input PaymentMethodInput { name: String } type PaymentMethod { name: String! } input PlaceInput { address: addressInput logo: String map: String telephone: String } type Place { address: address! logo: String! map: String! telephone: String! } input PotentialActionInput { atType: action_types handler: action_handlerInput name: String target: String } type PotentialAction { atType: action_types! handler: action_handler name: String! target: String! } input PriceSpecificationInput { eligibleQuantity: String eligibleTransactionVolume: String maxPrice: Float minPrice: Float price: Float priceCurrency: String validFrom: AWSDateTime validThrough: AWSDateTime valueAddedTaxIncluded: Boolean } type PriceSpecification { eligibleQuantity: String! eligibleTransactionVolume: String! maxPrice: Float! minPrice: Float! price: Float! priceCurrency: String! validFrom: AWSDateTime! validThrough: AWSDateTime! valueAddedTaxIncluded: Boolean! } input ProductInput { brand: organizationInput color: String manufacturer: organizationInput productID: String sku: String } type Product { brand: organization color: String manufacturer: organization productID: String! sku: String! } enum ActionTypes { CONFIRMACTION SAVEACTION TRACKACTION VIEWACTION } schema { query: Query mutation: Mutation } DependsOn: - GqlApi Outputs: ApiEndpoint: Description: The endpoint for the AppSync API. Value: !GetAtt GqlApi.GraphQLUrl