aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

OpenSearch Auto-Tune & Off-peak Window #1546

Open autarchprinceps opened 1 year ago

autarchprinceps commented 1 year ago

Name of the resource

AWS::OpenSearchService::Domain

Resource name

No response

Description

OpenSearch create API has AutoTuneOptions & OffPeakWindowOptions that are missing from the CloudFormation implementation. This should be as easy as to forward options for these to create & modify domain calls, as far as I can see.

Other Details

https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_CreateDomain.html#API_CreateDomain_RequestBody

jamesrenaud commented 1 year ago

In case anyone ends up here looking for the OffPeakWindowOptions - this is available now as of 2022-03-24

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchservice-domain.html#cfn-opensearchservice-domain-offpeakwindowoptions

paul-uz commented 1 year ago

I am still getting errors when trying to deploy a CF config where I have OffPeakWindowOptions in my clusterconfig

jamesrenaud commented 1 year ago

@paul-uz what's the error?

Within your AWS::OpenSearchService::Domain you should have something like ...

"MyDomain":{
   "Type":"AWS::OpenSearchService::Domain",
   "Properties":{
      "OffPeakWindowOptions":{
          "Enabled":true,
          "OffPeakWindow":{
               "WindowStartTime":{
                    "Hours":0,
                    "Minutes":30
               }
          }
      }
   }
}
MyDomain:
  Type: AWS::OpenSearchService::Domain
  Properties:
    OffPeakWindowOptions:
      Enabled: true
      OffPeakWindow:
        WindowStartTime:
          Hours: 0
          Minutes: 30
paul-uz commented 1 year ago

Nvm, I had it inside ClusterConfig when it should have been outside.

But now I get

Resource handler returned message: "Invalid request provided: You must turn on Auto-Tune for domains with standby.

Full resource:

OpenSearch:
    Type: AWS::OpenSearchService::Domain
    UpdatePolicy:
      EnableVersionUpgrade: true
    Properties:
      ClusterConfig:
        DedicatedMasterCount: 3
        DedicatedMasterEnabled: true
        DedicatedMasterType: "m5.large.search"
        InstanceCount: 3
        InstanceType: "m5.large.search"
        MultiAZWithStandbyEnabled: true
        ZoneAwarenessConfig:
          AvailabilityZoneCount: 3
        ZoneAwarenessEnabled: true
      OffPeakWindowOptions:
        Enabled: true
      DomainName: streamline
      EBSOptions:
        EBSEnabled: true
        VolumeSize: 20
      EngineVersion: "OpenSearch_2.3"
paul-uz commented 1 year ago

Eurgh, https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html#auto-tune-enable

You currently can't enable or disable Auto-Tune using AWS CloudFormation.

paul-uz commented 1 month ago

Any update on this? It's been over a year.