'OpenSearch fails to create even with service linked role - Cloudformation

I am deploying a Opensearch Domain in Cloudformation, however even though I am creating a service linked role for OpenSearch it still fails to create, with the error in the image below:

enter image description here

The template is as:

OpenSearchRole:
    Type: 'AWS::IAM::ServiceLinkedRole'
    Properties:
      AWSServiceName: es.amazonaws.com
      Description: 'Role for ES to access resources in my VPC'

  OpenSearchDomain:
    Type: "AWS::OpenSearchService::Domain"
    DependsOn: [OpenSearchRole]
    Properties:
      Required properties

As this happen to anyone else, if so how am I able to solve this? I'm not sure if this might be because the service linked role takes sometime to propagate or something like that.

Any suggestions?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source