将cloudformation中的多个IAM内联策略附加到同一角色



我正在检查是否可以使用云信息附加多个IAM策略。我已经附加了一个托管策略,我可以附加和内联策略,但想检查我是否可以附加多个内联策略。

我想加入相同的角色

1( 托管策略2( 内联策略-13( 内联策略-2

谢谢Nataraj

这是完全可能的。相关字段为ManagedPolicyArnsPolicies

Resources: 
RootRole: 
Type: "AWS::IAM::Role"
Properties: 
AssumeRolePolicyDocument: 
Version: "2012-10-17"
Statement: 
- Effect: "Allow"
Principal: 
Service: 
- "ec2.amazonaws.com"
Action: 
- "sts:AssumeRole"
Path: "/"
ManagedPolicyArns:
- 'arn:aws:iam::ACCOUNT_ID:policy/myname/ManagedPolicy'
Policies: 
- PolicyName: "Inline Policy 1"
PolicyDocument: 
Version: "2012-10-17"
Statement: 
- Effect: "Allow"
Action: "*"
Resource: "*"
- PolicyName: "Inline Policy 2"
PolicyDocument: 
Version: "2012-10-17"
Statement: 
- Effect: "Allow"
Action: "*"
Resource: "*"

有关更多详细信息/标注,请查看文档:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html

相关内容

  • 没有找到相关文章

最新更新