Skip to content

Runtime Viewpoint Implementation

The concepts described in the Runtime Viewpoint section are implemented following an Infrastructure as Code approach using primarily the AWS CDK V2 in Typescript and Helm Charts, with some basic shell scripts to choreograph the deployment of the resources.

Tools

  • AWS CDK: The AWS Cloud Development Kit (CDK) is an open-source software development framework to define your cloud application resources using familiar programming languages.
  • Typescript: A superset of JavaScript that compiles to clean JavaScript output. It is used to write the AWS CDK code.
  • Helm: The package manager for Kubernetes. It is used to deploy Kubernetes resources.
  • nodejs and npm: The execution and project environment for JavaScript and Typescript. It is used to install the AWS CDK and other dependencies as well as to define build targets and scripts. It is possible that other build tools like Make will be incorporated if needed.
  • AWS SDK: The AWS SDK for JavaScript is a collection of tools for working with AWS services. It is used to deploy and manage AWS resources for special operations that the current version of the CDK does not support.
  • AWS CLI: The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. It is used mostly to create and manage credentials and profiles to access AWS accounts.

Code Structure

The code is in the infrastructure repository

The repository contains files needed by the tools used (e.g. package.json, tsconfig.json, cdk.json, etc.) and the code itself organized in a structure that follows the concepts of the Runtime Viewpoint.

The relevant files and directories are:

../infrastructure
├── amm.sh
├── root
├── src
└── tools
  • amm.sh is a shell script that builds environments (Infrastructure + Partition).
    • usage: ./amm.sh --infra <infrastructure> --partition <partition> --profile <aws_profile> --region <aws_region>
  • root is a collection of Cfn templates and other files to build resources in the Root element of the Runtime Platform. This is in the initial stages and will be migrated to use CDK constructs and integrated in the src directory in the future.
  • src is the main directory containing the CDK code to build Infrastructure and Partition elements of the Runtime Platform. It is structured in main and test subdirectories to separate production from testing code. Note that testing code is not yet implemented.
  • tools is a collection of utility scripts and tools to support the development and deployment of the CDK code.

src/main/cdk Structure

src/main/cdk
├── apps
├── constructs
├── instances
├── platform
├── platforms.ts
├── stacks
└── utils

constructs, stacks and apps contain the CDK code that create resources.

  • constructs defines higher level (L2, L3) reusable CDK constructs (L3 constructs) with pre-configured combinations of L1 and L2 constructs representing AWS resources that can be included in Infrastructure, Purpose and Component elements of Arda’s Runtime Platform. They are organized by the kind of resources they define (compute, networking, storage, xgress, oam)

    The constructs directory also contains an inline-lambdas directory that contains code to be used for inline lambda functions in the CDK constructs. This code is read as text by CDK constructs but it is kept separate to take advantage of the IDE environment for editing and verification (e.g. typescript compiling, linting, …) which is not possible when they are simple strings embedded in a typescript file.

  • stacks defines reusable CDK stacks that deploy complete Infrastructure, Purpose and Component elements. These are parametrized to be able to deploy them in different contexts and they are not used directly to deploy or manage specific instances of those elements.
  • apps Define CDK applications representing complete configurations of infrastructures, partitions, and other top level elements of the Arda Platform. These applications are still reusable, but most of their configuration is already built-in. This directory is organized by the configurations they implement (e.g. Al1x)

platform contains general configuration and conventions for the Arda Platform:

  • ari-configuration.ts: Arda Rersource Identifier configuration, including domain names, rest realms, etc.
  • aws-configuration.ts: Identifiers for AWS accoutns, regions, etc.
  • conventions.ts: Naming patterns, etc.. that are shared across the platform. Note that this is not complete and conventions spread across other files still need to be consolidated here.
  • user-account-configuration.ts: User attributes, scopes, etc… that define the identity of users in the platform.
  • web-configuration.ts: Configuration information for Arda’s web applications.

platforms.ts defines the data types and instances that describe Infrastructures and their partitions.

instances are Typescript programs that instantiate the specific infrastructures and partitions in the Arda Platform. This directory is organized by Infrastructure instance (e.g. Alpha001, Alpha002) and contains scripts to deploy their infrastructure (infra.ts) and partitions. Partition files are named after the partition they deploy. These files make sure of the information in platforms.ts and aws-configuration.ts to find the right AWS accounts, regions, etc. for their instances.

utils contains utility code to support more productive development of CDK code that is not tied to a specific CDK asset.

Important

The IaC assets to deploy specific components belong in the repositories of those components. Until the utils,
constructs and stacks configurable assets are published as npm packages and available in other repositories,
we’ll either have some level of duplication of the reusable code in each repository or temporarily host some
concrete component deployment assets in this repository. The decision will need to be on a case by case basis.


Copyright: © Arda Systems 2025, All rights reserved

Comments