3.1 KiB
3.1 KiB
Module docker-instance
This Terraform module start an AWS instance in default VPC. Instance is build from latest Amazon Linux 2023 minimal AMI, with EC2 Instance Connect and Docker installed at first boot.
How to connect with SSH
aws ec2-instance-connect send-ssh-public-key \
--instance-id ${INSTANCE_ID} \
--availability-zone ${AVAILABILITY_ZONE} \
--instance-os-user ec2-user \
--ssh-public-key file://${PATH_TO_PUBLIC_KEY}
ssh -o "IdentitiesOnly=yes" -i ${PATH_TO_PUBLIC_KEY} ec2-user@${INSTANCE_PUBLIC_IP}
- workflows / actions (.tf format and validate)
- git hooks
Requirements
| Name | Version |
|---|---|
| terraform | >=1.0 |
| aws | >= 4.0 |
Providers
| Name | Version |
|---|---|
| aws | 5.32.1 |
Modules
No modules.
Resources
| Name | Type |
|---|---|
| aws_iam_instance_profile.docker | resource |
| aws_iam_role.docker | resource |
| aws_iam_role_policy.docker | resource |
| aws_instance.docker | resource |
| aws_security_group.remote_control | resource |
| aws_security_group_rule.out | resource |
| aws_security_group_rule.ssh | resource |
| aws_ami.latest | data source |
| aws_iam_policy_document.docker | data source |
| aws_iam_policy_document.ec2_assume | data source |
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| ami_regexp | value | string |
"^al2023-ami-minimal-.*" |
no |
| instance_type | Instance type to use for the Docker instance. | string |
"t3.medium" |
no |
| key_name | value | string |
"" |
no |
| vpc_id | Target VPC id. | string |
n/a | yes |
Outputs
| Name | Description |
|---|---|
| instance | Instance attributes. |