Skip to content

A Terraform module to create instance ec2 on Amazon Web Services (AWS).

License

Notifications You must be signed in to change notification settings

luismayta/terraform-aws-ec2-instance

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Latest Release Lint CI Test pre-commit Conventional Commits KeepAChangelog Terraform Version AWS Provider Version

terraform-aws-ec2-instance

terraform-aws-ec2-instance for project

Requirements

This is a list of plugins that need to be installed previously to enjoy all the goodies of this configuration:

Usage

How to use this project

  module "key" {
    source     = "hadenlabs/key-pair/aws"
    version    = ">=0.1"
    name       = "name-key"
    public_key = var.public_key
  }

  resource "aws_default_vpc" "default" {
    tags = var.tags
  }

  resource "aws_subnet" "this" {
    vpc_id                  = aws_default_vpc.default.id
    cidr_block              = "172.30.9.0/24"
    map_public_ip_on_launch = true
    tags                    = module.tags.tags
  }

  module "main" {
    depends_on = [
      module.key,
    ]

    source = "hadenlabs/ec2-instance/aws"
    version = "0.2.0"
    name           = "name-server"
    ami            = data.aws_ami.amazon_linux.id
    private_key    = var.private_key
    aws_key        = module.key.name
  }

Full working examples can be found in examples folder.

Requirements

Name Version
terraform >= 0.13
aws >=3.2.0
null >=0.1.0

Providers

Name Version
aws >=3.2.0
null >=0.1.0

Modules

No modules.

Resources

Name Type
aws_instance.this resource
aws_security_group.this resource
aws_security_group_rule.egress resource
aws_security_group_rule.ingress resource
null_resource.provision_core resource
null_resource.provision_docker resource

Inputs

Name Description Type Default Required
ami Id of ami of aws string n/a yes
aws_key aws key pair name string n/a yes
enabled_docker enabled install docker bool false no
instance_type type instance string "t2.micro" no
name Solution name, e.g. 'app' or 'jenkins' string n/a yes
private_key private key string n/a yes
rule_ingress list rule for security group
list(object({
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
}))
[] no
ssh_port port ssh number 22 no
ssh_user user ssh string "ubuntu" no
tags Additional tags (e.g. map('BusinessUnit','XYZ') map(string) {} no

Outputs

Name Description
instance instance instance.
private_ip private ip.
public_ip public ip.

Help

Got a question?

File a GitHub issue.

Contributing

See Contributing.

Module Versioning

This Module follows the principles of Semantic Versioning (SemVer).

Using the given version number of MAJOR.MINOR.PATCH, we apply the following constructs:

  1. Use the MAJOR version for incompatible changes.
  2. Use the MINOR version when adding functionality in a backwards compatible manner.
  3. Use the PATCH version when introducing backwards compatible bug fixes.

Backwards compatibility in 0.0.z and 0.y.z version

  • In the context of initial development, backwards compatibility in versions 0.0.z is not guaranteed when z is increased. (Initial development)
  • In the context of pre-release, backwards compatibility in versions 0.y.z is not guaranteed when y is increased. (Pre-release)

Copyright

Copyright Β© 2018-2022 Hadenlabs

Trademarks

All other trademarks referenced herein are the property of their respective owners.

License

The code and styles are licensed under the LGPL-3.0 license See project license..

Don't forget to 🌟 Star 🌟 the repo if you like terraform-aws-ec2-instance

Your feedback is appreciated

About

A Terraform module to create instance ec2 on Amazon Web Services (AWS).

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 44.0%
  • Go 29.7%
  • Handlebars 13.1%
  • TypeScript 7.5%
  • JavaScript 5.4%
  • Shell 0.3%