AWSTemplateFormatVersion: '2010-09-09' Description: >- {"createdOn":"Mac","createdBy":"Amplify","createdWith":"7.6.2","stackType":"custom-customCloudformation","metadata":{}} Parameters: ProjectName: Default: geotrack Type: String Description: A description to identify project authgeotrack4e545e25IdentityPoolId: Type: String Description: >- Input parameter describing IdentityPoolId attribute for auth/geotrack4e545e25 resource authgeotrack4e545e25IdentityPoolName: Type: String Description: >- Input parameter describing IdentityPoolName attribute for auth/geotrack4e545e25 resource authgeotrack4e545e25UserPoolId: Type: String Description: >- Input parameter describing UserPoolId attribute for auth/geotrack4e545e25 resource authgeotrack4e545e25UserPoolArn: Type: String Description: >- Input parameter describing UserPoolArn attribute for auth/geotrack4e545e25 resource authgeotrack4e545e25UserPoolName: Type: String Description: >- Input parameter describing UserPoolName attribute for auth/geotrack4e545e25 resource authgeotrack4e545e25AppClientIDWeb: Type: String Description: >- Input parameter describing AppClientIDWeb attribute for auth/geotrack4e545e25 resource authgeotrack4e545e25AppClientID: Type: String Description: >- Input parameter describing AppClientID attribute for auth/geotrack4e545e25 resource env: Default: NONE Type: String Description: A description to identify environment (e.g. dev, prod) Outputs: ApiUrl: Value: Fn::Sub: https://${ApiGw}.execute-api.${AWS::Region}.amazonaws.com/v1/ Resources: ApiGwDeployment: Type: AWS::ApiGateway::Deployment DependsOn: ApiGwMethod Properties: RestApiId: Ref: ApiGw Description: Fn::Sub: ${ProjectName} ${env} Rest Api Deployment StageName: Stage ApiGwAuthorizer: Type: AWS::ApiGateway::Authorizer DependsOn: ApiGwDeployment Properties: IdentitySource: method.request.header.authorization Name: CognitoAuthorizer ProviderARNs: - Fn::Sub: - >- arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/${PoolApi} - PoolApi: Ref: authgeotrack4e545e25UserPoolId RestApiId: Ref: ApiGw Type: COGNITO_USER_POOLS ApiGwModel: Type: AWS::ApiGateway::Model Properties: ContentType: application/json RestApiId: Ref: ApiGw Schema: {} ApiGwResource: Type: AWS::ApiGateway::Resource Properties: ParentId: Fn::GetAtt: - ApiGw - RootResourceId PathPart: mock RestApiId: Ref: ApiGw ApiGwMethod: Type: AWS::ApiGateway::Method Properties: ApiKeyRequired: false AuthorizationType: NONE HttpMethod: POST Integration: ConnectionType: INTERNET IntegrationResponses: - ResponseTemplates: application/json: '{"message": "OK"}' SelectionPattern: 2\d{2} StatusCode: 200 - ResponseTemplates: application/json: '{"message": "Internal Server Error"}' SelectionPattern: 5\d{2} StatusCode: 500 PassthroughBehavior: WHEN_NO_TEMPLATES RequestTemplates: application/json: >- {"statusCode": $input.json('$.statusCode'), "message": $input.json('$.message')} Type: MOCK TimeoutInMillis: 29000 MethodResponses: - ResponseModels: application/json: Ref: ApiGwModel StatusCode: 200 - ResponseModels: application/json: Ref: ApiGwModel StatusCode: 500 OperationName: mock ResourceId: Ref: ApiGwResource RestApiId: Ref: ApiGw ApiGwv1Stage: Type: AWS::ApiGateway::Stage Properties: DeploymentId: Ref: ApiGwDeployment RestApiId: Ref: ApiGw StageName: v1 ApiGw: Type: AWS::ApiGateway::RestApi Properties: Name: Fn::Sub: ${ProjectName}-${env}-api ApiGwIdParameter: Type: AWS::SSM::Parameter Properties: Type: String Name: Fn::Sub: /amplify/${ProjectName}/apiId Value: Ref: ApiGw DependsOn: ApiGw ApiGwUrlParameter: Type: AWS::SSM::Parameter Properties: Type: String Name: Fn::Sub: /amplify/${ProjectName}/apiUrl Value: Fn::Sub: https://${ApiGw}.execute-api.${AWS::Region}.amazonaws.com/v1/ DependsOn: ApiGw ApiGwParentIdParameter: Type: AWS::SSM::Parameter Properties: Type: String Name: Fn::Sub: /amplify/${ProjectName}/apiParentId Value: Fn::GetAtt: - ApiGw - RootResourceId DependsOn: ApiGw ApiGwAuthorizerIdParameter: Type: AWS::SSM::Parameter Properties: Type: String Name: Fn::Sub: /amplify/${ProjectName}/apiAuthId Value: Ref: ApiGwAuthorizer DependsOn: ApiGw