Skip to content

update lambda def and change architectures to be singular - #40

Merged
flybayer merged 5 commits into
ma/rvn-lambdafrom
bb-lambda2
Jul 2, 2026
Merged

update lambda def and change architectures to be singular#40
flybayer merged 5 commits into
ma/rvn-lambdafrom
bb-lambda2

Conversation

@flybayer

@flybayer flybayer commented Jul 2, 2026

Copy link
Copy Markdown
Member

Greptile Summary

This PR renames the architectures (list) variable to architecture (string) across the Terraform module, and significantly restructures the Ravion definition YAML — reorganising UI sections, introducing prebuilt_package / prebuilt_image build types to replace none, adding explicit ECR lifecycle and scan inputs, and refactoring the stack template to use shared partials.

  • architecturesarchitecture: All usages updated consistently across variables.tf, lambda_function.tf, locals.tf, validation.tf, tests, README, and the YAML definition. The Terraform layer wraps the scalar back into a list ([var.architecture]) for the AWS provider.
  • YAML restructuring: New build types (prebuilt_package, prebuilt_image), ECR lifecycle section, reordered runtime/zip/image sections, $template for the opentofu stack and builder infrastructure, and new CloudWatch Logs integration in the UI.
  • ECR repository now created for all Image package types: ecr_repository_creation_enabled is no longer gated on build_type == nixpacks || dockerfile; a module-managed ECR repo and bootstrap image are now provisioned for prebuilt_image mode too.

Confidence Score: 5/5

Safe to merge. The architectures→architecture rename is consistent across all six touched files and the YAML definition correctly wraps the scalar back into a list for the AWS provider.

All Terraform-layer changes (variable rename, validation, locals, tests, lambda resource) are mutually consistent and verified against variables.tf. The YAML restructuring is a large but coherent reorganisation with no logic gaps found. The only notable inconsistency is ecr_default_lifecycle_policy_enabled being hardcoded to true in the YAML while the Terraform default is false, mirroring the pre-existing timeout mismatch pattern — a cosmetic concern, not a functional defect.

compute/lambda/rvn-lambda-definition.yml — contains the ecr_default_lifecycle_policy_enabled: true hardcoded value that differs from the Terraform variable default.

Important Files Changed

Filename Overview
compute/lambda/variables.tf Renames architectures (list) to architecture (string) with updated validation; all other variables unchanged.
compute/lambda/lambda_function.tf Wraps scalar var.architecture into a list for the AWS provider (architectures = [var.architecture]); also updates the Lambda@Edge check from alltrue([for a in ...]) to a simple equality check.
compute/lambda/validation.tf Lambda@Edge architecture constraint updated from alltrue([for a in var.architectures : a == "x86_64"]) to var.architecture == "x86_64" — semantically equivalent for the new scalar variable.
compute/lambda/locals.tf Updates bootstrap_image_platform from contains(var.architectures, "arm64") to var.architecture == "arm64" — correct and equivalent.
compute/lambda/tests/basic.tftest.hcl Test variable updated from architectures = ["x86_64"] to architecture = "x86_64" to match the renamed variable.
compute/lambda/rvn-lambda-definition.yml Major restructuring: new build types, ECR section, reordered UI inputs, $template refactor. ecr_default_lifecycle_policy_enabled is hardcoded to true here while the Terraform variable defaults to false.
compute/lambda/README.md Updates examples and input table to reflect the architecture rename; no functional changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[package_type input] --> B{package_type?}
    B -->|Zip| C[architecture string\narchitectures = var.architecture in TF]
    B -->|Image| D{build_type?}

    C --> C1[Build: nixpacks / dockerfile / prebuilt_package]
    C1 --> C2[S3 code bucket\nbootstrap-package.zip seeded]
    C2 --> C3[Deploy: S3 key]

    D -->|nixpacks or dockerfile| E[ECR repo created\nBootstrap image pushed]
    D -->|prebuilt_image| F[ECR repo created\nBootstrap image pushed\nuser image_repository used at deploy]
    E --> G[Image build pipeline]
    G --> H[Deploy: image_ref appended to ECR repo URL]
    F --> I[Deploy: image_ref appended to image_repository input]

    C3 --> Z[Lambda function updated]
    H --> Z
    I --> Z
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[package_type input] --> B{package_type?}
    B -->|Zip| C[architecture string\narchitectures = var.architecture in TF]
    B -->|Image| D{build_type?}

    C --> C1[Build: nixpacks / dockerfile / prebuilt_package]
    C1 --> C2[S3 code bucket\nbootstrap-package.zip seeded]
    C2 --> C3[Deploy: S3 key]

    D -->|nixpacks or dockerfile| E[ECR repo created\nBootstrap image pushed]
    D -->|prebuilt_image| F[ECR repo created\nBootstrap image pushed\nuser image_repository used at deploy]
    E --> G[Image build pipeline]
    G --> H[Deploy: image_ref appended to ECR repo URL]
    F --> I[Deploy: image_ref appended to image_repository input]

    C3 --> Z[Lambda function updated]
    H --> Z
    I --> Z
Loading

Reviews (2): Last reviewed commit: "tweak" | Re-trigger Greptile

Comment thread compute/lambda/rvn-lambda-definition.yml
@flybayer

flybayer commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@greptile

@flybayer
flybayer requested a review from mabadir July 2, 2026 21:41
@flybayer
flybayer merged commit f2b5b55 into ma/rvn-lambda Jul 2, 2026
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