Terraform provider for managing SplitSecure SAML2 resources via service-account API keys. Each Create / Delete is a SplitSecure proposal: the provider builds the envelope server-side, sends it through the proposal-scoped managed enclave, and polls until voters approve and the resource record lands.
splitsecure_saml2_identity_provider— SAML IdP on a SplitSecure team. Computedmetadata_xmlis suitable as thesaml_metadata_documentinput foraws_iam_saml_provider.splitsecure_saml2_service_provider— SAML SP bound to an IdP, supporting all 17 saml2v2 integration variants (AWS, Cloudflare, Okta, GCP, etc.).
Generated reference docs live in docs/; per-resource attribute tables, validators, and example blocks are kept in sync via tfplugindocs (make docs).
- Create a service account in the SplitSecure admin console.
- Generate an API key — token format
s2ak_{keyId}_{principalId}_{secret}. - Set
SPLITSECURE_BEARER_TOKENin the environment, or passbearer_tokenin the provider HCL block.
To test a local build against any plan (including examples/full) without
publishing to the registry, use the one-off install target. It builds the
provider and writes ~/.terraformrc with a dev_overrides block pointing
at the local binary; from then on every terraform invocation on this
machine uses the local build for splitsecure/splitsecure:
make install-dev # build + write ~/.terraformrc
make uninstall-dev # remove ~/.terraformrcinstall-dev refuses to clobber an existing ~/.terraformrc it didn't
write (detected via a marker comment); back it up first if you have one.
provider "splitsecure" {
bearer_token = "s2ak_..." # or SPLITSECURE_BEARER_TOKEN (the only secret)
endpoint = "https://..." # or SPLITSECURE_ENDPOINT (defaults to production)
org_s2r = "s2r:<deployment>:org:<org_id>" # required; or SPLITSECURE_ORG_S2R fallback
}org_s2r is provider-scoped, not per-resource — it's only consumed by the proposal-scoped enclave spawn at Send time. Multi-org callers alias the provider.
End-to-end example covering two SplitSecure teams + admin + read-only AWS federations: examples/full/main.tf.
cd examples/full
cp terraform.tfvars.example terraform.tfvars # fill in your s2r URIs (gitignored)
export SPLITSECURE_BEARER_TOKEN=s2ak_...
terraform plan
terraform apply -auto-approve
terraform destroy -auto-approvemake buildProduces terraform-provider-splitsecure with a CalVer version (1.YYMMDD.PATCH) baked in via -ldflags.
make lintmake docs # regenerates docs/ via tfplugindocs
make check-docs # regen + fail if there's a diff (matches the CI gate)go generate ./... (wired through main.go) is the underlying entry point.
go test ./... # unit-mode smoke test
TF_ACC=1 go test ./... # acceptance tests (deferred -- harness pending)