Title
AWS re:Invent 2022 - Terraform providers using AWS CloudFormation custom resources (BOA316)
Summary
- Speakers: Martijn van Dongen, a cloud evangelist from Schubert Phyllis, and Sohan Maheshwar, a senior dev advocate with AWS.
- Main Topics: Integration of Terraform with AWS CloudFormation custom resources, automation of non-native AWS applications, and the use of custom resource providers.
- Customer Stories: Two customer cases were discussed. The first involved a lease car company needing to automate non-native AWS applications, leading to the use of CloudFormation custom resources. The second case involved a team working with breweries using IoT Greengrass, which had limitations with Terraform and CloudFormation, resolved by using AWS Lambda.
- CloudFormation Custom Resources: The talk explained how to use CloudFormation custom resources to write custom provisioning logic, using either AWS Lambda or SNS topics as service tokens.
- Terraform Integration: The speakers demonstrated how to integrate CloudFormation custom resources into Terraform scripts, allowing for the automation of resources not natively supported by Terraform.
- CDK Mention: AWS CDK (Cloud Development Kit) was briefly discussed as another tool that can be used for infrastructure as code, with support for multiple programming languages.
- Resources: All code and examples from the session are available on GitHub, and further reading on custom resources and Terraform providers was encouraged.
Insights
- Custom Resource Providers: The use of custom resource providers in CloudFormation allows for a unified approach to infrastructure automation across different teams and tools, reducing the variations in implementations.
- Terraform and CloudFormation Synergy: By embedding CloudFormation templates within Terraform scripts, teams can leverage the strengths of both tools, even when certain AWS services are not directly supported by Terraform.
- Automation and Standardization: The approach presented helps standardize automation practices across an organization, making it easier to manage and update infrastructure as code, which is particularly beneficial for companies with a large number of engineers and diverse technology stacks.
- CDK as an Alternative: The AWS CDK was mentioned as an alternative for teams more comfortable with general-purpose programming languages, offering a higher level of abstraction and the ability to use constructs for common cloud patterns.
- Community Contributions: The session highlighted the importance of community contributions, such as the Custom Resource Helper module developed by AWS, which simplifies the handling of custom resources in CloudFormation.
- Scalability and Legacy Applications: The solutions presented are scalable and applicable to both legacy and modern applications, emphasizing that while this approach works at scale, it is one of many possible solutions depending on specific organizational needs and constraints.