From 6559bcd46aa1e74777a8024ad011124cc47ddc99 Mon Sep 17 00:00:00 2001 From: Dan Manners Date: Mon, 27 Nov 2023 10:55:15 -0500 Subject: [PATCH] Updates to the index; adding some comments --- iac/cloud/pulumi/index.ts | 43 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/iac/cloud/pulumi/index.ts b/iac/cloud/pulumi/index.ts index 3883db31..9ac1c56a 100644 --- a/iac/cloud/pulumi/index.ts +++ b/iac/cloud/pulumi/index.ts @@ -1,50 +1,51 @@ -import * as aws from "@pulumi/aws"; - // Import the module responsible for creating the VPC import { createVpc } from "./modules/vpc"; import { iamCreation } from "./modules/iam"; import { securityGroup } from "./modules/security-groups"; import { createInstance } from "./modules/kube-nodes"; import { createBastion } from "./modules/bastion"; -// import * as iam from "./modules/iam"; // Configuration / Environment Variables import * as config from "./vars/environment"; -import { assumeRole } from "@pulumi/aws/config"; -import { output } from "@pulumi/pulumi"; +// import { assumeRole } from "@pulumi/aws/config"; +// import { output } from "@pulumi/pulumi"; // Create a VPC and associated resources -const vpc = createVpc(config); +const vpc = createVpc(config); // Create the VPC and associated resources -// Create the Security Groups +// Create the Security Groups for Talos const sg_talos_configuration = securityGroup( - config.security_groups["talos_configuration"], - vpc.id, - config.tags + config.security_groups["talos_configuration"], // Config + vpc.id, // VPC ID + config.tags // Tags ); +// Create the NLB Ingress Security Group const sg_nlb_ingress = securityGroup( - config.security_groups["nlb_ingress"], - vpc.id, - config.tags + config.security_groups["nlb_ingress"], // Config + vpc.id, // VPC ID + config.tags // Tags ); +// Create the IAM Role const iam_role = iamCreation(config); // Create the Control Planes and Worker Nodes for (let k of config.compute.control_plane_nodes) { createInstance( - k, - config.cloud_auth.aws_region, - config.amis, - vpc.privSubnets[k.subnet_name].id, - [sg_talos_configuration.id], - iam_role.iamInstanceProfile.name, - null, - config.tags + k, // Node Config + config.cloud_auth.aws_region, // Region + config.amis, // AMI + vpc.privSubnets[k.subnet_name].id, // Subnet + [sg_talos_configuration.id], // List of Security Groups + iam_role.iamInstanceProfile.name, // IAM Instance Profile + null, // User Data; `null` if we're not using it + config.tags // Tags ); } +// Create the Bastion Node +// This is ONLY for debugging purposes and will be removed in the future createBastion( config.compute.bastion[0], // Node Config config.cloud_auth.aws_region, // Region