Skip to content

Commit 036190d

Browse files
author
vijay-stephen
committed
Merge pull request #1 from sourcefuse/feature/autoscaling
Initial EC2 Auto Scaling Group Terraform module
1 parent 5fd8a62 commit 036190d

File tree

1 file changed

+138
-0
lines changed
  • docs/arc-iac-docs/modules/terraform-aws-arc-ec2-autoscale-group/docs/module-usage-guide

1 file changed

+138
-0
lines changed
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Terraform AWS ARC EC2 Autoscale Group Module Usage Guide
2+
3+
## Introduction
4+
5+
### Purpose of the Document
6+
7+
This document provides guidelines and instructions for users looking to implement the Terraform AWS ARC EC2 Autoscale Group module for setting up and running a production ready EC2 Autoscale group.
8+
9+
### Module Overview
10+
11+
The Terraform AWS ARC EC2 Autoscale Group module provides a secure and modular foundation for deploying EC2 Autoscale Group on AWS.
12+
13+
### Prerequisites
14+
15+
Before using this module, ensure you have the following:
16+
17+
- AWS credentials configured.
18+
- Terraform installed.
19+
- A working knowledge of AWS VPC,EC2,Autoscale Group, and Terraform concepts.
20+
21+
## Getting Started
22+
23+
### Module Source
24+
25+
To use the module in your Terraform configuration, include the following source block:
26+
27+
```hcl
28+
module "asg" {
29+
source = "sourcefuse/arc-ec2-autoscale-group/aws"
30+
version = "0.0.1"
31+
launch_template = local.launch_template
32+
asg = local.asg_config
33+
security_group_data = local.security_group_data
34+
security_group_name = local.security_group_name
35+
vpc_id = data.aws_vpc.default.id
36+
autoscaling_notification_enabled = local.autoscaling_notification_enabled
37+
autoscaling_notification_types = local.autoscaling_notification_types
38+
autoscaling_sns_topic_arn = local.autoscaling_sns_topic_arn
39+
schedules = local.schedules
40+
autoscaling_policy = local.autoscaling_policy
41+
predictive_scaling_configuration = local.predictive_scaling_configuration
42+
create_autoscaling_attachment = local.create_autoscaling_attachment
43+
autoscaling_attachments = local.autoscaling_attachments
44+
instance_profile_name = local.instance_profile_name
45+
tags = module.tags.tags
46+
}
47+
```
48+
49+
Refer to the [Terraform Registry](https://registry.terraform.io/modules/sourcefuse/arc-ec2-autoscale-group/aws/latest) for the latest version.
50+
51+
### Integration with Existing Terraform Configurations
52+
53+
Refer to the Terraform Registry for the latest version.
54+
55+
## Integration with Existing Terraform Configurations
56+
Integrate the module with your existing Terraform mono repo configuration, follow the steps below:
57+
58+
- Create a new folder in terraform/ named asg.
59+
- Create the required files, see the examples to base off of.
60+
- Configure with your backend:
61+
- Create the environment backend configuration file: config.<environment>.hcl
62+
- region: Where the backend resides
63+
- key: <working_directory>/terraform.tfstate
64+
- bucket: Bucket name where the terraform state will reside
65+
- dynamodb_table: Lock table so there are not duplicate tfplans in the mix
66+
- encrypt: Encrypt all traffic to and from the backend
67+
68+
### Required AWS Permissions
69+
70+
Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create, list and modify:
71+
72+
- EC2
73+
- Autoscale Group
74+
- Application load balancer
75+
- Cloudwatch Log groups
76+
- IAM roles and policies
77+
78+
## Module Configuration
79+
80+
### Input Variables
81+
82+
For a list of input variables, see the README [Inputs]() section.
83+
84+
### Output Values
85+
86+
For a list of outputs, see the README [Outputs]() section.
87+
88+
## Module Usage
89+
90+
### Basic Usage
91+
92+
For basic usage, see the [example]() folder.
93+
94+
This example will create:
95+
96+
- launch template
97+
- EC2 Auto Scaling Group
98+
99+
### Tips and Recommendations
100+
101+
- This module provisions EC2 Auto Scaling Groups with robust support for custom launch templates, instance profiles, scaling policies, and health checks. Built using a convention-based approach, it integrates seamlessly with other ARC infrastructure components such as ALBs, VPCs, and security groups. The module also offers optional configurations for CloudWatch metrics, enabling visibility into instance health and scaling activity. Users can fine-tune instance types, desired capacity, and scaling strategies to match workload requirements and cost considerations. Additionally, it supports tagging and lifecycle hooks to facilitate autoscaling-aware applications and ensure smooth instance termination during scale-in events.
102+
103+
## Troubleshooting
104+
105+
### Reporting Issues
106+
107+
If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-ec2-autoscale-group/issues).
108+
109+
## Security Considerations
110+
111+
### AWS VPC
112+
113+
Understand the security considerations related to EC2 Autoscale Group on AWS when using this module.
114+
115+
### Best Practices for AWS EC2 Autoscale Group
116+
Follow best practices to ensure secure EC2 Autoscale Group configurations:
117+
118+
- [AWS EC2 Auto Scaling Security Best Practices](https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html)
119+
120+
## Contributing and Community Support
121+
122+
### Contributing Guidelines
123+
124+
Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-ec2-autoscale-group/blob/main/CONTRIBUTING.md) file.
125+
126+
### Reporting Bugs and Issues
127+
128+
If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-ec2-autoscale-group/issues).
129+
130+
## License
131+
132+
### License Information
133+
134+
This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-ec2-autoscale-group/blob/main/LICENSE) file for more details.
135+
136+
### Open Source Contribution
137+
138+
Contribute to open source by using and enhancing this module. Your contributions are welcome!

0 commit comments

Comments
 (0)