Skip to content

feat: migrate CSVD patch4 module code from CSVD/terraform-csvd-patch4 #1

Merged
merged 7 commits into from
Jul 8, 2026

Conversation

arnol377
Copy link
Collaborator

@arnol377 arnol377 commented Jul 8, 2026

  • Add full module implementation: kms, lambda, logs, outputs, policies, rds, roles, sqs, locals, variables
  • Add lambda source code: dispatcher, worker, step-result, layer
  • Add schema/patch40.sql
  • Update data.tf with comprehensive VPC/SG/subnet lookups
  • Update versions.tf to require terraform >= 1.0.0 and include archive provider
  • Update variables.common.tf: remove duplicate 'tags' variable (now in variables.tf)
  • Remove locals.tf.initial stub (replaced by real locals.tf)

Dave Arnold added 7 commits July 8, 2026 13:40
- Add full module implementation: kms, lambda, logs, outputs, policies,
  rds, roles, sqs, locals, variables
- Add lambda source code: dispatcher, worker, step-result, layer
- Add schema/patch40.sql
- Update data.tf with comprehensive VPC/SG/subnet lookups
- Update versions.tf to require terraform >= 1.0.0 and include archive provider
- Update variables.common.tf: remove duplicate 'tags' variable (now in variables.tf)
- Remove locals.tf.initial stub (replaced by real locals.tf)
- tags.tf: set legacy_tags = var.tags (replaces account/infra/app var merge)
- locals.tf: replace manual finops_tags + base_tags with module.tags.tags
  and per-resource role via module.tags.finops_roles[role]
- variables.tf: remove finops_project_name and finops_project_number variables
  (finops config now lives in tags.yml)
The aws-iam-role module prepends r- internally, so passing r-name
resulted in r-r-name. Strip the prefix from patch_role_name,
patch_execution_role_name, and patch_execproxy_role_name.
- locals.tf: all resource/log group name expressions
- lambda.tf: path.module archive sources and layer source_path
- sqs.tf: policy_id fields and owner ARN identifiers
- policies.tf: all ARN constructions (iam, lambda, logs, rds-db) and org path
- roles.tf: module source git@ format + role_description strings

Also corrects roles.tf module sources from git::https:// to git@ per
terraform-support naming convention.
worker:
  - replace unused RESULTS_QUEUE_URL with input_queue_url (sqs.delete_message)
  - add dbEndpoint, dbUsername, dbDatabase, dbRegion

step_result:
  - add environment block with dbEndpoint, dbUsername, dbDatabase, dbRegion

dispatcher unchanged (no DB access)
- Add patch_target_role_name variable (default: r-inf-patch) for the
  cross-account role name that must exist in each target account
- Worker Lambda now passes aws_partition and patch_target_role_name as
  env vars alongside existing DB/queue vars
- ec2.py builds the target ARN dynamically from env vars instead of
  hardcoding partition (aws-us-gov) and role name (r-inf-patch)
Copy link
Collaborator

@morga471 morga471 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morga471 morga471 merged commit 19a8562 into master Jul 8, 2026
@morga471 morga471 deleted the feature/migrate-csvd-module branch July 8, 2026 21:47
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants