gpt4 book ai didi

amazon-web-services - 服务无法承担角色错误 - 使用 JDBC 目标创建 AWS Glue cloudformation

转载 作者:行者123 更新时间:2023-12-03 07:41:26 25 4
gpt4 key购买 nike

Resources:
GlueCrawlerRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- glue.amazonaws.com
Action:
- 'sts:AssumeRole'
Path: /service-role/
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole'
Policies:
- PolicyName: GlueAccess
PolicyDocument:
Version: 2012-10-17
Statement:
- Sid: kmsKeyAccess
Effect: Allow
Action:
- 'kms:Encrypt'
- 'kms:Decrypt'
- 'kms:ReEncrypt*'
- 'kms:GenerateDataKey*'
- 'kms:DescribeKey'
Resource: !Ref KmsKeyArn
- Sid: logKmsKey
Effect: Allow
Action:
- 'logs:AssociateKmsKey'
Resource: !Sub 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws-glue/:*'


GlueCrawler:
Type: 'AWS::Glue::Crawler'
Properties:
Name: !Sub '${AWS::StackName}'
Role: !GetAtt GlueCrawlerRole.Arn
DatabaseName: !Sub '${AWS::StackName}-database'
Targets:
S3Targets:
- Path: !Ref MyS3Bucket
JdbcTargets:
-
ConnectionName: "XXXXXXX"
Path: "ABCD/%"
DatabaseName: "rds-xxxxx-abcd01-private-db"
SchemaChangePolicy:
UpdateBehavior: "UPDATE_IN_DATABASE"
DeleteBehavior: "DEPRECATE_IN_DATABASE"
TablePrefix: "aurora_rds_"

<>服务无法承担角色 arn:aws:iam::xxxxxxxxxx:role/cua-enterprise-data-hub-dev-test-g-GlueCrawlerRole-1FB4KV7YGL1QB。请验证角色的 TrustPolicy(服务:AWSGlue;状态代码:400;错误代码:InvalidInputException;请求 ID:bb1b60a5-3301-40de-81bf-ea78018cffa9)

最佳答案

您的资源不正确。而不是

Resource: 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws-glue/:*'
Resource: 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:*'

应该有(缺少 !Sub):

Resource: !Sub 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws-glue/:*'
Resource: !Sub 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:*'

关于amazon-web-services - 服务无法承担角色错误 - 使用 JDBC 目标创建 AWS Glue cloudformation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66201426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com