java - 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 :
- created a spring boot rest web service with a few rest api exposed
- checked out the api in aws ec2 instance
- 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 ?
解决方案
- 创建了具有所需权限的 IAM 角色
- 在 IAM 角色的信任关系中添加 EC2
- 在 EC2 上部署我的应用程序
瞧
推荐阅读
- sendmail - 我在哪里可以看到电子邮件?
- amazon-web-services - 如何在 AWS 网络防火墙的 cloudformation 中读取 !GetAtt 返回的键列表:值
- python - 使用python从字符串格式时间戳中提取日期
- azure - Azure 开发操作板:将工作项移动到不同的团队板
- java - 我有一个问题,比如在自定义中选择和取消选择四个单选按钮
- react-native - 我想在反应原生 dateTimePicker 中显示选定的日期和时间
- azure-devops - azure devops,经典管道:在自定义条件下使用参数
- java - 在 MacOS 上,我可以在我的 Java 应用程序的 Info.plist 文件中添加一个默认设置吗
- typescript - 使用 typescript-eslint 强制执行文件命名约定
- clojure - 如何导入异常以用于 clojure 测试