我正在尝试通过cloudformation创建IAM角色。当我执行cloudformation模板时,出现以下错误。
Invalid IAM Instance Profile name
这是cloudformation的代码段
Role:
Type: "AWS::IAM::Role"
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
-
Effect: "Allow"
Principal:
Service:
- "ec2.amazonaws.com"
Action:
- "sts:AssumeRole"
Path: "/"
Policies:
Type: "AWS::IAM::Policy"
Properties:
PolicyName: "policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
-
Effect: "Allow"
Action:
- s3:PutObject
- s3:PutObjectTagging
- s3:GetObject
- s3:GetObjectTagging
- s3:DeleteObject
- s3:DeleteObjectTagging
Resource:
- arn:aws:s3:::s3-bucket/*
- arn:aws:s3:::s3-bucket/*
Roles:
- Ref: Role
RootInstanceProfile:
Type: "AWS::IAM::InstanceProfile"
Properties:
Path: "/"
Roles:
- Ref: "Role"
需要帮助解决这一问题。