Skip to content

fix: require Terraform >= 1.3.0 for optional() attributes - #166

Open
sarankumar (sarankumar1325) wants to merge 2 commits into
cloudposse:mainfrom
sarankumar1325:fix/required-version-optional-attrs
Open

sarankumar (sarankumar1325) wants to merge 2 commits into
cloudposse:mainfrom
sarankumar1325:fix/required-version-optional-attrs

Conversation

@sarankumar1325

Copy link
Copy Markdown

what

  • Raise required_version from >= 1.0 to >= 1.3.0 in versions.tf and in every example's versions.tf.

why

  • variables.tf uses optional object attributes with defaults, such as optional(string, null) and optional(bool, false). Terraform added these in 1.3.0.
  • With the old floor, Terraform 1.0 through 1.2 pass the version check and then fail with a parse error that doesn't point to the real cause:
Error: Invalid type specification
Keyword "optional" is valid only as a modifier for object type attributes.
  • With >= 1.3.0, those versions get the clear "Unsupported Terraform Core version" message instead.
  • README.md is left alone because the readme bot regenerates its requirements table.

Checked locally with terraform init -backend=false and terraform validate:

  • Terraform 1.0.11 and 1.2.9 fail on main with the error above.
  • Terraform 1.3.10 passes for the root module and for examples/complete, s3, multi-origin, mtls and wordpress.
  • terraform fmt -check -recursive is clean.

references

variables.tf uses optional(type, default) object attributes, which Terraform only supports since 1.3.0. With the old >= 1.0 floor, Terraform 1.0-1.2 pass the version check and then fail with "Invalid type specification".
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T05:58:27.585270Z
We couldn’t complete this review. Comment @codex review to try again.
96fa7d3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mergify mergify Bot added the triage Needs triage label Oct 31, 2026
@mergify

mergify Bot commented Nov 6, 2026

Copy link
Copy Markdown

💥 This pull request now has conflicts. Could you fix it sarankumar (@sarankumar1325)? 🙏

@mergify mergify Bot added the conflict This PR has conflicts label Nov 6, 2026
…n-optional-attrs

Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>

# Conflicts:
#	examples/complete/versions.tf
#	examples/mtls/versions.tf
#	examples/multi-origin/versions.tf
#	examples/s3/versions.tf
#	examples/wordpress/versions.tf
#	versions.tf
@mergify mergify Bot removed the conflict This PR has conflicts label Nov 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Needs triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant