A standalone Ubuntu (latest) EC2 instance.
Example:
module "ec2_base" {
source = "github.com/andreswebs/terraform-aws-ec2-base"
vpc_id = var.vpc_id
cidr_whitelist = var.cidr_whitelist
name = "k3s"
allow_web_traffic = true
extra_whitelisted_ingress_rules = [
{
from_port = "6443"
to_port = "6443"
}
]
}
module "ec2_instance" {
source = "github.com/andreswebs/terraform-aws-ec2-instance-linux"
subnet_id = var.subnet_id
vpc_security_group_ids = [module.ec2_base.security_group.id]
ssh_key_name = module.ec2_base.key_pair.key_name
iam_profile_name = module.ec2_base.instance_profile.name
name = "k3s"
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
ami_id | n/a | string |
null |
no |
app_gid | n/a | number |
2000 |
no |
app_home_dir | n/a | string |
null |
no |
app_is_sudoer | n/a | bool |
false |
no |
app_uid | n/a | number |
2000 |
no |
app_username | n/a | string |
null |
no |
associate_public_ip_address | n/a | bool |
false |
no |
enclave_enabled | n/a | bool |
false |
no |
extra_volumes | n/a | list(object({ |
[] |
no |
iam_profile_name | n/a | string |
n/a | yes |
instance_termination_disable | n/a | bool |
false |
no |
instance_type | n/a | string |
"m7a.xlarge" |
no |
kms_key_id | n/a | string |
null |
no |
name | n/a | string |
n/a | yes |
root_volume_delete | n/a | bool |
true |
no |
root_volume_encrypted | n/a | bool |
true |
no |
root_volume_size | n/a | number |
0 |
no |
root_volume_type | n/a | string |
"gp3" |
no |
ssh_key_name | n/a | string |
null |
no |
subnet_id | n/a | string |
n/a | yes |
tags | n/a | map(string) |
{} |
no |
user_data | n/a | string |
null |
no |
user_data_replace_on_change | n/a | bool |
false |
no |
vpc_security_group_ids | n/a | list(string) |
[] |
no |
Name | Source | Version |
---|---|---|
ubuntu_24_04_latest | andreswebs/ami-ubuntu/aws | 3.0.0 |
Name | Description |
---|---|
id | n/a |
private_ip | n/a |
public_ip | n/a |
Name | Version |
---|---|
aws | ~> 5.0 |
cloudinit | ~> 2.3 |
Name | Version |
---|---|
terraform | ~> 1.5 |
aws | ~> 5.0 |
cloudinit | ~> 2.3 |
Name | Type |
---|---|
aws_ebs_volume.this | resource |
aws_eip.this | resource |
aws_instance.this | resource |
aws_volume_attachment.this | resource |
aws_instance.this | data source |
aws_subnet.this | data source |
cloudinit_config.this | data source |
Andre Silva - @andreswebs
This project is licensed under the Unlicense.