The application consists of:
- 1 AWS REST Api Gateway
- 2 Lambdas
- 1 DynamoDB table
- AWS account
- aws-cli installed on your host and configured
The instruction below is for Unix based systems
- Clone the repo
git clone https://github.com/vadymbat/aws-serverless-announcement-microservice.git \
&& cd aws-serverless-announcement-microservice
- Configure access to AWS
export AWS_DEFAULT_REGION='eu-central-1'
export AWS_ACCESS_KEY_ID=''
export AWS_SECRET_ACCESS_KEY=''
export AWS_SESSION_TOKEN=''
- Deploy the application
bash -e deploy.sh
- Configure access to AWS
export AWS_DEFAULT_REGION='eu-central-1'
export AWS_ACCESS_KEY_ID=''
export AWS_SECRET_ACCESS_KEY=''
export AWS_SESSION_TOKEN=''
- Run cleanup script
bash -e cleanup.sh
- Clone the repo
git clone https://github.com/vadymbat/aws-serverless-announcement-microservice.git \
&& cd aws-serverless-announcement-microservice/terraform
- Configure access to AWS
export AWS_DEFAULT_REGION='eu-central-1'
export AWS_ACCESS_KEY_ID=''
export AWS_SECRET_ACCESS_KEY=''
export AWS_SESSION_TOKEN=''
- Build the application
bash -e build.sh
- Deploy with terraform
terraform apply
- Configure access to AWS
export AWS_DEFAULT_REGION='eu-central-1'
export AWS_ACCESS_KEY_ID=''
export AWS_SECRET_ACCESS_KEY=''
export AWS_SESSION_TOKEN=''
- Remove application resources with terraform
terraform destroy
- Run cleanup script
bash -e cleanup.sh
- After deploy script is finished in the output find the Api ulr:
The API is available at https://213m57v17g.execute-api.eu-central-1.amazonaws.com/dev
- Create an announcement using the url you got:
curl --request POST \
--url https://213m57v17g.execute-api.eu-central-1.amazonaws.com/dev/announcement \
--header 'content-type: application/json' \
--data '{
"title" : "Test Title",
"date" : "2011-11-04 2211",
"description": "Test description"
}'
- List all the announcements:
curl --request GET \
--url https://213m57v17g.execute-api.eu-central-1.amazonaws.com/dev/announcement \
--header 'content-type: application/json'