【发布时间】:2020-10-17 09:32:30
【问题描述】:
我将 IAM 角色用于进行一些数据处理的粘合作业,为了完成这项任务,我需要承担执行粘合角色的角色。
例如,在以下 cloudformation 模板中,IAM::Policy 有权从 Dynamo 数据库表中查询并从 s3 存储桶中获取对象。
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
GlueAccessPolicy:
Type: AWS::IAM::Policy
Properties:
Roles:
- !Ref GlueRole
PolicyName: glue_access_policy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: 's3:getObject'
Resource:
- 's3_bucket_arn'
- Effect: Allow
Action:
- 'dynamodb:DescribeTable'
- 'dynamodb:Query'
Resource:
- 'dynamo_table_arn'
GlueRole:
Type: 'AWS::IAM::Role'
Properties:
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: 'Allow'
Principal:
Service:
- 'glue.amazonaws.com'
Action:
- 'sts:AssumeRole'
现在,question 说明了一个从角色 A 承担角色 B 并切换角色的示例。
那么,我有一个问题,GlueRole 是否可以或有效地假设为GlueRole?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation amazon-iam