首页 > 解决方案 > how to create IAM role for a spring boot rest api web service deployed in aws ec2 instance

问题描述

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 ?

标签: javaamazon-web-servicesamazon-s3amazon-ec2

解决方案


  1. 创建了具有所需权限的 IAM 角色
  2. 在 IAM 角色的信任关系中添加 EC2
  3. 在 EC2 上部署我的应用程序


推荐阅读