FEATURES PRICING ABOUT DOCS LOGIN

Chef Provisioner

The chef provisioner installs, configures and runs the Chef Client on a remote resource. The chef provisioner supports both ssh and winrm type connections.

Requirements

The chef provisioner has some prerequisites for specific connection types:

Without these prerequisites, your provisioning execution will fail.

Example usage

# Start a initial chef run on a resource
resource "aws_instance" "web" {
    ...
    provisioner "chef"  {
        attributes_json = <<-EOF
        {
            "key": "value",
            "app": {
                "cluster1": {
                    "nodes": [
                        "webserver1",
                        "webserver2"
                    ]
                }
            }
        }
        EOF
        environment = "_default"
        run_list = ["cookbook::recipe"]
        node_name = "webserver1"
        secret_key = "${file("../encrypted_data_bag_secret")}"
        server_url = "https://chef.company.com/organizations/org1"
        recreate_client = true
        user_name = "bork"
        user_key = "${file("../bork.pem")}"
        version = "12.4.1"
    }
}

Argument Reference

The following arguments are supported:

These options are supported for backwards compatibility and may be removed in a future version:


See the source of this document at Terraform.io

REQUEST A DEMO