0. Configure IAM User for Terraform CLI
add permissions -> "AdministratorAccess" (for convenience on demo project)
create Access key
$ aws configure
input access key and secret key
check cat ~/.aws/credentials
check cat ~/.aws/config
📦terraform
┣ 📜0-locals.tf
┣ 📜1-providers.tf
┣ 📜2-vpc.tf
┣ 📜3-igw.tf
┣ 📜4-subnets.tf
┣ 📜5-nat.tf
┗ 📜6-routes.tf
1 IGW
2 Public Subnet (AZ A, B)
2 Private Subnet (AZ A, B)
📦terraform
┣ 📜7-eks.tf
┗ 📜8-nodes.tf
EKS (Managed by AWS)
Nodes (Managed by AWS)
$ aws eks update-kubeconfig \
--region ap-northeast-2 \
--name staging-demo # make kubectl towards eks
$ kubectl get nodes
$ kubectl auth can-i " *" " *"
3. Add IAM User & IAM Role to AWS EKS
$ aws configure --profile developer
$ aws sts get-caller-identity --profile developer
$ aws eks update-kubeconfig \
--region ap-northeast-2 \
--name staging-demo \
--profile developer
$ aws configure --profile manager
$ aws sts assume-role \
--role-arn arn:aws:iam::039612876607:role/staging-demo-eks-admin \
--role-session-name manager-session \
--profile manager
$ aws eks update-kubeconfig \
--region ap-northeast-2 \
--name staging-demo \
--profile eks-admin
$ kubectl config view --minify