terraform.aws-baseline-infra/modules/compute/ec2
2024-05-31 20:37:39 +08:00
..
main.tf UPD: removed ec2_default_tags module and replaced with ec2 2024-05-31 20:37:39 +08:00
outputs.tf UPD: removed ec2_default_tags module and replaced with ec2 2024-05-31 20:37:39 +08:00
provider.tf UPD: removed ec2_default_tags module and replaced with ec2 2024-05-31 20:37:39 +08:00
README.md UPD: removed ec2_default_tags module and replaced with ec2 2024-05-31 20:37:39 +08:00
variable.tf UPD: removed ec2_default_tags module and replaced with ec2 2024-05-31 20:37:39 +08:00

Requirements

Name Version
terraform >= 1.3.0
aws ~> 5.35.0

Providers

Name Version
aws ~> 5.35.0
random n/a
tls n/a

Modules

No modules.

Resources

Name Type
aws_ebs_volume.data-volumes resource
aws_eip.ec2-eip resource
aws_instance.ec2-instance resource
aws_key_pair.this resource
aws_secretsmanager_secret.this resource
aws_secretsmanager_secret_version.this resource
aws_volume_attachment.data-volume-attachments resource
random_id.this resource
tls_private_key.this resource
aws_default_tags.this data source

Inputs

Name Description Type Default Required
additional-tags Additional tags to be assigned on top of provider default tags. Useful for setting backup tags. map(string) n/a yes
ami-id Image id of EC2 instance string n/a yes
asso-eip Whether to associate Elastic IP bool n/a yes
asso-public-ip Whether to associate ephemeral public IP bool n/a yes
create-ssh-key Set true to create ssh key and store on secret manager bool false no
data-volumes Attach additional data volumes
map(object({
size = number
type = string
}))
n/a yes
delete-on-termination Whether to delete volumes on termination bool true no
disable_secure_idmsv2 If set to true, the insecure IDMSv1 will be used. bool false no
ebs-encrypted Whether to enable EBS encryption bool true no
enable-detail-monitoring Set true to enable detail monitoring bool false no
enable-termination-protection Whether to enable prevent accidential deletion of instance bool false no
instance-name Name of ec2 instance string n/a yes
instance-profile Ec2 instance profile name string "" no
instance-type Instance type string n/a yes
key-name Instance ssh key name string "" no
kms-key-id Disk encryption KMS key id string n/a yes
private-ip Specify private IP to be used on this instance string null no
root-volume-size Size of root volume number n/a yes
root-volume-type Root volume type string "gp3" no
security-groups List of security groups for Ec2 instance list(string) n/a yes
spot-max-price Max hourly price for spot instance. If greater than zero, spot instance will be used. number 0 no
subnet-id Id of subnet to deploy Ec2 instance to string n/a yes
user-data Ec2 user-data string "" no

Outputs

Name Description
ec2-id-ip Ec2 instance id and private ip
elastic-ip Ec2 instance EIP
instance-id Ec2 instance id
private-ip Ec2 instance private IP
public-ip Ec2 instance ephemeral public IP
ssh-key-name Ec2 instance ssh key name
ssh-key-secret-arn Secretsmanager arn for ec2 instance ssh key

Authorship

This module was developed by xpk.