Testing Terraform Modules in Local and CI Environments with LocalStack

Terraform 1.6 introduced native Terraform tests, but running them against real cloud resources leads to long deployment times and unnecessary costs. With LocalStack's Terraform integration (tflocal), you can validate configurations locally while closely emulating real cloud behaviour. By combining Terraform tests with LocalStack, developers can run integration tests in CI/CD environments, test event-driven serverless workflows, and establish a rapid feedback loop for cloud development.In this presentation, Harsh Mishra provides a hands-on demo of Terraform testing with LocalStack, exploring how to configure tests, validate infrastructure locally, and reduce costs and complexity while improving confidence in deployments.## Resources- Blog: https://blog.localstack.cloud/efficient-infrastructure-testing-localstack-terraform-tests-framework/- Documentation: https://developer.hashicorp.com/terraform/language/tests- tflocal: https://docs.localstack.cloud/user-guide/integrations/terraform/#tflocal-wrapper-script

Related Talks

Step-up Authentication using Amazon Cognito on LocalStack

LocalStack Applications in Developer Hub provides sample templates to help LocalStack users adopt real-world scenarios to rapidly and conveniently create, configure, and deploy applications locally. Getting started with Step-up-authentication demoIn this demo, we will setup a step-up authentication workflow for a higher level of security, deployed using Cloud Development Kit on LocalStack

Watch recording
Watch recording
Infrastructure-as-Code with LocalStack—Building & testing your configurations locally!

Infrastructure-as-Code refers to the practice of defining and provisioning cloud resources using code and automation scripts, thus eliminating the need for manual configurations. With frameworks like AWS CloudFormation, AWS CDK (Cloud Development Kit), AWS Serverless Application Model (SAM), Pulumi, and Terraform, users can specify their desired infrastructure state in code, enabling rapid and consistent deployment of resources.However, as with any code, IaC scripts require thorough testing to ensure their correctness and proper functionality. Traditional cloud environments for testing can be expensive, slow, and error-prone due to complexities in provisioning and configuration. With LocalStack, you can leverage a local emulation of various cloud services, such as S3, DynamoDB, EKS, and more!LocalStack simulates these cloud services on a developer's machine, allowing for comprehensive and efficient testing of IaC scripts before deployment to actual cloud environments. In this video, we explain how you can use LocalStack to be more efficient and cost-effective at testing these major IaC frameworks:• Terraform• Pulumi• Cloud Development Kit• CloudFormation• Serverless Application ModelAs organizations will continue to embrace IaC, cloud emulation framework like LocalStack will play an increasingly vital role in ensuring the quality and robustness of cloud infrastructure implementations.

Watch recording
Watch recording
Getting started with LocalStack's Extension for Docker Desktop

LocalStack's Docker Extension allows developers to manage and run cloud applications locally within Docker Desktop efficiently. With a fully-integrated experience with features such as configuration profiles, container logs, and more, developers can now easily manage their LocalStack instance.In this video, Harsh from LocalStack discusses the LocalStack Docker Extension and how you can capitalize on an intuitive user experience to manage your LocalStack image, configuration profiles, and container logs directly within the Docker Desktop.

Watch recording
Watch recording

Launch yourself in the world of local cloud development

Try for free
Try for free
Talk to Sales
Talk to Sales