Skip to content

Commit

Permalink
Updates to the index; adding some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danmanners committed Nov 27, 2023
1 parent 249d0e1 commit 6559bcd
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions iac/cloud/pulumi/index.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6559bcd

Please sign in to comment.