fix(examples): move to the security-group 2.x rule schema and current keypair input - #103
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tf-checkshas been failing onmastersince 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.Five arguments across both examples:
new_sg_ingress_rules_with_cidr_blocks(http_https,ssh)security-group2.0.3new_sg_ingress_rulesnew_sg_egress_rules_with_cidr_blocks(http_https,ssh)security-group2.0.3new_sg_egress_rulescreate_private_key_enabled(keypair)keypair1.3.4enable_private_keyterraform initdies on these before reachingmodule "ec2-autoscale", sotf-checksnever 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_ruleoregress_ruleand 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_httpsegress: one rule withcidr_blocks+ipv6_cidr_blocksbecomesall-ipv4andall-ipv6sshingress and egress: one rule spanningvpc_cidr_blockandadditional_cidr_blockbecomes one entry per CIDREffective access is unchanged.
rule_countis gone, replaced by the requiredkey, andprotocolis nowip_protocol.Verification
terraform fmt -check -recursiveclean.Relationship to other PRs
Independent of #101 and #102, but #101's
tf-checkscannot go green until this merges, since it fails on these same lines.