2021-06-13

AWS essentials - 2 - try Java SDK - S3 example

1. Set up env (this step is done before)

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html

2. Get the code from ASW Java SDK 

2.1. Set up pom.xml

(waiting for IntelliJ finished it's background tasks,indexing etc)

(I'd use Java 11,  not 1.7)

(dealing with duplicates in pom.xml - "build" section)

ok, the issue is fixed - it's time to run the code

find AWS SDK for Java 2.0 documentation examples

(fixing missing  imports: org.apache.logging.log4j.Logger;TestInstance)

Looks like all the issues are fixed - time to run the test - confirm S3 bucket is created

the bucket is created - bucket-name-2021-06-13, it is empty now - let's upload a file - it says "Test 3 passed" - let's see AWS S3 contents - looks good: the file asdf.txt is copied to S3 as "asdf.in.s3.txt"


2021-06-09

AWS essentials - Step 1 - Create AIM admin user


 1. Create IAM user (we should not use AWS Root account for programmatic access to AWS - we will create corresponding IAM user instead)

2. Install AWS CLI - Command Line Interface

for Linux:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-install
 
for Windows:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html#cliv2-windows-install 
 
3. Set up AWS credentials
you may use default (us-east-1) region. I will use eu-central-1 for now.

4. Make sure your user is able to connect AWS resources - for example, let's examine S3 access
$ aws s3 mb s3://bucket-name-2021-06-09
and from AWS UI we see the bucket is created: bucket-name-2021-06-09
 
So, first step is done - we've created IAM user and confirmed it has access to AWS 
 
SIMPLE MONTHLY CALCULATOR: 
https://calculator.s3.amazonaws.com/index.html
A newer version of the S3 calculator is available 
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html
AWS Code Sample: 
https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-javav2-example_code-ses.html 
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/ses 

AWS SDK for Java, version 2:

https://docs.aws.amazon.com/sdk-for-java/index.html