Error that I get when deployed a stack:
Syntax errors in policy. (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID:
That's my role policy that cause an error:
roleEc2:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
-
Effect: Allow
Principal:
Service:
- 'ec2.amazonaws.com'
Action:
- 'sts:AssumeRole'
Path: '/'
Policies:
-
PolicyName: 'bucket-access'
PolicyDocument:
Version: '2012-10-17'
Id: 'BucketPolicy'
Statement:
- Effect: Allow
Action:
- s3:ListBucket
- s3:GetObject
- s3:GetBucketLocation
Resource:
- arn:aws:s3:::code-dir
- arn:aws:s3:::code-dir/*
Principal: !Ref BucketPrincipal
And I don't know how to debug it, I don't know how to understand where is an error, what line number.