Skip to content

Preserve aws-test-sg rules when Create VPC re-runs - #402

Merged
IPvSean merged 1 commit into
ansible:mainfrom
IPvSean:fix/create-vpc-preserve-sg-rules
Nov 11, 2026
Merged

IPvSean merged 1 commit into
ansible:mainfrom
IPvSean:fix/create-vpc-preserve-sg-rules

Conversation

@IPvSean

@IPvSean IPvSean commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Set purge_rules: false on Cloud | AWS | Create VPC so re-running Deploy Cloud Stack no longer strips inbound ports added by Deploy Shared Services (Mattermost 8065, Gitea 3000/80/8080) or Kafka (9095).
  • Shared Services and Cloud Stack share aws-test-sg by design; either workflow order should keep additive demo ports.

Why

amazon.aws.ec2_security_group defaults purge_rules to true. After Shared Services opened Mattermost/Gitea, a later Deploy Cloud Stack Create VPC marked the SG changed and removed those rules — Notify Chatroom then timed out to the still-correct credential URL.

Test plan

  • Fresh lab: Deploy Shared Services → Deploy Cloud Stack → confirm aws-test-sg still allows TCP 8065 and 3000 (and SSH 22)
  • Reverse order: Deploy Cloud Stack → Deploy Shared Services → Mattermost/Gitea provision still succeeds and ports remain
  • Notify Chatroom can reach Mattermost after both workflows
  • Kafka/EDA path still OK if Kafka was provisioned before a Cloud Stack re-run

Stop purging inbound security group rules so Deploy Cloud Stack after
Deploy Shared Services no longer strips Mattermost/Gitea/Kafka ports.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abwalczyk

Copy link
Copy Markdown

Comment, not blocking. purge_rules: false is the right change. Create VPC was enforcing rules as the full inbound set, so a later Deploy Cloud Stack removed the ports Mattermost and Gitea add with purge_rules: false. Leaving egress managed is correct, and Destroy Cloud Stack still deletes the group.

The comment overstates what this saves. TCP 9095, 27199, and 80 are already in Create VPC's public rule, so a re-run on current main keeps them. The ports this actually preserves are 8065, 3000, and 8080. "Either order" is a bit strong as well: Mattermost and Gitea skip the authorize task when aws-test-sg does not exist yet.

After this, removing a port or tightening a CIDR in rules will not update an existing aws-test-sg. That is the right tradeoff for a group those playbooks append to. infrastructure/docs/config-drift-kafka.md still says Create VPC defines the full inbound set; that is now a minimum set.

Please re-run Cloud | AWS | Create VPC after Shared Services and confirm 8065, 3000, and 8080 are still open. 22 and 9095 stay open without this patch, so they do not show the fix.

@IPvSean
IPvSean merged commit 7587387 into ansible:main Nov 11, 2026
1 check passed
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