declarative

A style where you describe the end result you want and let the tool work out the steps to get there.

In more detail

A declarative file says what should exist, not how to build it. The tool compares that description with reality and acts only where they differ, so running it twice does nothing the second time. The opposite style, imperative, lists steps to run in order.

Example

In Terraform: A declarative file says what should exist, not how to build it. The tool compares that description with the real world and plans only the changes that are missing, so running it twice does nothing the second time. Terraform configuration is declarative; a shell script is the opposite, imperative, style.

Related terms

Taught in

References

Certification courses