Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repos:
- id: terraform_docs
args:
- --args=--config=.terraform-docs.yml
files: ^modules/[^/]+/[^/]+/.+\.tf$ # Only run on .tf files in modules/*/*/ directories
- id: terraform_fmt
- id: terragrunt_fmt
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
1 change: 0 additions & 1 deletion .terraform-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version: ""

recursive:
enabled: false
path: kit

content: ""

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ AWS S3 Module – Provision S3 buckets with encryption and logging.
All Terraform modules are listed in the `modules/` directory.
This directory is split into subdirectories for each platform.
In a platform's directory, you will find all modules that are available for that platform.
Additionally, you might also find a `meshstack_integration.tf` and `README.md` file in a platform
directory. These allow you to integrate a given platform directly with meshStack.

```

A single module is structured as follows:

Expand Down
118 changes: 80 additions & 38 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const path = require("path");
const matter = require("gray-matter");
const { execSync } = require("child_process");

const repoRoot = path.resolve(__dirname, "modules");
const assetsDir = path.resolve(__dirname, "website/public/assets/logos");

function getGitHubRemoteUrl() {
try {
const remoteUrl = execSync("git config --get remote.origin.url")
Expand Down Expand Up @@ -38,44 +41,76 @@ function findReadmes(dir){
});
}

function copyFilesToAssets(
sourceDir,
destinationDir,
fileFilter
){
const copiedFiles = {};
function findPlatforms(): Platform[] {
fs.mkdirSync(assetsDir, { recursive: true });

fs.readdirSync(sourceDir, { withFileTypes: true })
return fs.readdirSync(repoRoot, { withFileTypes: true })
.filter((dirent) => dirent.isDirectory() && dirent.name !== ".github")
.forEach((dir) => {
const platformDir = path.join(sourceDir, dir.name);
fs.readdirSync(platformDir)
.filter(fileFilter)
.forEach((file) => {
const sourcePath = path.join(platformDir, file);
const destinationPath = path.join(
destinationDir,
`${dir.name}${path.extname(file)}`
);

fs.mkdirSync(destinationDir, { recursive: true });
fs.copyFileSync(sourcePath, destinationPath);

copiedFiles[dir.name] = destinationPath
.replace(path.resolve(__dirname, "website/public"), "")
.replace(/^\/+/g, "");
});
.map((dir) => {
const platformDir: string = path.join(repoRoot, dir.name);
const platformLogo = getPlatformLogoOrThrow(platformDir, dir.name);
const platformReadme = getPlatformReadmeOrThrow(platformDir);
const { name, description, content } = extractReadmeFrontMatter(platformReadme);
const terraformSnippet = getTerraformSnippet(platformDir);

return {
platformType: dir.name,
name,
description,
logo: platformLogo,
readme: content,
terraformSnippet
};
});
}

return copiedFiles;
// Finds the logo, copies it to website assets and returns the path.
function getPlatformLogoOrThrow(platformDir: string, platformType: string): string {
const logoFile = fs.readdirSync(platformDir).find(f => f.endsWith('.png') || f.endsWith('.svg'));
if (logoFile) {
const sourcePath = path.join(platformDir, logoFile);
const destPath = path.join(assetsDir, `${platformType}${path.extname(logoFile)}`);
fs.copyFileSync(sourcePath, destPath);
return destPath.replace(path.resolve(__dirname, "website/public"), "").replace(/^\/+/g, "");
}

throw new Error(`Logo file not found for platform: ${platformType} in directory: ${platformDir}. Each platform should have a logo.`);
}

function copyPlatformLogosToAssets() {
const modulesDir = path.resolve(__dirname, "modules");
const assetsDir = path.resolve(__dirname, "website/public/assets/logos");
return copyFilesToAssets(modulesDir, assetsDir, (file) =>
file.endsWith(".png") || file.endsWith(".svg")
);
function getPlatformReadmeOrThrow(platformDir: string) {
try {
return fs.readFileSync(path.join(platformDir, "README.md"), "utf-8");
} catch {
throw new Error('Platform README.md not found. Each platform should have a README.md file.');
}
}

function extractReadmeFrontMatter(platformReadme: string): { name: string; description: string; content: string } {
const { data, content } = matter(platformReadme);

const name = data.name;
if (!name) {
throw new Error('Property "name" is missing in the front matter of the platform README.md. Each platform README.md should have a name defined in the front matter.');
}

const description = data.description;
if (!description) {
throw new Error('Property "description" is missing in the front matter of the platform README.md. Each platform README.md should have a description defined in the front matter.');
}

return {
name,
description,
content
}
}

function getTerraformSnippet(platformDir: string): string | null {
try {
return fs.readFileSync(path.join(platformDir, "meshstack_integration.tf"), "utf-8")
} catch {
return null;
}
}

function copyBuildingBlockLogoToAssets(buildingBlockDir) {
Expand Down Expand Up @@ -161,15 +196,13 @@ function getIdAndPlatform(filePath) {

// Main execution
function main() {
const repoRoot = path.resolve(__dirname, "modules");

const platformLogos = copyPlatformLogosToAssets();
const platforms = findPlatforms();
fs.writeFileSync(
"website/public/assets/platform-logos.json",
JSON.stringify(platformLogos, null, 2)
"website/public/assets/platform.json",
JSON.stringify(platforms, null, 2)
);
console.log(
`✅ Successfully processed ${Object.entries(platformLogos).length} platform logos. Output saved to platform-logos.json`
`✅ Successfully processed ${platforms.length} platforms. Output saved to platform.json`
);

const readmeFiles = findReadmes(repoRoot);
Expand All @@ -184,3 +217,12 @@ function main() {
}

main();

export interface Platform {
platformType: string;
name: string;
description: string;
logo: string;
readme: string;
terraformSnippet?: string;
}
7 changes: 7 additions & 0 deletions modules/aks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Azure Kubernetes Service
description: Managed Kubernetes service on Azure
category: hyperscaler
---

A meshStack integration of AKS allows you to automatically provision and manage Kubernetes namespaces for meshStack projects, enforce policies and enable secure authentication for your AKS workloads, and track usage to enable billing across namespaces.
7 changes: 7 additions & 0 deletions modules/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Amazon Web Services
description: Scalable cloud computing platform by Amazon
category: hyperscaler
---

meshStack integration with AWS enables automated account provisioning, policy enforcement, and unified billing for AWS resources across your organization.
7 changes: 7 additions & 0 deletions modules/azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Microsoft Azure
description: Cloud computing platform and services by Microsoft
category: hyperscaler
---

meshStack integration with Azure streamlines subscription management, enforces governance, and enables cost tracking for Azure resources in your organization.
7 changes: 7 additions & 0 deletions modules/azuredevops/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Azure DevOps
description: Developer services for support teams to plan, build, and ship software
category: devops
---

meshStack integration with Azure DevOps automates project and repository setup, ensuring consistent governance and access management for your development workflows.
7 changes: 7 additions & 0 deletions modules/cloudfoundry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Cloud Foundry
description: Open source cloud application platform
category: private-cloud
---

meshStack integration with Cloud Foundry automates org and space provisioning, policy enforcement, and enables usage-based billing for your cloud-native applications.
7 changes: 7 additions & 0 deletions modules/datadog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Datadog
description: Monitoring and security platform for cloud applications
category: devops
---

meshStack integration with Datadog enables automated account management and unified monitoring setup for your cloud environments.
7 changes: 7 additions & 0 deletions modules/gcp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Google Cloud Platform
description: Suite of cloud computing services by Google
category: hyperscaler
---

meshStack integration with GCP automates project provisioning, policy enforcement, and cost tracking for Google Cloud resources across your organization.
7 changes: 7 additions & 0 deletions modules/github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: GitHub
description: Code hosting platform for version control and collaboration
category: devops
---

meshStack integration with GitHub automates repository creation and access management, ensuring secure and consistent collaboration for your teams.
7 changes: 7 additions & 0 deletions modules/ionos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: IONOS Cloud
description: European cloud infrastructure and hosting provider
category: european
---

meshStack integration with IONOS automates resource provisioning and governance, enabling secure and compliant cloud usage for your organization.
7 changes: 7 additions & 0 deletions modules/kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Kubernetes
description: Open-source system for automating deployment, scaling, and management of containerized applications
category: devops
---

meshStack integration with Kubernetes automates namespace management, policy enforcement, and enables secure access for your container workloads.
7 changes: 7 additions & 0 deletions modules/oci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Oracle Cloud Infrastructure
description: Cloud computing services platform by Oracle
category: hyperscaler
---

meshStack integration with Oracle Cloud Infrastructure (OCI) automates tenancy and compartment provisioning, enforces governance, and enables unified billing for your OCI resources.
7 changes: 7 additions & 0 deletions modules/openshift/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: OpenShift
description: Enterprise Kubernetes platform by Red Hat
category: private-cloud
---

meshStack integration with OpenShift automates project and namespace provisioning, enforces policies, and enables cost tracking for your containerized applications.
7 changes: 7 additions & 0 deletions modules/openstack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: OpenStack
description: Open source cloud computing platform for public and private clouds
category: private-cloud
---

meshStack integration with OpenStack automates project and resource management, enforces governance, and enables unified billing for your cloud infrastructure.
7 changes: 7 additions & 0 deletions modules/ovh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: OVHcloud
description: European cloud computing and hosting provider
category: european
---

meshStack integration with OVHcloud automates resource provisioning, governance, and cost tracking for your cloud environments.
7 changes: 7 additions & 0 deletions modules/sapbtp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: SAP Business Technology Platform
description: Integrated offering for data management, analytics, and application development
category: european
---

meshStack integration with SAP BTP automates subaccount management, policy enforcement, and enables unified billing for your SAP cloud services.
7 changes: 7 additions & 0 deletions modules/stackit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: STACKIT
description: European cloud platform by Schwarz Group
category: european
---

meshStack integration with STACKIT automates project provisioning, governance, and cost tracking for your cloud workloads.
7 changes: 7 additions & 0 deletions modules/tencentcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Tencent Cloud
description: Cloud computing services by Tencent
category: china
---

meshStack integration with Tencent Cloud automates resource provisioning, policy enforcement, and enables unified billing for your cloud resources.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"license": "MIT",
"dependencies": {
"gray-matter": "^4.0.3"
},
"devDependencies": {
"@types/node": "^25.2.0"
}
}
6 changes: 6 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ testem.log
# System files
.DS_Store
Thumbs.db

# Files generated by index.ts
/public/assets/building-block-logos
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were somehow partially tracked and I deleted all of them + added them to gitignore.

/public/assets/logos
/public/assets/platform.json
/public/assets/templates.json
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.8",
"express": "^4.18.2",
"marked": "^15.0.12",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed website/public/assets/logos/aks.png
Binary file not shown.
1 change: 0 additions & 1 deletion website/public/assets/logos/aks.svg

This file was deleted.

Binary file removed website/public/assets/logos/aws.png
Binary file not shown.
Loading
Loading