https://github.com/robmarkcole/terraform-ec2-example
https://github.com/robmarkcole/terraform-ec2-example
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/robmarkcole/terraform-ec2-example
- Owner: robmarkcole
- Created: 2021-07-12T06:40:24.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-12T06:41:01.000Z (almost 5 years ago)
- Last Synced: 2025-03-25T00:07:48.084Z (about 1 year ago)
- Language: HCL
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# robins-dev-ec2
Dev instance creation terraform.
- To format: `terraform fmt`
- Validate: `terraform validate`
- Create infra: `terraform apply`
- To destroy the instance: `terraform destroy`
## SSH connection
- The required ssh key is hardcoded to `robins-ec2-key-pair` and stored on AWS Secrets manager
- To connect from vscode using remote connect simply add to your ssh config file:
```
Host robins-dev-ec2
HostName ec2-18-168-76-253.eu-west-2.compute.amazonaws.com
IdentityFile /Users/robin/.ssh/robins-ec2-key-pair.pem
User ubuntu
```
## Github
To auth with github install the [gh cli](https://cli.github.com/manual/) and auth with an access token that has role `admin:org:read&write`. Set your git config with `git config user.name "Robin"` and `git config user.email "my@email"`
## AWS
Setup the [aws cli](https://aws.amazon.com/cli/) then `aws configure` and test with `aws s3 ls`
## Conda
Installed following [these instructions](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html) to `/home/ubuntu/anaconda3`
## Setup tools
- `sudo apt update`
- `sudo apt install docker.io` & `sudo apt install docker-compose`
- `sudo docker run hello-world` # simply validates docker is installed
- `sudo apt install unzip`
## Ubuntu commands
- `df -h` to list available storage
- If getting permissions errors: `sudo chown -R ubuntu /my/dir`