简体   繁体   English

从本地服务器访问SQS

[英]Access SQS from On-Prem Servers

I am trying to post messages to SQS queue from on-prem servers. 我正在尝试将邮件从本地服务器发布到SQS队列。 When I run it locally , I use AWS secret id and key to post messages to SQS. 在本地运行时,我使用AWS机密ID和密钥将消息发布到SQS。 But this is something that I need to generate every few hours. 但这是我每隔几个小时就需要产生的东西。 If I want to deploy this solution to a server and not have to refresh the token every few hours , what is the solution that I must adopt? 如果我想将此解决方案部署到服务器上,而不必每隔几个小时刷新一次令牌,那么我必须采用什么解决方案?

If you use any of the AWS SDK'S to build your on-premise application, you give the application the IAM access keys (the access key id and the secret access key), (often these end up in your ~/.aws subdirectory but it might vary for each language) and then each time your on-premise application calls any of the AWS functions the the AWSSDK, the app will provide the necessary keys. 如果您使用任何AWS开发工具包构建内部部署应用程序,则为该应用程序提供IAM访问密钥(访问密钥ID和秘密访问密钥),(通常这些访问密钥最终位于〜/ .aws子目录中,但是可能因每种语言而异),然后每次您的本地应用程序调用AWSSDK的任何AWS功能时,该应用程序都会提供必要的密钥。

These keys should only be given the bare minimum of rights to do only what you want, for example, in you case, the would have only rights to post messages to a particular SQS queue. 这些密钥仅应被赋予执行您想做的任何事情的最低限度的权限,例如,在您这种情况下,它们仅具有将消息发布到特定SQS队列的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM