1

Is it possible to declare "a complete production level EKS with other aws services" using terraform? I know that terraform has an eks module and an aws provider. But I'm not sure if one can create everything (ALB, IAM roles and policies, security groups, ebs, efs, rds, aws networking, ...) using terraform.

I want to learn aws by experimenting. But I cannot afford spending that much money. So I need to be able to destroy everything and recreate the exact infrastructure whenever it's needed.

I've found a really good aws workshop. But like almost all of tutorials, it's based on running "eksctl and aws cli" commands.

Is there a reliable way of declaring everything once and recreate the whole infrastructure declarativly (without touching aws console)?

1
  • 1
    It's definitely possible, but I think the question is would you use Terraform to create the ALB and the Kubernetes namespaces / roles / service accounts using the Kubernetes provider. Or would you let Kubernetes manage the creation of AWS resources e.g. volumes, ALB via the AWS EBS CSI or CNI. There is a tradeoff on what you would want Terraform to manage and what AWS resources you would like Kubernetes to manage as part of application service deployment. It is also worth noting that sometimes Terraform can be behind the cloud provider APIs in terms of features.
    – Robert
    Commented Jan 23, 2021 at 17:56

1 Answer 1

3

Is it possible to declare "a complete production level EKS with other aws services" using terraform?

Yes, and that is what many larger organizations do. I have implemented Kubernetes with other AWS resources this way for larger companies e.g. a bank, using Terraform.

I want to learn aws by experimenting. But I cannot afford spending that much money. So I need to be able to destroy everything and recreate the exact infrastructure whenever it's needed.

That should go well. You can use e.g. terraform apply to provision infrastructure and terraform destroy to take it down. I would also recommend to add tests on your infrastructure using e.g. Terratest and perhaps use tfsec in a pipeline so that you are comfortable that new changes does not break your cluster - using Infrastructure as Code the full way.

Is there a reliable way of declaring everything once and recreate the whole infrastructure declaratively (without touching aws console)?

Yes, that is a best practice.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.