Skip to content

fix(examples): move to the security-group 2.x rule schema and current keypair input - #103

Merged
clouddrove-ci merged 1 commit into
masterfrom
fix/examples-security-group-2x-schema
Aug 6, 2026
Merged

fix(examples): move to the security-group 2.x rule schema and current keypair input#103
clouddrove-ci merged 1 commit into
masterfrom
fix/examples-security-group-2x-schema

Conversation

@clouddrove-ci

Copy link
Copy Markdown
Member

Problem

tf-checks has been failing on master since at least 2026-06-02. The cause is in the examples, not the module: they pin current module versions while still passing arguments those versions removed.

Error: Unsupported argument
  on example.tf line 89, in module "http_https":
  89:   new_sg_ingress_rules_with_cidr_blocks = [{
An argument named "new_sg_ingress_rules_with_cidr_blocks" is not expected here.

Five arguments across both examples:

Passed Pinned version Current name
new_sg_ingress_rules_with_cidr_blocks (http_https, ssh) security-group 2.0.3 new_sg_ingress_rules
new_sg_egress_rules_with_cidr_blocks (http_https, ssh) security-group 2.0.3 new_sg_egress_rules
create_private_key_enabled (keypair) keypair 1.3.4 enable_private_key

terraform init dies on these before reaching module "ec2-autoscale", so tf-checks never actually tests this module. Every PR inherits the red check.

Fix

Translate to the 2.x schema. Each rule is now one aws_vpc_security_group_ingress_rule or egress_rule and takes exactly one source, so rules that previously listed several CIDRs, or an IPv4 and an IPv6 range together, become one entry per source:

  • http_https egress: one rule with cidr_blocks + ipv6_cidr_blocks becomes all-ipv4 and all-ipv6
  • ssh ingress and egress: one rule spanning vpc_cidr_block and additional_cidr_block becomes one entry per CIDR

Effective access is unchanged. rule_count is gone, replaced by the required key, and protocol is now ip_protocol.

Verification

examples/on-demand: terraform init -> 0 errors, terraform validate -> Success!
examples/spot:      terraform init -> 0 errors, terraform validate -> Success!

terraform fmt -check -recursive clean.

Relationship to other PRs

Independent of #101 and #102, but #101's tf-checks cannot go green until this merges, since it fails on these same lines.

… keypair input

Both examples pin clouddrove/security-group/aws 2.0.3 and clouddrove/keypair/aws
1.3.4 while still passing arguments those versions removed:

  new_sg_ingress_rules_with_cidr_blocks -> new_sg_ingress_rules
  new_sg_egress_rules_with_cidr_blocks  -> new_sg_egress_rules
  create_private_key_enabled            -> enable_private_key

terraform init fails on all five before it reaches this module, so tf-checks has
been red on master since at least 2026-06-02 and every pull request has carried
a failing check unrelated to its own contents.

2.x builds one aws_vpc_security_group_ingress_rule or egress_rule per entry, and
each rule takes exactly one source. Rules that previously listed several CIDRs,
or an IPv4 and an IPv6 range together, are therefore split into one entry per
source. Effective access is unchanged.

Verified with terraform init and terraform validate in both examples.
@clouddrove-ci
clouddrove-ci merged commit d936090 into master Aug 6, 2026
4 of 5 checks passed
@clouddrove-ci
clouddrove-ci deleted the fix/examples-security-group-2x-schema branch August 6, 2026 18:02
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.

2 participants