70 lines
3.1 KiB
Markdown
70 lines
3.1 KiB
Markdown
# 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
|
|
|
|
```bash
|
|
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
|
|
|
|
<!-- BEGIN_TF_DOCS -->
|
|
## Requirements
|
|
|
|
| Name | Version |
|
|
|------|---------|
|
|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=1.0 |
|
|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |
|
|
|
|
## Providers
|
|
|
|
| Name | Version |
|
|
|------|---------|
|
|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.32.1 |
|
|
|
|
## Modules
|
|
|
|
No modules.
|
|
|
|
## Resources
|
|
|
|
| Name | Type |
|
|
|------|------|
|
|
| [aws_iam_instance_profile.docker](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_instance_profile) | resource |
|
|
| [aws_iam_role.docker](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
|
|
| [aws_iam_role_policy.docker](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
|
|
| [aws_instance.docker](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
|
|
| [aws_security_group.remote_control](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
|
|
| [aws_security_group_rule.out](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
|
|
| [aws_security_group_rule.ssh](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
|
|
| [aws_ami.latest](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |
|
|
| [aws_iam_policy_document.docker](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
|
| [aws_iam_policy_document.ec2_assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
|
|
|
## Inputs
|
|
|
|
| Name | Description | Type | Default | Required |
|
|
|------|-------------|------|---------|:--------:|
|
|
| <a name="input_ami_regexp"></a> [ami\_regexp](#input\_ami\_regexp) | value | `string` | `"^al2023-ami-minimal-.*"` | no |
|
|
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | Instance type to use for the Docker instance. | `string` | `"t3.medium"` | no |
|
|
| <a name="input_key_name"></a> [key\_name](#input\_key\_name) | value | `string` | `""` | no |
|
|
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | Target VPC id. | `string` | n/a | yes |
|
|
|
|
## Outputs
|
|
|
|
| Name | Description |
|
|
|------|-------------|
|
|
| <a name="output_instance"></a> [instance](#output\_instance) | Instance attributes. |
|
|
<!-- END_TF_DOCS -->
|