Skip to content

Instantly share code, notes, and snippets.

@chefren
Last active May 24, 2022 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chefren/19bc6e7037f171e88d27a725b9008f3d to your computer and use it in GitHub Desktop.
Save chefren/19bc6e7037f171e88d27a725b9008f3d to your computer and use it in GitHub Desktop.

Comparison of Terraform vs CDK frameworks to use for AWS

Property Value/Behaviour TF Value/Behaviour CDK Opinion
Basic task Define and end state for the system and apply it when appropriate Generate AWS Cloudformation template to work with stack resources CDK benefits from AWS internal service. TF depends on AWS API
Language Terraform Config language Support for Typescrypt, Java, .Net, Go, Python CDK advantage for training with known languages
Backend TF state file (json) AWS Cloudformation TF requires a backend to be setup and hosted (can use S3 and DynamoDB), CDK may require CDK bootstrapping (deploys S3 and IAM through a stack via the tool)
Setup Docker containers available from Hashicorp Requires Node.js to run CDK, then the language platform of choice In both changes different envs with different versions may cause breaking changes if not carefully tested or if versions are not locked with some mechanism
Potential issues - Temporary credentials leave lock/corrupt state as midway through operation expire
- Force unlock needs coordinating to ensure no one /n othing else is attempting changes
- Inherent to AWS resource limitations (eg: resource replacement with same name)
- Stack rollbacks blocked, require manual action on resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment