This Terraform main module orchestrates the deployment of various AWS resources by leveraging the capabilities of submodules. The main module is designed to create and manage a wide range of AWS resources, including a VPC, EC2 instances, RDS databases, Amazon S3 buckets, security groups, and more. Additionally, it uses submodules for specific resource types such as CloudWatch alarms and DynamoDB tables.
Before you begin, ensure that you have the following prerequisites set up:
- AWS account with appropriate permissions.
- Terraform installed on your local machine.
- AWS CLI configured with valid credentials.
module "resourse_master" {
source = "Pradipbabar/resource-master/aws/"
enable_rds = true
enable_vpc = true
enable_s3 = true
enable_ec2 = true
}
Create a Terraform configuration file (e.g., main.tf
) to define your infrastructure configuration. In this file, you can specify the resources you want to create and configure.
module "my_vpc" {
source = "Pradipbabar/resource-master/aws//modules/vpc"
# VPC configuration here...
}
module "my_ec2_instances" {
source = "Pradipbabar/resource-master/aws//modules/ec2"
# EC2 instances configuration here...
}
module "my_rds_instance" {
source = "Pradipbabar/resource-master/aws//modules/rds"
# RDS instance configuration here...
}
module "my_s3_bucket" {
source = "Pradipbabar/resource-master/aws//modules/s3"
# S3 bucket configuration here...
}
# Additional modules for CloudWatch, DynamoDB, etc.
Run the following command to initialize Terraform and download the required providers and modules:
terraform init
Deploy your AWS infrastructure by running:
terraform apply
Terraform will show you the plan and ask for confirmation before applying the changes.
If you need to tear down the resources, you can use the following command:
terraform destroy
The aws-vpc
submodule creates a Virtual Private Cloud in AWS, including public and private subnets, route tables, and necessary associations.
The aws-ec2
submodule deploys Amazon EC2 instances in the VPC with configurable attributes such as instance types, AMIs, security groups, and more.
The aws-rds
submodule provisions Amazon RDS database instances with customizable settings, including engine, storage, instance class, and more.
The aws-s3
submodule manages Amazon S3 buckets, allowing you to create primary and log buckets with various configurations.
Extend the main module by adding additional submodules to create and manage resources like CloudWatch alarms, DynamoDB tables, Lambda functions, etc., according to your specific requirements.
Each submodule may have its own set of outputs that you can use in your main configuration or other submodules. Refer to the specific submodule's documentation for details on available outputs.
Feel free to contribute to this Terraform infrastructure module by creating pull requests, reporting issues, or suggesting improvements. Your contributions are highly appreciated!
This Terraform module is open-source and available under the MIT License.