Terraform module which creates an SSM compatible EC2 instance on AWS. By default uses KMS encrypted storage.
module "ec2" {
source = "github.com/stuxcd/terraform-aws-ssm-ec2.git?ref={VERSION}"
## required
vpc_id = "vpc-1234567890"
subnet_id = "subnet-1234567890"
## optional
# create = true
# additional_security_group_ids = []
# launch_template_name = "my-custom-launch-template"
# launch_template_version = ""
# instance_size = ""
# tags = {}
}
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 4.0 |
random | >= 3.0 |
Name | Version |
---|---|
aws | >= 4.0 |
random | >= 3.0 |
No modules.
Name | Type |
---|---|
aws_iam_instance_profile.this | resource |
aws_iam_role.this | resource |
aws_iam_role_policy_attachment.this | resource |
aws_instance.launch_template | resource |
aws_instance.standalone | resource |
aws_kms_key.ec2_volume | resource |
aws_security_group.this | resource |
aws_security_group_rule.this | resource |
random_pet.global_name | resource |
aws_ami.ubuntu | data source |
aws_caller_identity.current | data source |
aws_iam_policy_document.ec2_volume | data source |
aws_region.current | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
additional_security_group_ids | The identifier of a custom security group ID, replaces default | list(string) |
[] |
no |
instance_size | The size of the EC2 instance to deploy | string |
"t3a.small" |
no |
launch_template_name | The name of the launch template to use | string |
"" |
no |
launch_template_version | The launch template version | string |
"$Default" |
no |
subnet_id | The identifier of subnet to deploy EC2 instance into | string |
n/a | yes |
vpc_id | The identifier of VPC to deploy EC2 instance into | string |
"" |
no |
Name | Description |
---|---|
ec2_instance_name | The name of the EC2 instance created |
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 4.0 |
random | >= 3.0 |
Name | Version |
---|---|
aws | 4.63.0 |
random | 3.5.1 |
Name | Source | Version |
---|---|---|
role | terraform-aws-modules/iam/aws//modules/iam-assumable-role | 5.17.0 |
Name | Type |
---|---|
aws_iam_instance_profile.this | resource |
aws_instance.launch_template | resource |
aws_instance.standalone | resource |
aws_security_group.this | resource |
aws_security_group_rule.this | resource |
random_pet.global_name | resource |
aws_ami.ubuntu | data source |
aws_kms_key.ebs | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
additional_security_group_ids | The identifier of a custom security group ID, replaces default | list(string) |
[] |
no |
create | Controls if EKS resources should be created (affects nearly all resources) | bool |
true |
no |
instance_size | The size of the EC2 instance to deploy | string |
"t3.micro" |
no |
launch_template_name | The name of the launch template to use | string |
"" |
no |
launch_template_version | The launch template version | string |
"$Default" |
no |
subnet_id | The identifier of subnet to deploy EC2 instance into | string |
n/a | yes |
tags | A map of tags to add to all resources | map(string) |
{} |
no |
vpc_id | The identifier of VPC to deploy EC2 instance into | string |
"" |
no |
Name | Description |
---|---|
ec2_instance_name | The name of the EC2 instance created |
role_arn | The ARN of the role created |