OpenSearch's CreateDomain and the legacy CreateElasticsearchDomain store
the TagList they carry, but the tag-on-create table did not read the
`es` namespace, so under IAM enforcement a caller allowed to create a
domain could tag it with no es:AddTags, and a policy allowing the create
only with some tag did not hold. The reason the generator gave, that no
rule maps its REST routes, has not been true since they were vendored.
`es` moves to the generator's namespaces. The Service Reference lists
OpenSearch Service's operations for the `es` client alone, so, as the
request-resources generator does, an operation of a vendored REST model
it lists for no client is read as the action of its own name: it needs
the tagging actions of the operations the reference lists that action
for, and is checked with the request's tags when that action takes
them. The `opensearch` client's CreateDomain is es:CreateDomain, which
the reference lists for CreateElasticsearchDomain beside es:AddTags, as
the OpenSearch Service developer guide's policy for creating a domain
only with a tag grants es:CreateDomain and es:AddTags. Both creates now
need es:AddTags on the domain they name, and are checked with the tags
as aws:RequestTag/<key> and aws:TagKeys (587 operations over 72
namespaces, no other entry changed).
The handler also read a TagList the model does not allow, and not as the
check reads it: a tag with no value was dropped, though the check lets it
replace an earlier tag of its key, and an object's structures were tags,
though the check lets a member of the same name replace them. Either got
a denied tag past a deny on it. The model requires a list of tags, each
with a Key of 1 to 128 characters and a Value of up to 256, so CreateDomain
and AddTags now refuse anything else with a ValidationException, before
changing anything, and the tags checked are the tags a domain gets.
CreateDomain and UpdateDomainConfig dropped the zone awareness count, the
dedicated master type and count, EBS IOPS and throughput, advanced
options and the address type, and Floci had no off-peak window or
software update options, so a domain created by
terraform-aws-modules/opensearch planned a change after every apply.
Store and report them, with AWS's defaults for a new domain.
* fix(opensearch): scope domains to the request's region
Domain records were keyed by the bare name, so a domain created in one
region could be described, updated and deleted from another, and the
same name conflicted across regions. Key the store by region and name,
resolve every operation inside the region the request is signed for,
and migrate pre-scoping records onto the scoped key taking the region
from their ARN. Region-scope the legacy host-path data directory per
account and region, keeping the bare directory for records that predate
the region marker while it still exists.
Closes#6081
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(opensearch): reject a tag ARN naming another account as not found
findByArn resolved the account named in the ARN, where every fixed
lookup only reached the caller's account through the account-aware
storage backend, so a caller could read and change another account's
domain tags under the default settings. An ARN naming a foreign account
now answers ResourceNotFoundException the way Lambda layers, EventBridge
and Redshift answer theirs, and the RegionScoping suite pins it for the
three tag operations.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
---------
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(opensearch): allow configuring a data volume for domain containers
* fix(opensearch): isolate configured storage and prepare bind mounts
Include account and Region from the domain ARN in configured volume
names and bind paths, preserving the optional deployment namespace.
Treat missing ownership markers as FLOCI_MANAGED and remove name-based
ownership inference. Retain explicitly operator-owned storage and use
persisted volume names for managed cleanup.
Reuse the storage helper container lifecycle to prepare bind-directory
ownership and owner write access from the selected image. Leave existing
files untouched, propagate preparation failures, and release reserved
ports when storage preparation fails.
Preserve Linux daemon path syntax on Windows while keeping native
Windows paths and named volumes working.
Consolidate OpenSearchDomainManagerTest setup, add regression coverage
and a Linux Docker integration test, and update configuration comments
and documentation examples.
Fix an existing bug where opensearch container names did not include
account or region id.
* feat(opensearch): serve the legacy Elasticsearch Service 2015-01-01 API
`aws es` and Terraform's aws_elasticsearch_domain call the 2015-01-01
API, which Floci did not route, so every call got
UnknownOperationException.
ElasticsearchController serves the domain lifecycle, ListDomainNames and
the tag operations on that path by delegating to OpenSearchController,
renaming only the members the legacy model spells differently:
ElasticsearchVersion (bare "7.10", stored as "Elasticsearch_7.10") and
ElasticsearchClusterConfig. A legacy create without a version gets
Elasticsearch 7.10 rather than the OpenSearch default.
* fix(opensearch): reject blank legacy ElasticsearchVersion, report legacy instance types
ElasticsearchVersionString's pattern matches no blank or non-string value, so
CreateElasticsearchDomain now returns ValidationException instead of storing
an empty engine version. ESPartitionInstanceType lists only *.elasticsearch
types, so the legacy responses rewrite the store's *.search spelling (including
the m5.large.search default). The legacy test methods get distinct @Order
values.
* fix(opensearch): store legacy .elasticsearch instance types as .search, accept OS_X.Y
The legacy API now respells ElasticsearchClusterConfig.InstanceType from
*.elasticsearch to *.search on create and update, so the 2021 API reports
t3.small.search and the legacy API maps it back. ElasticsearchVersion's
OS_X.Y form is stored as OpenSearch_X.Y instead of Elasticsearch_OS_X.Y.
Replaces the jakarta.ws.rs wildcard import with explicit imports.
* feat(opensearch): parse, store, and return AccessPolicies
AccessPolicies was never parsed on CreateDomain/UpdateDomainConfig,
stored on the domain, or returned by DescribeDomain(s)/
DescribeDomainConfig, so aws_opensearch_domain.access_policies and
aws_opensearch_domain_policy were unsupported and any inline policy
was silently discarded. Threaded through as a plain string alongside
engineVersion, following the same pattern: bare string in
DomainStatus, Options+Status wrapper in DomainConfig (mirroring the
existing EngineVersion field there).
* fix(opensearch): drop unused region parameter from updateDomainConfig
Domain.region is baked into the ARN at CreateDomain time and never
recomputed on update, so the parameter had no effect. Its own local
variable in the controller was correspondingly dead too.
* test(opensearch): cover clearing AccessPolicies with an empty string
The empty-string-clears-the-policy behavior was implemented but not
exercised by any test.
Closes the follow-ups from #1025: domain option blocks now survive
CreateDomain → DescribeDomain, and DescribeInstanceTypeLimits returns
family-appropriate metadata instead of one canned EBS response.
- VPCOptions, AdvancedSecurityOptions, EncryptionAtRestOptions,
NodeToNodeEncryptionOptions, and DomainEndpointOptions now round-trip
through the management API. Real SDK clients (Terraform / CDK / Pulumi)
read these back to detect drift; previously they were silently dropped.
- Master passwords are accepted but never echoed back, matching AWS.
- AdvancedSecurityOptions.Enabled + InternalUserDatabaseEnabled without a
master user is rejected with ValidationException, as is
CustomEndpointEnabled without a CustomEndpoint value.
- New OpenSearchInstanceTypes catalog drives DescribeInstanceTypeDetails
and DescribeInstanceTypeLimits. or1.* now reports s3-backed storage
with the larger 8-36 TiB ceiling AWS documents; i3.* reports
instance-store; everything else stays EBS at 3584 GiB. Unknown types
fall back to a generic EBS spec instead of 404'ing.
- Floci still boots one Docker container per domain regardless of
instance type, but the management metadata now matches AWS so
introspection tools work correctly.
Tests: 60 OpenSearch tests pass. New: 6 OpenSearchInstanceTypesTest unit
tests + 6 OpenSearchDomainOptionsIntegrationTest end-to-end + 2
or1 / EBS instance-type-limit integration tests.
Live Docker validation: VPC + Encryption + N2N + Endpoint round-trip
on a real running domain; or1.2xlarge.search returns s3-backed/36864 GiB
while m6g.large.search returns ebs/3584 GiB; FGAC validation fires
correctly when MasterUserName is omitted.
Centralizes engine versions in a new OpenSearchVersions catalog and
threads them through CreateDomain / UpdateDomainConfig / UpgradeDomain
validation plus per-version Docker image resolution.
- Adds OpenSearch 3.0–3.6 and 2.15 / 2.17 / 2.19 to the supported list;
default version is now OpenSearch_2.19 (was 2.11).
- EngineVersion now maps to a concrete image tag at start time, so
CreateDomain --engine-version=OpenSearch_3.6 actually pulls
opensearchproject/opensearch:3.6.0 instead of always pulling the
default 2.x rolling tag.
- Elasticsearch_7.10 / 7.9 / 7.8 now resolve to their OSS images on
docker.elastic.co; previously these versions were advertised but the
service silently ran an OpenSearch 2.x container under the hood.
- OpenSearch 2.12+ start scripts require OPENSEARCH_INITIAL_ADMIN_PASSWORD
even when the security plugin is disabled. Set automatically.
- The Elasticsearch OSS distribution ships without x-pack, so any xpack.*
setting is rejected as an unknown setting at boot. Don't touch xpack
env on Elasticsearch_* domains.
- CreateDomain / UpdateDomainConfig / UpgradeDomain now reject unknown
engine versions and unsupported upgrade hops with ValidationException.
- GetCompatibleVersions returns the full source→targets matrix when
domainName is omitted and a single domain-scoped row when set, matching
AWS's documented behavior.
- INSTANCE_TYPES catalog gains Graviton2/3 (m6g, r6g, c6g, m7g, r7g, c7g)
and or1.* OpenSearch-optimized families that AWS now exposes.
Tests: 44 OpenSearch tests pass (31 integration + 13 new
OpenSearchVersionsTest unit tests). All four engine version paths
exercised live against Docker (OS 3.6, OS 2.11, ES 7.10 OSS, unknown
version rejection).
Replace the FLOCI_STORAGE_HOST_PERSISTENT_PATH footgun with automatic
named Docker volume management for RDS, OpenSearch, MSK, and ECR.
- Each resource gets a collision-free 6-char hex volumeId generated once
at creation and stored in the model. Container and volume names both use
it: floci-{service}-{volumeId}
- Volumes are labelled floci=true for easy pruning
- Memory mode always removes volumes on resource delete. Persistent modes
retain by default; set prune-volumes-on-delete: true to remove on delete
- Mode detection: FLOCI_STORAGE_HOST_PERSISTENT_PATH set to an absolute
path → host bind-mount mode (legacy); unset or non-absolute → named-
volume mode. Volume names in host-persistent-path are not supported
- Removed the container-storage config key — no longer needed
- Updated docker-compose.yml, and all docs
* docs: update Docker image references to floci/floci
* docs: keep README Docker Hub badges pointing to hectorvent/floci
The hectorvent/floci image has accumulated pull and size metrics; switch
the badges to floci/floci once the new image has comparable numbers.