Files
seaweedfs/terraform/provider/scripts
Chris LuandClaude Opus 5.5 79e99e7865 terraform: add a SeaweedFS Terraform provider for S3, IAM and S3 Tables (#13478)
* terraform/provider: import the SeaweedFS Terraform provider

Import terraform-provider-seaweedfs by Luís Costa (MIT) as a nested Go
module. It manages S3 buckets and their configuration (tags, CORS,
lifecycle, versioning, policy, encryption, public access block,
ownership controls, request payment, quota), IAM users, access keys,
groups, roles, policies, attachments, OIDC providers and service
accounts, and S3 Tables buckets, namespaces, tables, policies and
maintenance configuration.

The module path and the provider source address move to seaweedfs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: build and test in-tree

Drop the standalone repo's release and git-hook instructions, credit the
original author, and list the provider in the terraform layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform: vet and unit-test the provider in CI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep configured JSON in state after apply

Bucket, group, managed and S3 Tables policies stored the compacted JSON
sent to the server, so a policy written as a heredoc or with file()
failed apply with an inconsistent result. Keep the planned string, and
keep configured table metadata while the server's copy is semantically
equal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: read IAM policy documents without query unescaping

SeaweedFS returns user, group and managed policy documents as raw JSON
and role trust policies path-escaped. Query unescaping turned a "+" in a
resource into a space and failed on a literal "%". Return valid JSON as
is and path-unescape anything else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep service account settings left out of the config

description, expiration and status are optional and computed, so a
change to another attribute planned them as unknown and Update sent
empty values. SeaweedFS reads an empty Expiration as "never expires".
Carry the prior state forward for unknown values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: use the root IAM path in the full example

The user resource accepts only "/", so the example failed at user
creation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: make the smoke test and local build portable

Use the in-repo chart by default and check it before touching the
cluster, bind the port-forward to 127.0.0.1 and fail when it does not
start, build from the module directory, and point dev_overrides at the
directory holding the binary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep large JSON numbers exact when normalizing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: compare single statements, empty Sid and scalar conditions canonically

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: reject unknown provider settings instead of using the environment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: do not adopt a bucket owned by another identity

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: clear tags of an adopted bucket when the config sets none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: report bucket configuration settings SeaweedFS did not store

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: treat empty and absent lists alike when comparing bucket configuration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: refuse to adopt an existing IAM user unless a retried create made it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep omitted role settings so a trust policy change updates in place

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: resend a service account expiration only when it changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep a configured expiration that names the same instant

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: stop retrying CreateAccessKey when a failed attempt left a key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: add new group members before removing old ones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: reject empty or padded OIDC client IDs, thumbprints and URL

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep an empty OIDC list as a known empty set

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: reject an empty namespace or name for a table policy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: compare table metadata with the server's omitted required=false

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: do not replace a table when only metadata formatting differs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: keep a created S3 Tables object in state when its cleanup fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: reject an explicitly empty compaction strategy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: document import IDs and the object lock versioning destroy case

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: stop on any uncertain CreateAccessKey failure and name the keys it left

Only NoSuchEntity (user not visible yet) is retried. Any other failure,
including cancellation and a failure on the last attempt, lists the
user's keys once more and reports the new ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: do not adopt an IAM user found after a failed CreateUser attempt

A retry that hits EntityAlreadyExists cannot tell whether the failed
attempt or another client created the user, so ask for an import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: point BucketAlreadyExists on bucket create to terraform import

SeaweedFS answers BucketAlreadyExists both for another identity's bucket
and for the caller's own bucket that has an ACL, so the create cannot
adopt it safely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: treat omitted public access block flags as false when comparing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: restore the BucketOwner-only note on the request payment resource

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: say the smoke test runs the version the chart deploys

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* terraform/provider: make the unknown endpoint test check the unknown-setting error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 22:08:19 -08:00
..