https://github.com/anuragkapur/aws-infra-as-code
⚙️ Infrastructure code for my AWS account
https://github.com/anuragkapur/aws-infra-as-code
aws eks spot-instances terraform
Last synced: 4 months ago
JSON representation
⚙️ Infrastructure code for my AWS account
- Host: GitHub
- URL: https://github.com/anuragkapur/aws-infra-as-code
- Owner: anuragkapur
- Created: 2019-12-20T12:26:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-31T13:55:28.000Z (about 5 years ago)
- Last Synced: 2025-06-09T11:07:30.340Z (4 months ago)
- Topics: aws, eks, spot-instances, terraform
- Language: HCL
- Homepage:
- Size: 78.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
AWS - Infra as code
===================This repository contains infrastructure code used to manage my AWS account.
## Pre-requisites
* Terraform 0.12
* Ansible 2.5.2
* [aws-iam-authenticator](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html)### Infra setup using terraform
1. Create new AWS account
1. Create new IAM user with admin privileges and add the access key ID and secret access key to `~/.aws/credentials`
1. Ensure there are no `AWS_ACCESS_KEY` or `AWS_SECRET_KEY` env variables defined in your local env
1. Provision dev environment
1. Review configuration variables in [main.tf](terraform/environments/dev/main.tf), especially, `aws_credenital_profile`
variable
1. Provision infrastructure
```shell script
cd terraform/environments/dev
terraform init
terraform apply
```
### Local client setup
1. Configure the path of the [kubeconfig_dev-eks-cluster](./terraform/kubeconfig_dev-eks-cluster) in the `KUBECONFIG`
env variable for your local environment to be able to communicate with the EKS cluster using `kubectl`
1. Verify local `kubectl` setup using the command below
```shell script
$ kb get nodes
```
# ToDos
* Monitoring and alerting
* auto-scaling notifications