Skip to content

mbasri/quick-aws-ec2-fleet

Repository files navigation

Quick AWS EC2 Fleet

License: MIT

Terraform project which create VPC and Auto Scaling Group resource on AWS from scratch.

Create and destroy the infrastructure

1. Create infrastructure

git clone https://github.com/mbasri/quick-aws-ec2-fleet.git
cd quick-aws-ec2-fleet
terraform init
terraform apply

2. Destroy infrastructure

git clone https://github.com/mbasri/quick-aws-ec2-fleet.git
cd quick-aws-ec2-fleet
terraform init
terraform destroy

Use the EC2 instance

1. Connect to the EC2 instance

See the Terrafom output 'ssm_session'

Generate docs

terraform-docs -c .terraform-docs.yml .

Requirements

Name Version
terraform 1.10.2
aws 5.81.0

Providers

Name Version
aws 5.81.0
cloudinit 2.3.7

Modules

Name Source Version
alb git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-alb v1.0.0
autoscaling git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-autoscaling v1.0.0
iam-instance-profile git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-iam-instance-profile v1.2.0
kms git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-kms v1.3.0
security-group-alb git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-security-group v1.2.0
security-group-ec2 git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-security-group v1.2.0
vpc git::https://gitlab.com/mbasri-terraform/modules/aws/terraform-aws-vpc v1.7.3

Resources

Name Type
aws_lb_listener_rule.this resource
aws_lb_target_group.this resource
aws_ssm_parameter.main resource
cloudinit_config.main data source

Inputs

No inputs.

Outputs

Name Description
autoscaling_group_arn ARN of the created Auto Scaling Group
autoscaling_group_id ID of the created Auto Scaling Group
default_security_group_id The ID of the VPC default security group
iam_instance_profile_arn The ARN of the IAM Instance Profile
iam_instance_profile_id The ID of the IAM Instance Profile
iam_instance_profile_name The Name of the IAM Instance Profile
key_alias_arn The Amazon Resource Name (ARN) of the key alias
key_alias_name Name of the key alis
key_arn The Amazon Resource Name (ARN) of the key
key_id Name of the key
key_policy The IAM resource policy set on the key
launch_template_arn ARN of the created Launch Template
launch_template_id ID of the created Launch Template
launch_template_latest_version Latest version of the created Launch Template
nat_gateway_public_ips Private IP of NAT Gateway
private_subnet_cidr List of cidr_blocks of private subnets
private_subnet_ids List of IDs of private subnets
public_subnet_cidr List of cidr_blocks of public subnets
public_subnet_ids List of IDs of public subnets
region The Name of the region
secure_subnet_cidr List of cidr_blocks of secure subnets
secure_subnet_ids List of IDs of secure subnets
security_groups_arn The ARN of the security group
security_groups_description The description of the security group
security_groups_id The ID of the security group
security_groups_name The name of the security group
security_groups_owner_id The owner ID
security_groups_vpc_id The VPC ID
spot_logs_cwl_id The IDs of the cloudwatch logs for Spot logging
ssm_session Command to start ssm session
system_logs_cwl_id The IDs of the cloudwatch logs for VM system logs
vpc_cidr_blocks The CIDR block of the VPC
vpc_flow_logs_cwl_id The ID of the cloudwatch logs for VPC flow logs
vpc_id The ID of the VPC

Author

License

This is free and unencumbered software released into the public domain - see the LICENSE file for details

About

Terraform project which create VPC and Auto Scaling Group resource on AWS from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published