0

能否请你帮忙。我需要在 Ruby 模板中加入一些客户管理的策略(join(':', 'arn:aws:iam', ref('AWS::AccountId'),'policy/some-managed-ec2-default-policy' ) ),但不断出现错误语法错误。尝试了不同的组合,对我没有任何帮助:(非常感谢任何帮助。谢谢。我的代码是

  resource 'InstanceRole',
       Type: 'AWS::IAM::Role',
       Properties: {
         Path: '/',
         ManagedPolicyArns: {
          get_att('CommonPolicies','IDs'),
          join(':', 'arn:aws:iam', ref('AWS::AccountId'),'policy/some-managed-ec2-default-policy')
        },
         AssumeRolePolicyDocument: {
           Statement: [
             {
               Effect: 'Allow',
               Principal: { Service: ['ec2.amazonaws.com'] },
               Action: ['sts:AssumeRole']
             }
           ]
         }
       }

我的错误是:

./ec2.rb:293: syntax error, unexpected ',', expecting =>
...et_att('CommonPolicies','IDs'),
...                              ^
./ec2.rb:295: syntax error, unexpected '}', expecting keyword_end
            },
            ^
./ec2.rb:305: syntax error, unexpected '}', expecting end-of-input
           }
           ^
4

0 回答 0