AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Outputs: SurveyURL: Description: "Link to your Serverless Survey" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/newsurvey" Resources: SurveyTable: Type: AWS::Serverless::SimpleTable Properties: PrimaryKey: Name: id Type: String ProvisionedThroughput: ReadCapacityUnits: 5 WriteCapacityUnits: 5 Survey: Type: AWS::Serverless::Function Properties: Handler: survey.lambda_handler Runtime: python2.7 Events: RestAPI: Type: Api Properties: Path: /newsurvey Method: ANY SurveySubmit: Type: AWS::Serverless::Function Properties: Handler: survey_submit.lambda_handler Runtime: python2.7 Policies: - DynamoDBCrudPolicy: TableName: !Ref SurveyTable Events: RestAPI: Type: Api Properties: Path: /submitsurvey Method: ANY Environment: Variables: TABLE_NAME: !Ref SurveyTable