How to secure the graceful shutdown of a Spring Boot application running on AWS EC2 instance

Problem We want to have a way to automatically instruct a Spring Boot application to do a graceful shutdown. This is useful for example when we use CodeDeploy to deploy the application to an EC2 instance, because it allows us to let the application shutdown gracefully when we are deploying a new version. Assumptions ForContinue reading “How to secure the graceful shutdown of a Spring Boot application running on AWS EC2 instance”

Working with AWS Secrets Manager

Problem We want to be able to use secret credentials in our application without leaving them hard-coded or in a configuration file. AWS Secrets Manager is an AWS service that provides us with an encrypted database were we can store our secrets securely in the cloud. Our application will connect to Secrets Manager at startupContinue reading “Working with AWS Secrets Manager”

How to configure the AWS CLI

Problem We want to be able to use AWS services with a command-line interface. The AWS CLI The AWS CLI is a tool that allows us to control our AWS resources from the command line. To install the AWS CLI locally (this is only necessary for running the CLI locally, the EC2 instances already haveContinue reading “How to configure the AWS CLI”

How to integrate a Java application with the AWS Java SDK

Problem Given a Java application that runs in an EC2 instance, we want to enable it to call AWS services. This is useful for example to call services like Secrets Manager to retrieve secrets. Authentication with AWS services when running locally When running locally, the SDK has several ways of obtaining the credentials. We willContinue reading “How to integrate a Java application with the AWS Java SDK”

Setting up a simple CICD pipeline with AWS CodePipeline

Goal Our objective is to build an tool that can build a given application on the cloud, producing an artifact, and deploy it to an EC2 instance on AWS. For this tutorial, the application is a Java program stored in a Github repo and built as a Maven project that produces a jar file. TheContinue reading “Setting up a simple CICD pipeline with AWS CodePipeline”