The swagger.yml file defines the API to be used by the microservice through the Amazon API Gateway. They need to be updated with AWS Account ID details and AWS Region target before deploying the microservice.
Before that you will need to configure email and username for git.
C:\Users\Administrator\git\dev-flight-svc>git config --global user.email "youremail"
C:\Users\Administrator\git\dev-flight-svc>git config --global user.name "awsstudent"
You need to push from Eclipse because git credentials are embedded in the Eclipse environment. You can also use the command line, but in this lab, we will not use this method. It will take some time to push the code and start deploying. Take some time to look at the structure of the project in the Eclipse IDE, especially the buildspec.yml, swagger.yml, and template.yml files that define the Amazon API Gateway, the AWS Lambda Function, and the build/deployment process. through AWS CodeBuild. You can check status of the deployment via Pipeline in the CodeStar project dashboard.
Since our Lambda function uses DBSecurityGroup, we need to allow DBSecurityGroup to be able to connect to the RDS Endpoint by further configuration as below:
When the page is opened, you will see an error message {“message”:“Missing Authentication Token”}. This happens because you are trying to access the root of the API, rather than a specific microservice. Edit the URL, add flightspecials to the end of the URL, we get a new URL of the form https://xxxxxxx.execute-api.us-east-1.amazonaws.com/Prod/flightspecials. Press Enter, we get the following result: