Skip to content

Hyperbach/scalable-bot-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Terraform Configuration for Feed Worker

This Terraform configuration sets up the necessary AWS resources for a feed worker instance, including its associated security group, subnet, and AMI creation from the instance, utilizing provided default values for quick setup.

Prerequisites

  • An AWS account
  • Terraform installed on your machine
  • An existing VPC (unless you're using the default provided)
  • An existing security group (unless you're using the default provided)

Resources Created

  1. AWS Instance (feed_worker): An EC2 instance based on the specified base AMI, instance type, and subnet. It's configured to install AWS CLI and Docker upon initialization. Additional user data scripts are used for setup.

  2. AWS AMI (feed_worker_ami): A new AMI created from the EC2 instance, intended for subsequent use in scaling or replication. The AMI includes the AWS CLI and Docker, installed during the EC2 instance's initialization.

  3. AWS Subnet (private_subnet): A private subnet within the specified VPC, tailored for the feed worker instances.

  4. AWS Security Group (private_sg): A security group with configured inbound and outbound rules. It allows inbound traffic from an existing security group and all outbound traffic.

Usage

  1. Initialize your Terraform workspace with the command terraform init, which will download the necessary plugins and modules.

  2. Plan your deployment with terraform plan to see the resources that will be created.

  3. Apply your configuration with terraform apply. Confirm the action to proceed with the resource creation.

Variables

This configuration uses the following variables with default values:

  • aws_region: The AWS region where resources will be created. Default is "eu-central-1" (Frankfurt).
  • availability_zone: The availability zone for the subnet. Default is "eu-central-1a".
  • base_ami: The base AMI ID for the EC2 instance. Default is a Canonical Ubuntu 22.04 LTS image.
  • user_name: The username for the EC2 instance. Default is "ubuntu".
  • instance_type: The type of EC2 instance to deploy. Default is "t2.micro".
  • vpc_id: The ID of the VPC for the security group and subnet. Default is a specific VPC ID.
  • subnet_id: The ID of the subnet where the EC2 instance will reside. Default is a specific subnet ID.
  • existing_security_group_name: The name of the existing security group for inbound rules. Default is a specific security group ID.

Outputs

After applying the Terraform configuration, the following outputs will be available:

  • ami_id: The ID of the newly created AMI.
  • instance_id: The ID of the created EC2 instance.
  • subnet_id: The ID of the created subnet.
  • security_group_id: The ID of the created security group.

Notes

  • Ensure your AWS credentials are correctly set up, either through the AWS CLI or environment variables.
  • Review and modify the security group rules according to your organization's security policies.
  • You can override any default variable value by creating a terraform.tfvars file or passing them directly via the command line.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors