-
The AWS Global Accelerator will be responsible to expose the Application Load Balancers to the internet. Its use has the following benefits:
- The user traffic is directed to the nearest application endpoint to the client, thus reducing internet latency and jitter;
- Improves application availability by continuously monitoring the health of application endpoints and routing traffic to the closest healthy endpoints;
- Eliminates the complexity of managing specific IP addresses for different AWS Regions.
-
The three Kubernetes clusters control planes are visible to the internet. This allows running commands against these clusters through the kubectl tool.
-
Each Kubernetes cluster will get the container images from an Amazon Container Registry (ECR) located in the same region.
-
For the database, there will be a primary DB Instance that synchronously replicates the data to a standby instance in a different Availability Zone (AZ). Each AZ runs on its own physically distinct, independent infrastructure, and is engineered to be highly reliable.
-
Go to the Implementation/ConsumerConsentsApp/src/main/resources/ directory and locate the file according to the profile you want to build (e.g. application-dev.yaml) and setup the following properties:
app.gdpr-controller-established-in-the-eu
: set totrue
if the underlying company is established in the EU (according to GDPR) orfalse
otherwise. This information will be important to decide if users must be required to give consent to process your personal data.spring.security.user
: set the initial user name and password for the system administrator. It is highly recommended to change this password as soon as the application is running (P.S.: this feature is not yet implemented).
-
Open your command shell and navigate to the Implementation/ConsumerConsentsApp directory.
-
Run the following command:
mvn clean package
-
That is it. Your package will be located at /ConsumerConsentsApp/target/consumer-consents-app.jar.
-
Setup the database access information changing the following environment variables:
CONSUMER_CONSENTS_APP_DB_URL
: the database url (e.g. jdbc:postgresql://postgresql.cwrl1ifz9wlk.us-east-1.rds.amazonaws.com/consumer_consents)CONSUMER_CONSENTS_APP_DB_USER_NAME
: the database user nameCONSUMER_CONSENTS_APP_DB_PASSWORD
: the database password
Please note that currently the application is only compatible with PostgreSQL.
-
Open your command shell and navigate to the /ConsumerConsentsApp/target/ directory.
-
Run the following command, choosing the desired profile:
java -jar -Dspring.profiles.active=dev consumer-consents-app.jar
-
After that you can open the URL http://localhost:8080/api/swagger-ui.html and start using the application API. Observe that most APIs needs authentication to work.
-
Build the application following the steps on the How to build section;
-
Build a container image with a new version tag and send it to the Amazon Container Registry (ECR) of each cluster region;
-
Provision possible infrastructure changes by deploying the /Implementation/ConsumerConsentsInfrastructure.yaml CloudFormation file;
-
Make a new kubernetes deployment in each region referencing this new container image using the kubectl tool.
Artifact | Name | Description |
---|---|---|
spring-boot-starter-security | Spring Security | Used for Authentication, authorization and cryptography. |
spring-boot-starter-data-jpa | Spring Data JPA | Database access. Eases development of applications that need to access JPA data sources. |
spring-boot-starter-actuator | Spring Boot Actuator | Brings production-ready features for monitoring application health. Through the HEALTHCHECK instruction, Docker can use the Actuator information to test a container to check that it is still working. This will enable the implementation of an autoscalng platform. |
postgresql | PostgreSQL Driver | Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database. |
geoip2 | MaxMind GeoIP2 | Gets the location of a user based on your IP address. The main advantage of this library is that it does not require internet access to get geographic location data. |
springfox-swagger2 | SpringFox | Automated JSON API documentation for API's built with Spring. |
springfox-swagger-ui | SpringFox Swagger UI | Swagger UI allows to visualize and interact with the API’s resources without having any of the implementation logic in place. |