Using AWS SDK with examples [DEPRECATED] - Revature-RPM/Launch-Testing-Service GitHub Wiki

link with pictures

using the Amazon SDK: Api link: https://sdk.amazonaws.com/java/api/latest/ Api reference: https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_Operations.html (search “service” API Operations to find the respective operations manual)

After going to the api link you will see a series of packages like so:

determine which AWS resource you would like to use and then scroll through the list of packages until you find the desired one:

After finding on the package you will be presented with a list of all the important classes for this resource:

The vast majority of the time the object being used to interact with the service will include the word "client" async or not depends on your needs during development. Clicking on the related client will open up a large series of methods relating to how the client is able to interact with the service:

At this time it is recommended to attempt what you are doing programmatically using only the AWS console. This is because any step you make during the console will likely need to be reflected in the java code.

In our case we needed to point our elastic beanstalk at a legal project, then set important configuration variables and then build the environment. This combined with knowledge of elastic beanstalk lead to us needing to use the following methods to cover the lifecycle: Application version:

Environment request:

Terminate request:

Here we go to the api reference and see what is required to run these commands and in depth explanations of what is not mandatory.

Requests all use the builder pattern meaning you have to grab the static builder (used for generating objects) chain together set methods to enforce mandatory properties, then finally call the build method to generate your object. like shown below

(further detail on this snippet can be found in the EBService.java file)

This request is now usable and we send it using the related client command. You get back a response object that can easily be used for logging and debugging.