From c674c0601665367ce4c87bcace26579550c19ca2 Mon Sep 17 00:00:00 2001 From: Federico Maleh Date: Fri, 21 Aug 2026 16:12:40 -0300 Subject: [PATCH 1/6] Add terraform module to install scope --- lambda/specs/install/backend.tf | 5 + lambda/specs/install/main.tf | 77 +++++++++++++++ lambda/specs/install/provider.tf | 24 +++++ lambda/specs/install/terraform.tfvars.example | 42 ++++++++ lambda/specs/install/variables.tf | 97 +++++++++++++++++++ 5 files changed, 245 insertions(+) create mode 100644 lambda/specs/install/backend.tf create mode 100644 lambda/specs/install/main.tf create mode 100644 lambda/specs/install/provider.tf create mode 100644 lambda/specs/install/terraform.tfvars.example create mode 100644 lambda/specs/install/variables.tf diff --git a/lambda/specs/install/backend.tf b/lambda/specs/install/backend.tf new file mode 100644 index 0000000..7330a13 --- /dev/null +++ b/lambda/specs/install/backend.tf @@ -0,0 +1,5 @@ +terraform { + backend "s3" { + key = "lambda/install/terraform.tfstate" + } +} diff --git a/lambda/specs/install/main.tf b/lambda/specs/install/main.tf new file mode 100644 index 0000000..341fcdf --- /dev/null +++ b/lambda/specs/install/main.tf @@ -0,0 +1,77 @@ +################################################################################ +# Scope Definition +# Registers the service specification, scope type, and action specs in nullplatform. +################################################################################ + +module "scope_definition" { + source = "git::https://github.com/nullplatform/tofu-modules.git//nullplatform/scope_definition?ref=main" + + nrn = var.nrn + np_api_key = var.np_api_key + + service_path = var.service_path + + repository_service_spec = var.github_raw_url + repository_service_spec_branch = var.github_branch + repository_scope_template = var.github_raw_url + repository_scope_template_branch = var.github_branch + repository_action_templates = var.github_raw_url + repository_action_templates_branch = var.github_branch + + repo_path = var.repo_path + + service_spec_name = var.service_spec_name + service_spec_description = var.service_spec_description + + action_spec_names = [ + "adjust-provisioned-concurrency", + "adjust-reserved-concurrency", + "create-scope", + "delete-deployment", + "delete-scope", + "diagnose-deployment", + "diagnose-scope", + "finalize-blue-green", + "invoke", + "rollback-deployment", + "start-blue-green", + "start-initial", + "switch-traffic", + "update-scope", + ] + + external_metrics_provider = var.external_metrics_provider + external_logging_provider = var.external_logging_provider + + create_scope_configuration = true +} + +################################################################################ +# Scope Definition Agent Association +# Creates the notification channel that connects nullplatform events to the agent. +################################################################################ + +module "scope_definition_agent_association" { + source = "git::https://github.com/nullplatform/tofu-modules.git//nullplatform/scope_definition_agent_association?ref=main" + + nrn = var.nrn + api_key = var.np_api_key + + # description = "Notification channel for AWS Lambda scope definition" + + scope_specification_id = module.scope_definition.service_specification_id + scope_specification_slug = module.scope_definition.service_slug + + service_path = var.service_path + + repository_notification_channel = var.github_raw_url + repository_notification_channel_branch = var.github_branch + + repo_path = var.repo_path + + tags_selectors = var.tags_selectors + + enabled_override = var.overrides_enabled + override_repo_path = var.overrides_repo_path + overrides_service_path = var.overrides_service_path +} diff --git a/lambda/specs/install/provider.tf b/lambda/specs/install/provider.tf new file mode 100644 index 0000000..ef613db --- /dev/null +++ b/lambda/specs/install/provider.tf @@ -0,0 +1,24 @@ +terraform { + required_providers { + nullplatform = { + source = "nullplatform/nullplatform" + version = "0.0.87, < 0.1.0" + } + http = { + source = "hashicorp/http" + version = "~> 3.0" + } + external = { + source = "hashicorp/external" + version = "~> 2.3" + } + null = { + source = "hashicorp/null" + version = "~> 3.2" + } + } +} + +provider "nullplatform" { + api_key = var.np_api_key +} diff --git a/lambda/specs/install/terraform.tfvars.example b/lambda/specs/install/terraform.tfvars.example new file mode 100644 index 0000000..b5951da --- /dev/null +++ b/lambda/specs/install/terraform.tfvars.example @@ -0,0 +1,42 @@ +# Copy this file to terraform.tfvars and fill in the values. +# terraform.tfvars is gitignored — never commit secrets. + +################################################################################ +# Required +################################################################################ + +nrn = "organization:account" +np_api_key = "your-nullplatform-api-key" + +tags_selectors = { + environment = "production" +} + +################################################################################ +# Repository (override if using a fork or private mirror) +################################################################################ + +# github_raw_url = "https://raw.githubusercontent.com/nullplatform/scopes-lambda/refs/heads" +# github_branch = "main" + +################################################################################ +# Agent +################################################################################ + +# repo_path = "/root/.np/nullplatform/scopes-lambda" + +################################################################################ +# Scope Definition (override to customize the display name) +################################################################################ + +# service_spec_name = "AWS Lambda" +# service_spec_description = "AWS Lambda functions managed by nullplatform" +# service_path = "lambda" + +################################################################################ +# Overrides (optional — appends --overrides-path to the agent cmdline) +################################################################################ + +# overrides_enabled = true +# overrides_repo_path = "/root/.np/nullplatform/scopes-networking" +# overrides_service_path = "/lambda" diff --git a/lambda/specs/install/variables.tf b/lambda/specs/install/variables.tf new file mode 100644 index 0000000..0a1c9ba --- /dev/null +++ b/lambda/specs/install/variables.tf @@ -0,0 +1,97 @@ +################################################################################ +# Required +################################################################################ + +variable "nrn" { + description = "Nullplatform Resource Name (organization:account format)" + type = string +} + +variable "np_api_key" { + description = "Nullplatform API key for authentication" + type = string + sensitive = true +} + +variable "tags_selectors" { + description = "Map of tags used to select the agent that will handle this scope's notification channel" + type = map(string) +} + +################################################################################ +# Repository +################################################################################ + +variable "github_raw_url" { + description = "Base URL for fetching raw files from GitHub (without trailing slash)" + type = string + default = "https://raw.githubusercontent.com/nullplatform/scopes-lambda/refs/heads" +} + +variable "github_branch" { + description = "Git branch to use when fetching spec templates" + type = string + default = "main" +} + +variable "repo_path" { + description = "Local path where the scopes-lambda repository is cloned on the agent" + type = string + default = "/root/.np/nullplatform/scopes-lambda" +} + +################################################################################ +# Scope Definition +################################################################################ + +variable "service_spec_name" { + description = "Display name for the scope type in nullplatform" + type = string + default = "AWS Lambda" +} + +variable "service_spec_description" { + description = "Description of the scope type" + type = string + default = "AWS Lambda functions managed by nullplatform" +} + +variable "external_metrics_provider" { + description = "Name of the external metrics provider" + type = string + default = "externalmetrics" +} + +variable "external_logging_provider" { + description = "Name of the external logging provider" + type = string + default = "external" +} + +variable "service_path" { + description = "Path to the spec definition" + type = string + default = "lambda" +} + +################################################################################ +# Overrides +################################################################################ + +variable "overrides_enabled" { + description = "Append --overrides-path to the agent cmdline for local config overrides" + type = bool + default = false +} + +variable "overrides_repo_path" { + description = "Base path of the overrides repository on the agent (e.g. /root/.np/nullplatform/scopes-networking)" + type = string + default = null +} + +variable "overrides_service_path" { + description = "Service subfolder within the overrides repository (e.g. /lambda)" + type = string + default = null +} From 784f1bf4edab655fee031145507d97e4a1f47b31 Mon Sep 17 00:00:00 2001 From: Federico Maleh Date: Fri, 21 Aug 2026 16:13:29 -0300 Subject: [PATCH 2/6] Update to latest scope definition module --- lambda/specs/install/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambda/specs/install/main.tf b/lambda/specs/install/main.tf index 341fcdf..fa37e92 100644 --- a/lambda/specs/install/main.tf +++ b/lambda/specs/install/main.tf @@ -4,7 +4,7 @@ ################################################################################ module "scope_definition" { - source = "git::https://github.com/nullplatform/tofu-modules.git//nullplatform/scope_definition?ref=main" + source = "git::https://github.com/nullplatform/tofu-modules.git//nullplatform/scope_definition?ref=v6.19.1" nrn = var.nrn np_api_key = var.np_api_key @@ -52,7 +52,7 @@ module "scope_definition" { ################################################################################ module "scope_definition_agent_association" { - source = "git::https://github.com/nullplatform/tofu-modules.git//nullplatform/scope_definition_agent_association?ref=main" + source = "git::https://github.com/nullplatform/tofu-modules.git//nullplatform/scope_definition_agent_association?ref=v6.19.1" nrn = var.nrn api_key = var.np_api_key From 70e71d1e72f2c9ad9ca9c5d27fa2bcb3bfb230e2 Mon Sep 17 00:00:00 2001 From: Federico Maleh Date: Fri, 21 Aug 2026 16:14:40 -0300 Subject: [PATCH 3/6] Remove conventional commit and branch name checks --- .github/workflows/branch-validation.yml | 10 ---------- .github/workflows/conventional-commit.yml | 10 ---------- 2 files changed, 20 deletions(-) delete mode 100644 .github/workflows/branch-validation.yml delete mode 100644 .github/workflows/conventional-commit.yml diff --git a/.github/workflows/branch-validation.yml b/.github/workflows/branch-validation.yml deleted file mode 100644 index 6d75b77..0000000 --- a/.github/workflows/branch-validation.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: branch-validation - -on: - pull_request: - branches: - - main - -jobs: - branch-validation: - uses: nullplatform/actions-nullplatform/.github/workflows/branch-validation.yml@main diff --git a/.github/workflows/conventional-commit.yml b/.github/workflows/conventional-commit.yml deleted file mode 100644 index 92952e1..0000000 --- a/.github/workflows/conventional-commit.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: conventional-commit - -on: - pull_request: - branches: - - main - -jobs: - conventional-commit: - uses: nullplatform/actions-nullplatform/.github/workflows/conventional-commit.yml@main From 6a86d01bfafc0f936bcf2e9f9f44bd6db8e9235d Mon Sep 17 00:00:00 2001 From: Federico Maleh Date: Fri, 21 Aug 2026 16:28:34 -0300 Subject: [PATCH 4/6] Remove release please workflow --- .github/workflows/release.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 8a65e73..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: release - -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -jobs: - release: - uses: nullplatform/actions-nullplatform/.github/workflows/release.yml@main - secrets: inherit From d305a5a4122c6c554a8712846cd2e54614db0098 Mon Sep 17 00:00:00 2001 From: Sebastian Nallar <95891104+sebasnallar@users.noreply.github.com> Date: Wed, 26 Aug 2026 11:24:21 -0300 Subject: [PATCH 5/6] fix(docker): bump tofu to 1.10.10 and retry its download (#42) Picks up the 1.10.x bugfix releases past the pinned 1.10.6, and adds curl retries so a transient network failure no longer breaks the image build. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58a2470..4fcb853 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,9 @@ RUN apk add --no-cache aws-cli gomplate # OpenTofu >= 1.10 — the scope inits its S3 backend with use_lockfile=true # (lambda/scope/tofu/provider/aws/setup), which needs tofu 1.10+. alpine 3.20 # only packages 1.7.2, so pull the official static binary for the build arch. -ARG TOFU_VERSION=1.10.6 +ARG TOFU_VERSION=1.10.10 ARG TARGETARCH -RUN curl -fsSL "https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_linux_${TARGETARCH}.tar.gz" \ +RUN curl -fsSL --retry 3 --retry-delay 2 "https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_linux_${TARGETARCH}.tar.gz" \ | tar -xz -C /usr/local/bin tofu \ && tofu version From 30f5409819d627d91042676c7a92094aa1252cb1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 11:25:08 -0300 Subject: [PATCH 6/6] chore(main): release 0.3.2 (#43) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ac4087..8ab56ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.3.2](https://github.com/nullplatform/scopes-lambda/compare/v0.3.1...v0.3.2) (2026-08-26) + + +### Bug Fixes + +* **docker:** bump tofu to 1.10.10 and retry its download ([#42](https://github.com/nullplatform/scopes-lambda/issues/42)) ([fda68df](https://github.com/nullplatform/scopes-lambda/commit/fda68df107a9f3aa655b5f56f1fcdca0c6684cb2)) + ## [0.3.1](https://github.com/nullplatform/scopes-lambda/compare/v0.3.0...v0.3.1) (2026-08-10)