Amazon web services 如何在aws cloudformation模板中限制特定于SQS的IAM角色
我是aws cloudformation模板的新手,我想将以下角色仅限于SQS服务。 请建议我如何使用条件实现相同的目标 我的模板示例::Amazon web services 如何在aws cloudformation模板中限制特定于SQS的IAM角色,amazon-web-services,yaml,amazon-cloudformation,amazon-iam,amazon-sqs,Amazon Web Services,Yaml,Amazon Cloudformation,Amazon Iam,Amazon Sqs,我是aws cloudformation模板的新手,我想将以下角色仅限于SQS服务。 请建议我如何使用条件实现相同的目标 我的模板示例:: AWSTemplateFormatVersion: 2010-09-09 Description: >- This template creates Role Parameters: vpcname: Type: String Description: Enter vpcname Resources: ErrorQueu
AWSTemplateFormatVersion: 2010-09-09
Description: >-
This template creates Role
Parameters:
vpcname:
Type: String
Description: Enter vpcname
Resources:
ErrorQueueRole:
Type: 'AWS::IAM::Role'
Properties:
RoleName: !Join ["",[ErrorQueueRole.,!Ref vpcname]]
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- sqs.amazonaws.com
Action:
- sts:AssumeRole
Condition:
StringEquals:
SQS使用的是而不是IAM角色,因此此处仅限于此提供的功能
有限数量的服务,如SNS、Lambda和S3支持通常所说的服务。假设服务(SQS)支持连接到服务的功能,则需要将Arn添加到您尝试触发的服务中
例如,如果允许SQS调用Lambda,则需要修改Lambda函数策略,例如
{
"Sid": "sqs",
"Effect": "Allow",
"Principal": {
"Service": "sqs.amazonaws.com"
},
"Action": "lambda:InvokeFunction",
"Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function"
}
SQS使用的是而不是IAM角色,因此此处仅限于此提供的功能
有限数量的服务,如SNS、Lambda和S3支持通常所说的服务。假设服务(SQS)支持连接到服务的功能,则需要将Arn添加到您尝试触发的服务中
例如,如果允许SQS调用Lambda,则需要修改Lambda函数策略,例如
{
"Sid": "sqs",
"Effect": "Allow",
"Principal": {
"Service": "sqs.amazonaws.com"
},
"Action": "lambda:InvokeFunction",
"Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function"
}
你能解释一下你想要实现什么吗?你能解释一下你想要实现什么吗?嗨。问题是关于sqs。你能解释一下sqs是如何扮演一个角色的吗?我很好奇sqs在什么样的场景中扮演了角色?是的,我在重新阅读了问题后意识到,现在已经确定了答案。谢谢你发现@Marcin:)谢谢。现在它更有意义了。现在我可以支持答案了:-)嗨。问题是关于sqs。你能解释一下sqs是如何扮演一个角色的吗?我很好奇sqs在什么样的场景中扮演了角色?是的,我在重新阅读了问题后意识到,现在已经确定了答案。谢谢你发现@Marcin:)谢谢。现在它更有意义了。现在我可以支持答案:——)