Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/czantoine/glpi-on-rds-high-availability-for-aws-terraform
This Terraform template deploys a highly available GLPI (a web-based IT service management software) environment on Amazon RDS, with an Elastic Load Balancer for traffic distribution, KMS. The infrastructure is set up across multiple availability zones for increased redundancy.
https://github.com/czantoine/glpi-on-rds-high-availability-for-aws-terraform
aws-ec2 glpi mariadb rds terraform
Last synced: about 2 months ago
JSON representation
This Terraform template deploys a highly available GLPI (a web-based IT service management software) environment on Amazon RDS, with an Elastic Load Balancer for traffic distribution, KMS. The infrastructure is set up across multiple availability zones for increased redundancy.
- Host: GitHub
- URL: https://github.com/czantoine/glpi-on-rds-high-availability-for-aws-terraform
- Owner: czantoine
- License: other
- Created: 2023-07-13T21:52:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-17T05:53:51.000Z (4 months ago)
- Last Synced: 2024-09-17T08:29:24.210Z (4 months ago)
- Topics: aws-ec2, glpi, mariadb, rds, terraform
- Language: HCL
- Homepage:
- Size: 106 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# GLPI on RDS High Availability - Terraform
![GLPI on RDS High Availability](./img/GLPIArchitecture.jpg)
The purpose of this Terraform template creates a high availability setup for GLPI using an EC2 instance, an RDS MariaDB instance and a shell script installing GLPI on a Linux server.
This README file provides a comprehensive guide on how to install and configure GLPI on an Ubuntu-based 20.04 system. I hope it helps you get started with using GLPI for your IT asset management needs.
## Key Components
- aws_key_pair: This resource creates an SSH key pair that will be used to connect to the EC2 instance where GLPI will be installed.
- aws_iam_instance_profile: This resource creates an IAM instance profile, which will be attached to the EC2 instance to provide it with the necessary permissions to access other AWS services like SSM.
- aws_iam_role: This resource creates an IAM role for the EC2 instance. It allows the EC2 instance to assume this role and access the authorized AWS services.
- aws_iam_role_policy: This resource attaches an IAM policy to the EC2 role. The ec2ssmcwlogsaccess_iam_policy and ec2ssmaccess_iam_policy policies grant the EC2 instance the required access to SSM and CloudWatch Logs services for management and monitoring.
- aws_db_subnet_group: This resource creates a subnet group for RDS. It specifies the private subnets where RDS will be deployed.
- aws_s3_bucket: This resource creates an S3 bucket that will be used to store a GLPI installation script.
- aws_s3_bucket_object: This resource creates an object in the previously created S3 bucket. The object contains a bash script that installs and configures GLPI on the EC2 instance.
- aws_instance: This resource deploys the EC2 instance where GLPI will be installed. It is configured with the SSH key, IAM instance profile, custom startup script, and other necessary parameters.
- aws_db_instance: This resource deploys an RDS instance to host the GLPI database. It uses the previously created subnet group and other specified configuration settings.
- aws_lb: This resource deploys an Application Load Balancer (ALB) for high availability and traffic distribution to the EC2 instance.
- aws_lb_target_group: This resource creates a target group for the ALB, specifying the EC2 instance as the target for traffic.
- aws_lb_listener: This resource configures a listener on the ALB to redirect incoming traffic to the target group.## Requirements
| Name | Version |
|------|---------|
| [aws](#requirement\_aws) | >= 3.0.0 |## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | 5.7.0 |
| [local](#provider\_local) | 2.4.0 |
| [tls](#provider\_tls) | 4.0.4 |## Parameters
The following parameters must be passed to the `variable.tf` file:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [AMI](#input\_AMI) | Amazon Machine Image (AMI) ID | `string` | n/a | yes |
| [EC2InstanceProfile](#input\_EC2InstanceProfile) | Instance profile for Systems Manager | `string` | n/a | yes |
| [EC2InstanceType](#input\_EC2InstanceType) | EC2 instance type | `string` | n/a | yes |
| [InternetGateway](#input\_InternetGateway) | Internet Gateway | `string` | n/a | yes |
| [PrivateSubnetA](#input\_PrivateSubnetA) | Private Subnet A | `string` | n/a | yes |
| [PrivateSubnetB](#input\_PrivateSubnetB) | Private Subnet B | `string` | n/a | yes |
| [PublicSubnetA](#input\_PublicSubnetA) | Public Subnet A | `string` | n/a | yes |
| [PublicSubnetB](#input\_PublicSubnetB) | Public Subnet B | `string` | n/a | yes |
| [VPC](#input\_VPC) | VPC Id | `string` | n/a | yes |
| [bucket\_name](#input\_bucket\_name) | Bucket Name | `string` | n/a | yes |
| [encrypted\_password](#input\_encrypted\_password) | Encrypted GLPI password | `string` | MySuperGlpi2022 | yes |
| [key\_pair\_name](#input\_key\_pair\_name) | Key Pair name | `string` | n/a | yes |
| [multi\_az](#input\_multi\_az) | Multi AZ | `bool` | true | yes |
| [policy\_name](#input\_policy\_name) | Policy Name | `string` | n/a | yes |
| [region](#input\_region) | AWS region | `string` | n/a | yes |## Usage
Edit the `variables.tf` with your own AWS configuration and `userdata.sh` file with your bucket name.
To use Terraform with AWS, you can follow these steps:
``` bash
terraform init && terraform apply --auto-approve
```After running terraform apply, waits for the instance to be deployed, this takes a little time.
## Access GLPI
You should now be able to access to the GLPI web application by accessing your ALB's IP address in your web browser `/glpi/index.php`. The GLPI setup wizard should appear, allowing you to complete the setup process and enjoy.
[Install wizard](https://glpi-install.readthedocs.io/en/latest/install/wizard.html)
## CloudFormation version
[GLPI on RDS High Availability - CloudFormation](https://github.com/Yris-ops/glpi-on-rds-high-availability-for-aws)
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## License
This repository is licensed under the Apache License 2.0. See the LICENSE file.