Github Repo
Generate personal access token for the repo
Go to your profile (right top icon), click on
Settings
On the left menu, click on
Developer settings
On the left menu, click on
Personal access tokens
Click
Generate new token
For
note
, type
Repo Name
Under
select scope
, select
repo
and
workflow
Click
Generate token
Copy your
personal access token
to another text file.\
E.g., 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 in below screenshot.
obtain aws_access_key, aws_secret_key and aws_session_key
can be retrieved from secrets manager
add these keys into the github repo
go to repo
go to settings
On the left menu, expand
Secrets
, click
Actions
Click
New repository Secret
For
Name
, type
AWS_ACCESS_KEY_ID
For
value
, type
<your value in earlier step>
Click
Add secret
Do the same for the following secrets
For
Name
, type
AWS_SECRET_ACCESS_KEY
For
value
, type
<your value in earlier step>
For
Name
, type
AWS_SESSION_TOKEN
For
value
, type
<your value in earlier step>
For
Name
, type
AWS_REGION
For
value
, type
us-east-1
Lambda
Host backend service on lambda
create lambda
Go to
Services
(or press
Alt-S
), search and click
Lambda.
On
Lambda,
click
Create Function
For
Function name,
type
lambda_Name
e.g., project-2022-23t1-g1-team1-lambda
Ensure
Runtime
is
Node.js 16.x
Under
Permissions,
expand
Change default execution role
Select
Use an existing role
Under
Existing Role,
select
LabRole
Click
Create Function
API Gateway
create api gateway
Go to
Services
(or press
Alt-S
), search and click
API Gateway.
On
API Gateway,
click
Create API
Under
REST API,
select
Build
Under
Create New API
, select
New API
For
API name,
type
project-2022-23t1-g1-<teamNo>-API
e.g., project-2022-23t1-g1-team1-API
Click
Create API
create get function
Under
Resources,
click
Actions,
select
Create Method
Choose
Get
, click on the "
tick
" button
Under
Lambda Region
, ensure
us-east-1
Under
Lambda Function
, select
project-2022-23t1-g1-<teamNo>-lambda
Click
Save.
Click
OK.
enable CORS // this allows for HTTP methods such as GET and POST
Under
Resources,
click
Actions,
select
Enable CORS
Click
Enable CORS and replace existing CORS headers
Click
Yes, replace existing values
deploy API
Under
Resources,
click
Actions,
select
Deploy API
Under
Deployment Stage
, select
[New Stage]
Under
Stage name
, type
IntegrationTesting
Click
Deploy
Click
Save Changes
save the URL that is your exposed endpoint
Cloud9
Browser based into AWS services.
Go to
Services
(or press
Alt-S
), search and click
Cloud9.
On
Cloud9,
click
Create Environment