Skip to content

AWS deployment

Jair Avilés edited this page Feb 7, 2024 · 2 revisions

Prerequisites

  1. Generate IAM user credentials from a user with proper permissions (e.g. AdministratorAccess) for programatic calls to your AWS account.
  2. Download, install and configure AWS CLI v2.
  3. Download, install and configure AWS SAM CLI.

Overview

The following architecture shows how the Springboot app is deployed to AWS. User Checker module is deployed as a lambda function. An API gateway of Rest API type associated to the user checker fraud module will receive any incoming HTTP event. A stream proxy defined as a class in the app, will handle this events between the gateway and the lambda. The lambda is attached to a AWSLambdaBasicExecutionRole IAM policy.

graph TD
    API[API Gateway]-->|HTTP Event| Lambda[UserFraudChecker lambda]
    Lambda-->|Assume Role| IAMRole[IAM Role<br> Basic Execution]

    classDef aws fill:#ff9900,color:#fff,stroke:#000000,stroke-width:2px;
    class API,Lambda,IAMRole aws;
Loading

Instructions

You need to validate you have installed and configure the CLIs

# check cli
aws --version

sam --version

Create a new AWS configuration via the CLI

# You'll need to specify your access credentilas
aws configure

On the root project director, run these commands

# build project before deployment 
sam build # optionally if you have docker available, attach the flag --user-container

# deploy with guided steps
sam deploy --guided

# Optionally. Delete AWS resources
sam delete

References

Clone this wiki locally