title: Deployment of servless app fails - Enable fine-grained access control or apply a restrictive access policy to your domain
body: <p>I have a serverless app where I would like to deploy an elasticsearch cluster. I have configured it like this:</p>
  <pre><code>PostsSearch:
        Type: AWS::Elasticsearch::Domain
        Properties:
          ElasticsearchVersion: '6.3'
          DomainName: images-search-${self:provider.stage}
          ElasticsearchClusterConfig:
            DedicatedMasterEnabled: false
            InstanceCount: 1
            ZoneAwarenessEnabled: false
            InstanceType: t2.small.elasticsearch
          EBSOptions:
            EBSEnabled: true
            Iops: 0
            VolumeSize: 10
            VolumeType: 'gp2'
          AccessPolicies:
            Version: '2012-10-17'
            Statement:
              - Effect: Allow
                Principal:
                  AWS: '*'
                Action: 'es:ESHttp*'
                Resource: '*'
  </code></pre>
  <p>But, I get an error:</p>
  <blockquote>
  <p>An error occurred: PostsSearch - Enable fine-grained access control or
  apply a restrictive access policy to your domain (Service:
  AWSElasticsearch; Status Code: 400; Error Code: ValidationException;
  Request ID: be0eca95-23ae-4ac9-be81-67cab37ccd70; Proxy: null).</p>
  </blockquote>
  <p>How should I fix this?</p>