Skip to content

feat(infrastructure): add the ecs ec2 terraform casting - #174

Open
Nageshbansal wants to merge 2 commits into
feat/infrastructure/scaffoldingfrom
feat/infrastructure/ecsec2terraform
Open

feat(infrastructure): add the ecs ec2 terraform casting#174
Nageshbansal wants to merge 2 commits into
feat/infrastructure/scaffoldingfrom
feat/infrastructure/ecsec2terraform

Conversation

@Nageshbansal

@Nageshbansal Nageshbansal commented Jul 29, 2026

Copy link
Copy Markdown
Member

Features

  • Adds the ecs/ec2/terraform infrastructure casting: a VPC with public and private subnets and their routing, an ECS cluster, node groups per storage class, and the IAM the nodes assume.
  • Runs a persistent group as individual instances, each with its own volume mounted at /var/lib/foundry. The ECS agent will not register a node whose volume is not mounted, so a task can never bind onto the root disk.
  • Runs an ephemeral group as an autoscaling group behind a launch template.
  • Registers each node with the substrate's name and its storage class as ECS instance attributes, which is what an Installation places against.
  • Pours cloud-init beside the terraform and references it with filebase64.
  • Templates interpolate the derived resources map and assemble no name or tag of their own.
  • Adds the example under docs/examples/ecs/ec2/terraform/infrastructure/.

Tests

  • Forge tests for the poured set and the cloud-init contents, enricher tests, and template render tests.

Example

apiVersion: v1alpha1
kind: Infrastructure
metadata:
  name: foundry
spec:
  deployment:
    platform: ecs
    mode: ec2
    flavor: terraform
  resource:
    spec:
      config:
        data:
          resource.yaml: |
            networking:
              networkCIDR: 10.0.0.0/16
              subnets:
                private-a:
                  type: private
                  zone: us-east-1a
                  cidr: 10.0.0.0/19
                public-a:
                  type: public
                  zone: us-east-1a
                  cidr: 10.0.96.0/22
            instanceGroups:
              persistent:
                minSize: 3
                maxSize: 3
                machineType: t3.medium
                dataVolume:
                  size: 5
              ephemeral:
                machineType: t3.small
  patches:
    - target: "infrastructure/variables.tf.json"
      type: jsonpatch
      operations:
        - op: replace
          path: /variable/aws_region/default
          value: us-east-1

Related: SigNoz/platform-pod#2743

Provisions the substrate an ECS/EC2 installation lands on: a VPC with public
and private subnets, an ECS cluster, node groups per storage class, and the
IAM the nodes need. The enricher contributes the declaration; the molding
derives every name and tag through the aws convention, so the templates
interpolate the resources map rather than assembling identifiers inline.

Registers the casting with terraform as its tooler and awsconvention.Resources
as its deriver.
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.

1 participant