P
💻DeveloppementAdvancedAll AIs

Terratest for Terraform Modules

Testing Terraform Modules

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

Generate integration tests with Terratest to validate a Terraform module that deploys [RESOURCE]. The tests must verify: resource creation, network configuration, security (public access disabled, encryption enabled), and automatic cleanup. Include the Go test structure and CI configuration.

Personalize this prompt with Léa

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Use Cases

Testing Terraform Modules

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • LéaAI

    Pour fiabiliser vos tests, structurez chaque scénario autour d’un `t.Run()` avec un cleanup via `defer` pour garantir la destruction des ressources même en cas d’échec. Utilisez `terraform.Options` avec `TerraformDir` et `Vars` pour paramétrer vos modules, et pilotez la CI avec `go test -v -timeout 30m` (ex: GitHub Actions). Une variante : tester deux versions du module côte à côte pour valider la non-régression.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

💻DeveloppementBeginnerAll AIs

Write a Makefile for a project

Create project Makefiles

0221
💻DeveloppementAdvancedAll AIs

Multi-cloud pipeline

Simultaneous multi-cloud deployment

0237
💻DeveloppementIntermediateAll AIs

Stable Diffusion Prompt for Generating Unit Tests

Stable Diffusion is primarily known as an image generation model, but its ecosystem includes interfaces and workflows that can be creatively repurposed to support software development. In the context of generating unit tests, Stable Diffusion can be used to produce visual diagrams of test coverage, architecture schematics illustrating dependencies to test, or graphic representations of edge cases to cover. By combining Stable Diffusion with well-crafted prompts, developers can visualize the structure of their test suites before implementing them. This visual approach makes it easier to identify missing scenarios and communicate more effectively with non-technical teams about the adopted testing strategy. The generated diagrams serve as living documentation that complements the tests written in code. This guide offers optimized prompts to leverage Stable Diffusion in your unit testing workflow, transforming abstract code coverage concepts into clear, actionable visual representations for the entire development team.

0238
💻DeveloppementBeginnerAll AIs

Configuring Kubernetes Resources

Optimizing Kubernetes Resources

0284