mock provider

A fake version of a provider, declared with mock_provider in a test file, that returns made-up values instead of calling a real API.

In more detail

Added in Terraform 1.7, it lets tests run without cloud credentials, cost or waiting. Mocks check your module's logic, not whether the real service would accept the values, so keep a few tests against real infrastructure too.

Example

mock_provider "aws" {}

Related terms

Taught in

References