Skip to content

ack/iac client - #262

Closed
albertodonato wants to merge 1 commit into
ack/api-refactorfrom
ack/iac-client
Closed

albertodonato wants to merge 1 commit into
ack/api-refactorfrom
ack/iac-client

Conversation

@albertodonato

Copy link
Copy Markdown
Contributor

Stack created with GitHub Stacks CLI • Give Feedback 💬

### what

Add `internal/api/iac`, a JSON REST client for the IaC (Sinistral) API, built
on the shared transports from `internal/api`. Non-successful responses are
converted to `api.NotFound` (404) or `api.APIError`, reporting the FastAPI
`detail` message (including validation errors) or the API gateway `message`.

Add the `iac_endpoint` provider attribute (also `STACKLET_IAC_ENDPOINT`
environment variable) for the IaC API endpoint. If not set, it's derived from
the Stacklet API endpoint by replacing the `api.` hostname prefix with
`api.sinistral.`. The IaC client uses the same API key as the platform one.

Provider data now includes an `IaCAPI` client, which is exposed to resources
and data sources as `iacAPI`. If the IaC endpoint can't be determined, the
provider configuration still succeeds, and an error is reported when IaC
resources or data sources are used.

### why

Allow adding `stacklet_iac_*` resources and data sources.

### testing

Unit tests against a local HTTP server for all request methods, path escaping
and error responses, and for endpoint resolution precedence and derivation.
`just lint` and `just test` pass.

### docs

Regenerated provider docs, updated dev docs.
@albertodonato
albertodonato added this pull request to stack #263 October 23, 2026 08:47
An error occurred while trying to automatically change base from ack/api-refactor to main October 23, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant