Skip to content

feat(cloud/aws): make hosted_public_zone_id optional for private-only#408

Merged
jcastiarena merged 3 commits into
mainfrom
feat/cloud-aws-optional-public-zone
Jun 25, 2026
Merged

feat(cloud/aws): make hosted_public_zone_id optional for private-only#408
jcastiarena merged 3 commits into
mainfrom
feat/cloud-aws-optional-public-zone

Conversation

@jcastiarena

Copy link
Copy Markdown
Contributor

What

Makes hosted_public_zone_id optional in the cloud/aws/cloud module so private-only installations (no public hosted zone) can register the AWS provider config.

Why

The module always included hosted_public_zone_id in the attributes.networking payload. The API validates its format (^Z[A-Z0-9]{10,}$) and rejects an empty string, so a private-only install (which has no public zone) had no valid value to pass — the provider config could not be created.

Changes

  • hosted_public_zone_id now defaults to "" and is omitted from the payload when empty/null (conditional merge). A non-empty value is included as before — fully backward compatible.
  • Added a validation block: accepts empty/null (private-only) or a well-formed zone ID, catching malformed IDs at plan time instead of at the API.
  • Test private_only_omits_public_zone (+ a null variant) asserts the key is absent when empty and the private zone stays present.
  • README inputs/metadata updated (required: no, default: "").

Verification

  • tofu test: 5 passed, 0 failed.
  • pre-commit: OpenTofu fmt / validate / tofu test / trailing-whitespace / detect-private-key all pass.

🤖 Generated with Claude Code

@jcastiarena jcastiarena force-pushed the feat/cloud-aws-optional-public-zone branch from e3451d7 to 8f33d7c Compare June 25, 2026 17:05
The aws-configuration provider config always included hosted_public_zone_id
in the networking payload, and the API validates its format
(^Z[A-Z0-9]{10,}$), rejecting an empty string. Private-only installs (no
public hosted zone) had no valid value to pass, so the cloud config could
not be registered.

Make the variable optional (default "") and omit it from the payload when
empty. Backward compatible: a non-empty value is still included. Adds a test
asserting the key is absent when empty and the private zone is still present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jcastiarena jcastiarena merged commit 7f52d4b into main Jun 25, 2026
44 checks passed
@jcastiarena jcastiarena deleted the feat/cloud-aws-optional-public-zone branch June 25, 2026 19:45
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.

3 participants