opensearch
Creates OpenSearch or ElasticSearch domain
Collection: community.aws
Full Name: community.aws.opensearch
Synopsis
Creates OpenSearch or ElasticSearch domain
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| access_policies | dict | |||
| advanced_security_options | dict | |||
| allow_intermediate_upgrades | bool | true | ||
| auto_tune_options | dict | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| cluster_config | dict | |||
| cognito_options | dict | |||
| debug_botocore_endpoint_logs | bool | false | ||
| domain_endpoint_options | dict | |||
| domain_name | str | yes | ||
| ebs_options | dict | |||
| encryption_at_rest_options | dict | |||
| endpoint_url | str | |||
| engine_version | str | |||
| node_to_node_encryption_options | dict | |||
| profile | str | |||
| purge_tags | bool | true | ||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| snapshot_options | dict | |||
| state | str | present | ||
| tags | dict | |||
| validate_certs | bool | true | ||
| vpc_options | dict | |||
| wait | bool | false | ||
| wait_timeout | int | 300 |
Example
yaml
- name: Create OpenSearch domain for dev environment, no zone awareness, no dedicated masters
community.aws.opensearch:
domain_name: "dev-cluster"
engine_version: Elasticsearch_1.1
cluster_config:
instance_type: "t2.small.search"
instance_count: 2
zone_awareness: false
dedicated_master: false
ebs_options:
ebs_enabled: true
volume_type: "gp2"
volume_size: 10
access_policies: "{{ lookup('file', 'policy.json') | from_json }}"
- name: Create OpenSearch domain with dedicated masters
community.aws.opensearch:
domain_name: "my-domain"
engine_version: OpenSearch_1.1
cluster_config:
instance_type: "t2.small.search"
instance_count: 12
dedicated_master: true
zone_awareness: true
availability_zone_count: 2
dedicated_master_instance_type: "t2.small.search"
dedicated_master_instance_count: 3
warm_enabled: true
warm_type: "ultrawarm1.medium.search"
warm_count: 1
cold_storage_options:
enabled: false
ebs_options:
ebs_enabled: true
volume_type: "io1"
volume_size: 10
iops: 1000
vpc_options:
subnets:
- "subnet-e537d64a"
- "subnet-e537d64b"
security_groups:
- "sg-dd2f13cb"
- "sg-dd2f13cc"
snapshot_options:
automated_snapshot_start_hour: 13
access_policies: "{{ lookup('file', 'policy.json') | from_json }}"
encryption_at_rest_options:
enabled: false
node_to_node_encryption_options:
enabled: false
auto_tune_options:
enabled: true
maintenance_schedules:
- start_at: "2025-01-12"
duration:
value: 1
unit: "HOURS"
cron_expression_for_recurrence: "cron(0 12 * * ? *)"
- start_at: "2032-01-12"
duration:
value: 2
unit: "HOURS"
cron_expression_for_recurrence: "cron(0 12 * * ? *)"
tags:
Environment: Development
Application: Search
wait: true
- name: Increase size of EBS volumes for existing cluster
community.aws.opensearch:
domain_name: "my-domain"
ebs_options:
volume_size: 5
wait: true
- name: Increase instance count for existing cluster
community.aws.opensearch:
domain_name: "my-domain"
cluster_config:
instance_count: 40
wait: true