Skip to content

feat(lambda): optional public ALB in requirements module - #30

Merged
agustincelentano merged 3 commits into
mainfrom
feat/optional-lambda-alb
Jul 13, 2026
Merged

feat(lambda): optional public ALB in requirements module#30
agustincelentano merged 3 commits into
mainfrom
feat/optional-lambda-alb

Conversation

@agustincelentano

Copy link
Copy Markdown
Contributor

Adds an opt-in public ALB (install_alb, default false) to the Lambda requirements module — ALB + HTTPS(443)/HTTP(80→redirect) listeners + SG — so stacks can expose Lambda over HTTP without hand-copying the ALB per cluster (previously done inline in galicia's infra layer). The Lambda scope workflow attaches per-scope target groups + listener rules to the HTTPS listener at runtime.

  • cert: DNS-validated wildcard from domain_name + public_zone_id, or reuse via certificate_arn (avoids a second *.<domain> next to static-files)
  • subnets: discovered by nullplatform/subnet-type=public tag on vpc_id, or public_subnet_ids
  • outputs: lambda_alb_arn / lambda_alb_listener_arn / lambda_alb_dns_name
  • default OFF ⇒ IAM-only consumers (e.g. lulobank) unaffected

New file lambda/specs/requirements/alb.tf + vars/outputs. fmt + validate + trivy clean.

Add an opt-in public ALB (install_alb, default false) to the Lambda requirements
module: ALB + HTTPS(443)/HTTP(80->redirect) listeners + SG, so stacks can expose
Lambda over HTTP without hand-copying the ALB per cluster (previously done inline
in galicia). The Lambda scope workflow attaches per-scope target groups + listener
rules to the HTTPS listener at runtime.

- cert: created as a DNS-validated wildcard from domain_name + public_zone_id,
  or reused via certificate_arn (avoids duplicating the static-files wildcard)
- subnets: discovered by nullplatform/subnet-type=public tag, or public_subnet_ids
- outputs: lambda_alb_arn / lambda_alb_listener_arn / lambda_alb_dns_name
- default OFF keeps IAM-only consumers unaffected
…role

The ALB networking override does data.aws_lb_listener / data.aws_lb lookups (and
the provider reads tags on refresh), needing read actions missing from the
enumerated list (DescribeTags, DescribeLoadBalancers, DescribeLoadBalancerAttributes).
Replace the enumerated Describe* reads with elasticloadbalancing:Describe* to cover
them all; mutating actions stay enumerated.
Reach parity with the galicia agent lambda policy set: the ALB networking
override reads the lambda permission (lambda:GetPolicy), waits on the Route53
change (route53:GetChange), and the agent scripts discover resources by tag
(tag:GetResources). These were the only actions galicia granted that the
requirements role was still missing.

@sebastiancorrea81 sebastiancorrea81 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm

@agustincelentano
agustincelentano merged commit fae610e into main Jul 13, 2026
5 checks 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