Skip to content

Commit

Permalink
Merge pull request #1 from sourcefuse/feature/sg-module
Browse files Browse the repository at this point in the history
Security Group Module
  • Loading branch information
vijay-stephen committed Dec 10, 2024
1 parent 18d2486 commit 1979918
Showing 1 changed file with 38 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Terraform AWS ARC DB Module Usage Guide
# Terraform AWS ARC Security Group Module Usage Guide

## Introduction

### Purpose of the Document

This document provides guidelines and instructions for users looking to implement Terraform module for managing Aurora cluster and SQL Server RDS instance.
This document provides guidelines and instructions for users looking to create and manage Security Groups

### Module Overview

The [terraform-aws-arc-db](https://github.com/sourcefuse/terraform-aws-arc-db) module provides a secure and modular foundation for managing Aurora cluster and SQL Server RDS instances.
The Terraform AWS ARC Security Group module create and manage AWS security groups with customizable ingress and egress rules for secure network traffic control.

### Prerequisites

Before using this module, ensure you have the following:

- AWS credentials configured.
- Terraform installed.
- A working knowledge of AWS Aurora cluster and SQL Server RDS instance.
- A working knowledge of AWS VPC, security grouo, and Terraform concepts.

## Getting Started

Expand All @@ -25,110 +25,97 @@ Before using this module, ensure you have the following:
To use the module in your Terraform configuration, include the following source block:

```hcl
module "aurora" {
source = "sourcefuse/arc-db/aws"
version = "4.0.0"
module "arc-sg" {
source = "sourcefuse/arc-security-group/aws"
version = "0.0.1"
# insert the required variables here
}
```

Refer to the [Terraform Registry](https://registry.terraform.io/modules/sourcefuse/arc-security-group/aws/latest) for the latest version.

### Integration with Existing Terraform Configurations

Refer to the Terraform Registry for the latest version.

## Integration with Existing Terraform Configurations
Integrate the module with your existing Terraform mono repo configuration, follow the steps below:

1. Create a new folder in `terraform/` named `db`.
2. Create the required files, see the [examples](https://github.com/sourcefuse/terraform-aws-arc-db/tree/main/examples/rds) to base off of.
3. Configure with your backend
- Create the environment backend configuration file: `config.<environment>.hcl`
- **region**: Where the backend resides
- **key**: `<working_directory>/terraform.tfstate`
- **bucket**: Bucket name where the terraform state will reside
- **dynamodb_table**: Lock table so there are not duplicate tfplans in the mix
- **encrypt**: Encrypt all traffic to and from the backend
- Create a new folder in terraform/ named security-group.
- Create the required files, see the examples to base off of.
- Configure with your backend:
- Create the environment backend configuration file: config.<environment>.hcl
- region: Where the backend resides
- key: <working_directory>/terraform.tfstate
- bucket: Bucket name where the terraform state will reside
- dynamodb_table: Lock table so there are not duplicate tfplans in the mix
- encrypt: Encrypt all traffic to and from the backend

### Required AWS Permissions

Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create Aurora cluster and SQL Server RDS instance.
Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create, list and modify:

## Module Configuration

### Input Variables

For a list of input variables, see the README [Inputs](https://github.com/sourcefuse/terraform-aws-arc-db?tab=readme-ov-file#inputs) section.
For a list of input variables, see the README [Inputs](https://github.com/sourcefuse/terraform-aws-arc-security-group?tab=readme-ov-file#inputs) section.

### Output Values

For a list of outputs, see the README [Outputs](https://github.com/sourcefuse/terraform-aws-arc-db?tab=readme-ov-file#outputs) section.
For a list of outputs, see the README [Outputs](https://github.com/sourcefuse/terraform-aws-arc-security-group?tab=readme-ov-file#outputs) section.

## Module Usage

### Basic Usage

For basic usage, see the [example](https://github.com/sourcefuse/terraform-aws-arc-db/tree/main/examples/rds) folder.
For basic usage, see the [example](https://github.com/sourcefuse/terraform-aws-arc-security-group/tree/main/example) folder.

This example will create:

- RDS Instance Example
This example demonstrates deploying a single RDS instance using the module, configuring an Amazon RDS database with basic settings like instance class, storage, and connectivity. It showcases options for database engine, encryption, and CloudWatch monitoring for a standalone RDS database. Ideal for simple, production-ready RDS setups.

### RDS Proxy

For RDS Proxy, see the [example](https://github.com/sourcefuse/terraform-aws-arc-db/tree/main/examples/rds-proxy) folder.

- RDS Proxy Example
This example configures an RDS Proxy for an RDS database, helping manage connection pooling for improved database performance and security. By integrating with RDS Proxy, it reduces connection management overhead and scales automatically with demand, useful for applications with variable database traffic and sensitive to scaling requirements.
This Terraform module creates a security group with the following configurations:

### Aurora Cluster
Ingress Rules:

For Aurora Cluster, see the [example](https://github.com/sourcefuse/terraform-aws-arc-db/tree/main/examples/aurora) folder.
- VPC Traffic: Allows all TCP traffic within the VPC (0-65535) based on the VPC CIDR block.
- Self-Traffic: Allows all TCP traffic (0-65535) within the same security group for self-referencing communication.
- Source Security Group: Permits TCP traffic (0-65535) from a specific source security group.

- Aurora Cluster Example
This example provisions an Amazon Aurora cluster, utilizing the module to set up a high-availability, high-performance database solution. The configuration includes multiple instances within a cluster, providing a resilient and cost-effective solution suitable for demanding applications.
Egress Rules:

### Aurora Cluster Serverless

For Aurora Cluster Serverless, see the [example](https://github.com/sourcefuse/terraform-aws-arc-db/tree/main/examples/aurora-serverless) folder.

- Aurora Serverless Cluster Example
This example deploys an Aurora Serverless cluster autoscaling, making it ideal for applications with unpredictable or intermittent database usage. The module configures serverless capacity, connectivity, and database settings, automatically adjusting to workload needs without manual intervention.
- Outbound Traffic: Allows unrestricted outbound traffic (0.0.0.0/0) for all protocols and ports.

### Tips and Recommendations

The module focuses on provisioning Aurora database cluster and Amazon RDS instance for SQL Server. Adjust the configuration parameters as needed for your specific use case.
The module can manage egress rules to security groups, S3 endpoints, and more.

## Troubleshooting

### Reporting Issues

If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-db/issues).
If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-security-group/issues).

## Security Considerations

### AWS VPC

Understand the security considerations related to Aurora database cluster and Amazon RDS instance for SQL Server on AWS when using this module.

### Best Practices for Aurora database cluster

Follow best practices to ensure secure DB configurations:

[Aurora security on AWS](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_BestPractices.Security.html)
Understand the security considerations related to Security Group

## Contributing and Community Support

### Contributing Guidelines

Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-db/blob/main/CONTRIBUTING.md) file.
Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-security-group/blob/main/CONTRIBUTING.md) file.

### Reporting Bugs and Issues

If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-db/issues).
If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-security-group/issues).

## License

### License Information

This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-db/blob/main/LICENSE) file for more details.
This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-security-group/blob/main/LICENSE) file for more details.

### Open Source Contribution

Expand Down

0 comments on commit 1979918

Please sign in to comment.