Resource Blocks

Resource Blocks #

Everything you can set is defined as a Resource Block. Resource blocks have the following format.

resource "resource_type" "resource_name" {
    ensure = "present"
    ... other key = value entries ...

For resources that are identified using a single string (logins, Agent Operators, Databases, etc.), the resource_name is often used to identify the resource. It can be overridden using the appropriate attribute. Please see the Resource Block Schema section.

This is an example Resource Block that creates a SQL Server agent operator:

resource "agent_operator" "june" {
    ensure = "present"
    name = "june"
    email_address = ""

A fake sample showing all the data types:

resource "fake_resource" "fake" {
    ensure = "present"
    string_val = "value"
    int_val = 37
    bool_val = true