elasticsearch cloudformation yaml file not working

Viewed 67

Below is my yaml file for Elasticsearch template

AWSTemplateFormatVersion: 2010-09-09

Resources:
    ElasticSearchCluster:
        Type: AWS::Elasticsearch::Domain
        Properties:
            AccessPolicies:
                Version: '2012-10-17'
                Statement:
                - Effect: Allow
                  Principal:
                    AWS:
                    - arn:aws:iam::{NUMBER}:role/service-role/{role}
                    - arn:aws:iam::{NUMBER}:role/service-role/{role}
                  Action: 'es:*'
                  Resource: 'arn:aws:es:{RESTOFARN}*'
            DomainName: 'photos'
            ElasticsearchClusterConfig:
                InstanceType: 't3.small.elasticsearch'
            ElasticsearchVersion: '7.9'

I don't know why but I cannot go to the "NEXT" page when I specify with this template with error of The following resource types are not supported for resource import: AWS::Elasticsearch::Domain. Is there something wrong in the yaml file?

1 Answers

AWS::Elasticsearch::Domain can't be imported. Only few resources support importing, and AWS::Elasticsearch::Domain is not one of them. You have to recreate entire cluster if you want to bring it under CFN control.

List of supported resources for import is here.

Related