Skip to content

refactor(cloudformation): group template Mappings by concern to match funfair-treasury-reporting #435

Open

Description

@credfeto

Request

The repository owner, in live chat while working on funfair-tech/funfair-treasury-reporting#3900:

q21 yes

actually Q21 is the other way round!

BuildBot's CloudFormation template should adopt the grouped Mappings.Deployment.* layout that funfair-tech/funfair-treasury-reporting uses (#3930 / PR #3955), not the other way round.

Problem

BuildBot's cloudformation.json (#427, #433) keeps every setting in one flat Mappings.Settings.Values block, with keys named after the old parameters (TaskDefinitionCPU, TaskDefinitionMemory, ECSClusterName, TaskExecutionRoleArn, SecretsManagerArn, LogRetentionInDays and so on). The treasury templates group them by concern under Mappings.Deployment:

Group Keys
Network ClusterName, SecurityGroupIds (string list), SubnetIds (string list), VpcId
Task Cpu, Memory, ExecutionRole, ContainerOwner, SecretsManagerArn, ContainerPort
Service DesiredCount, MinimumHealthPercent, MaximumHealthPercent
Settings Debug, LogRetentionInDays (and other app settings)
LoadBalancer ListenerArn

Every value is read with Fn::FindInMap: ["Deployment", <Group>, <Key>]. See memory/code-organisation.instructions.md ("Template Settings") in funfair-treasury-reporting.

Proposed change

  • Restructure Mappings.Settings.Values in cloudformation.json into Mappings.Deployment.<Group>.<Key> following the treasury layout. Put the BuildBot-only settings (API Gateway, Route 53, VPC Link, throttling) in suitably named groups.
  • Update every Fn::FindInMap to match. Resolved values must be unchanged.
  • Update the README and AI memory to match, and add a changelog entry.

Activity

  1. self-assigned this
    on Oct 31, 2026
  2. dnyw4l3n13 commented on Oct 31, 2026

    @dnyw4l3n13
    Collaborator

    Implementation Plan

    Files to change

    • cloudformation.json - replace Mappings.Settings.Values with Mappings.Deployment.<Group>.<Key> and update all 33 Fn::FindInMap lookups
    • README.md - document the grouped Deployment mapping in the Deployment section
    • CHANGELOG.md - add an entry via the changelog tool

    Approach

    Split the flat block into groups, matching funfair-treasury-reporting where a key exists there:

    • Network: ClusterName (was ECSClusterName), SecurityGroupIds (string list), SubnetIds (string list), VpcId, plus VpcLinkEgressCidr.
    • Task: Cpu, Memory, ExecutionRole, ContainerOwner, SecretsManagerArn, ContainerPort.
    • Service: DesiredCount, MinimumHealthPercent, MaximumHealthPercent.
    • Settings: LogRetentionInDays.
    • LoadBalancer: ListenerArn, InternalAlbServerName.
    • BuildBot-only groups: ApiGateway (CertificateArn, ThrottlingBurstLimit, ThrottlingRateLimit) and Dns (HostedZoneName).
      The security group and subnet values become real string lists, so the Fn::Split wrappers around those lookups are removed (as the treasury template does). Every other lookup changes only its map name, group and key. Resolved values stay identical.

    Test strategy

    • Confirm the JSON parses and that every Fn::FindInMap resolves to an existing group and key.
    • Compare old and new resolved values (the comma-split lists must equal the new lists).
    • Run cfn-lint if available, and the existing dotnet build and tests to confirm nothing else reads the template.

    Assumptions

    a. The AI memory file named in the issue (memory/code-organisation.instructions.md) lives in funfair-treasury-reporting. BuildBot has no equivalent file, so only the README is updated.
    b. List-valued mapping entries work with Fn::FindInMap (the treasury template already relies on this).
    c. Group and key names for BuildBot-only settings (ApiGateway, Dns, and where VpcLinkEgressCidr and InternalAlbServerName sit) are my choice.

    Open questions

    Q1. BuildBot has no AI memory file to update. Should one be created (for example a "Template Settings" section)? I will proceed without creating one unless told otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AI-WorkWork for an AI AgentBlockedBlocked by a dependency or external factor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions