The document discusses managing AWS resources using Terraform. It introduces Terraform 0.12 and its new features. It also summarizes ways to manage non-natively supported AWS resources and GitHub resources using Terraform modules, Terragrunt, and other tools. The document promotes visualizing infrastructure using Cloudcraft and generating Terraform code.
Unblocking The Main Thread Solving ANRs and Frozen Frames
Manage AWS Resources with Terraform 0.12
1. Manage any AWS resources with
Terraform 0.12
Anton Babenko
@antonbabenko
April 2020
2. Anton Babenko
AWS Community Hero / Certified Terraform fanatic since 2015
Organiser of HashiCorp UG, AWS UG, DevOps Norway, DevOpsDays Oslo
I 💚 open-source:
terraform-community-modules + terraform-aws-modules
antonbabenko/pre-commit-terraform — clean code and documentation
antonbabenko/modules.tf-lambda — generate Terraform code from visual diagrams
antonbabenko/terragrunt-reference-architecture — Terragrunt reference architecture
www.terraform-best-practices.com
antonbabenko.com — various Terraform and AWS notes
@antonbabenko — Twitter, GitHub, Linkedin
3. All-things Terraform + AWS + DevOps
Consulting
Workshops
Trainings
Mentorship
My company: betajob.com
My email: anton@antonbabenko.com
LinkedIn: https://www.linkedin.com/in/antonbabenko
What do I do?
4. Collection of open-source Terraform AWS modules supported by the community.
More than 7 mil. downloads since September 2017.
(VPC, Autoscaling, RDS, Security Groups, ELB, ALB, Redshift, SNS, SQS, IAM, EKS, ECS, TGW…)
github.com/terraform-aws-modules
registry.terraform.io/modules/terraform-aws-modules
@antonbabenko
5. 7+ million provisions, 1000+ pull-requests and issues resolved…
Become a sponsor — github.com/sponsors/antonbabenko
@antonbabenko
11. Why Terraform and not AWS CloudFormation,
Azure ARM, Google Cloud Deployment Manager?
@antonbabenko
Terraform supports 250+ providers, has easier syntax (HCL), has native support for
modules and remote states, has teamwork related features, is an open-source project
Provides a high-level abstraction of infrastructure, unifies the view of resources
Supports the modern datacenter (IaaS, PaaS, SaaS)
Separates planning from execution (dry-run)
Provides a workflow which is technology agnostic
Manages anything with an API
12. Terraform — universal tool for everything with an API
GitHub repositories, users, permissions
SecretHub.io secrets and permissions
Dropbox files and access
Datadog users and metrics
Minecraft, or even order Domino’s pizza
All Terraform providers — https://www.terraform.io/docs/providers/index.html
@antonbabenko
19. Terraform developers
Create and maintain Terraform modules (curated modules)
Happily using Terraform 0.12 💚 💚 💚
Implement company’s standards (security, encryption, naming,
integrations, tagging)
Maintain "reference architectures" inside of the company
@antonbabenko
20. Terraform users (all of us)
Use Terraform modules by setting correct values
Terraform 0.12 + HCL2 = 💚
Domain experts in certain areas (e.g. backend developers)
May not have "Terraform" skills in profile on LinkedIn
@antonbabenko
21. Manage any AWS resources with
Terraform
https://github.com/antonbabenko/terraform-aws-anything
@antonbabenko
22. Available types of AWS resources
Supported by Terraform AWS provider
Supported only by AWS CloudFormation, but not by Terraform AWS
provider
Supported by AWS SDK/CLI and not in AWS CloudFormation
Partially supported by Terraform AWS provider (some arguments are not
supported)
Not supported in AWS CLI/SDK
@antonbabenko
23. Available solutions to manage AWS
resources using Terraform
Use Terraform natively
Patch the Terraform AWS provider using Golang
Use local-exec provisioner with aws-cli
Use shell provider - https://github.com/scottwinkler/terraform-
provider-shell
@antonbabenko
29. Infrastructure as code generator — from visual diagrams to Terraform
Source code — https://github.com/antonbabenko/modules.tf-lambda
Generated infrastructure code — https://github.com/antonbabenko/modules.tf-demo
@antonbabenko
30. ✓ cloudcraft.co — design, plan and visualize
✓ terraform-aws-modules — building blocks of AWS infrastructure
✓ Terraform — manage infrastructure as code
✓ Terragrunt — orchestrate Terraform configurations
@antonbabenko
31. 1. Go to cloudcraft.co
2. Sign up, sign in (free account)
3. Draw your AWS infrastructure
4. Click "Export"
5. Click "Terraform code export"
Try it yourself!
@antonbabenko
32. Demo
✓ A picture's worth a thousand words
✓ Design, draw and deploy infrastructure as code
✓ https://asciinema.org/a/32rkyxIBJ2K4taqZLSlKYNDDI
@antonbabenko
33. modules.tf — generated code
✓ Potentially ready-to-use Terraform configurations
✓ Suits best for bootstrapping
✓ Enforces Terraform best-practices and segregation of duties between
Terraform developers and users
✓ Batteries included (terraform-aws-modules, terragrunt, pre-commit-
terraform)
✓ 100% free and open-source (https://github.com/antonbabenko/modules.tf-
lambda)
✓ Released under MIT license
@antonbabenko
34. modules.tf — roadmap
✓ Create and maintain more terraform-aws-modules for more AWS services
✓ Integrate modules.tf with VCS, Terraform Cloud or Atlantis
✓ "From Terraform to visual diagrams"
✓ Tell me more… @antonbabenko
@antonbabenko