Amazon web services 无效的IAM实例配置文件名称-Cloudformation

Amazon web services 无效的IAM实例配置文件名称-Cloudformation,amazon-web-services,amazon-ec2,amazon-cloudformation,amazon-iam,Amazon Web Services,Amazon Ec2,Amazon Cloudformation,Amazon Iam,我正试图通过cloudformation创建IAM角色。当我执行cloudformation模板时,我得到以下错误信息 Invalid IAM Instance Profile name 下面是cloudformation的代码片段 Role: Type: "AWS::IAM::Role" Properties: AssumeRolePolicyDocument: Version: "2012-10-1

我正试图通过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"

需要有关解决此问题的帮助。

删除最后一行中角色周围的双引号。由于您正在寻找通过CloudFormation模板创建的资源,因此不应使用双引号作为资源名称。@krishna_mee2004感谢您的回复。让我们试试这个选项。