0
votes

I am new to AWS.

What I have done :

  1. created a spring boot rest web service with a few rest api exposed
  2. checked out the api in aws ec2 instance
  3. execute the spring boot application

I have enabled required port for communication , thus I am able to access the rest APIs from browser client .

But my AWS services calls are using a secret-key pair for authentication when application context loads up for a given user .

Now I am working on removing the keys based authentication for AWS servies and start using IAM-ROLE-BASED authentication so I dont have to share keys in source code or on ec-2 instance config files.

What I understood from IAM roles , is that I have create an IAM role which will be consumed by rest apis clients for aws services authentication .

what services should I allow in AWS IAM ROLE to be able to call my rest api service ?

1
Sorry I am still not able to understand your question. Are you trying to provide authentication for Rest API ? - Santosh Balaji
Are you trying to secure your API endpoints via IAM (which would probably require AWS API Gateway in front of your API)? Or are you trying to provide IAM permissions to your Java code so that it can call AWS services (which simply involves assigning an IAM role to the EC2 instance)? You seem to be confusing and/or combining these two things. - Mark B

1 Answers

0
votes
  1. created an IAM role with required permission
  2. added EC2 in trust relationship for IAM role
  3. deployed my application on EC2

voila