43 lines
2.4 KiB
Markdown
43 lines
2.4 KiB
Markdown
# Terraform Base Infra Modules
|
|
|
|
By using this module you can quickly configure a new account and deploy the basic infrastructure into it making adding accounts and configuring them a relative breeze
|
|
|
|
* This module consists only of other modules, no actual end resources like EC2 hosts or security groups are defined here, only references to these resources are defined here. All modules that make up this base_infra module are all individualy versioned to make sure that environments are all configured alike without losing the ability to make changes to the individual accounts.
|
|
|
|
Currently this modules is consuming several other modules, below a list of all these modules;
|
|
- label module (simplifies the labeling and naming of resources)
|
|
- vpc module (Creates the VPC's and related resources like internet gateways, nat gateways, route tables, routes, peerings etc)
|
|
- bastion module (Creates a bastion host and the required security groups)
|
|
- subnets module (Creates the public and private subnets in the availability zones you specified)
|
|
- eks_cluster module (Creates all resources to get an EKS cluster backend up and running)
|
|
- eks_node_group module (Creates and configures the eks workernodes that will run the workloads )
|
|
- flow_logs module (Enables all the network resources in the account to enable flowlogs)
|
|
-
|
|
Using this module is actualy very simple and consists only of adding the following piece of code to a file with the .tf extension and define the variables in one of the following files; terraform.tfvars or variables.tf
|
|
|
|
```
|
|
module "base_infra" {
|
|
source = "../../platform"
|
|
# Variables go beneath this line
|
|
name = var.name
|
|
vpc_cidr_block = var.vpc_cidr_block
|
|
stage = var.stage
|
|
prefix = var.prefix
|
|
availability_zones = var.availability_zones
|
|
keyname = var.keyname
|
|
public_keyname = var.public_keyname
|
|
region = var.region
|
|
instance_types = var.instance_types
|
|
bastion_instance_type = var.bastion_instance_type
|
|
bastion_ami = var.bastion_ami
|
|
disk_size = var.disk_size
|
|
max_size = var.max_size
|
|
min_size = var.min_size
|
|
kubernetes_labels = var.kubernetes_labels
|
|
kubeconfig_path = var.kubeconfig_path
|
|
desired_size = var.desired_size
|
|
aws_eks_update_kubeconfig_additional_arguments = var.aws_eks_update_kubeconfig_additional_arguments
|
|
}
|
|
```
|
|
|