Terraform commands to execute the script
# initialise project & download providers
terraform init
# preview what will be created with apply & see if any errors
terraform plan
# exeucute with preview
terraform apply -var-file terraform.tfvars
# execute without preview
terraform apply -var-file terraform.tfvars -auto-approve
# destroy everything
terraform destroy
# show resources and components from current state
terraform state list
# install and configure awscli with access creds
aws configure
# check existing clusters list
aws eks list-clusters --region eu-central-1 --output table --query 'clusters'
# check config of specific cluster - VPC config shows whether public access enabled on cluster API endpoint
aws eks describe-cluster --region eu-central-1 --name myapp-eks-cluster --query 'cluster.resourcesVpcConfig'
# create kubeconfig file for cluster in ~/.kube
aws eks update-kubeconfig --region eu-central-1 --name myapp-eks-cluster
# test configuration
kubectl get svc