github.com/bengesoff/terraform@v0.3.1-0.20141018223233-b25a53629922/website/source/docs/provisioners/connection.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Provisioner Connections" 4 sidebar_current: "docs-provisioners-connection" 5 --- 6 7 # Provisioner Connections 8 9 Many provisioners require access to the remote resource. For example, 10 a provisioner may need to use ssh to connect to the resource. 11 12 Terraform uses a number of defaults when connecting to a resource, but these 13 can be overridden using `connection` block in either a `resource` or `provisioner`. 14 Any `connection` information provided in a `resource` will apply to all the 15 provisioners, but it can be scoped to a single provisioner as well. One use case 16 is to have an initial provisioner connect as root to setup user accounts, and have 17 subsequent provisioners connect as a user with more limited permissions. 18 19 ## Example usage 20 21 ``` 22 # Copies the file as the root user using a password 23 provisioner "file" { 24 source = "conf/myapp.conf" 25 destination = "/etc/myapp.conf" 26 connection { 27 user = "root" 28 password = "${var.root_password}" 29 } 30 } 31 ``` 32 33 ## Argument Reference 34 35 The following arguments are supported: 36 37 * `type` - The connection type that should be used. This defaults to "ssh". The type 38 of connection supported depends on the provisioner. 39 40 * `user` - The user that we should use for the connection. This defaults to "root". 41 42 * `password` - The password we should use for the connection. 43 44 * `key_file` - The SSH key to use for the connection. This takes preference over the 45 password if provided. 46 47 * `host` - The address of the resource to connect to. This is provided by the provider. 48 49 * `port` - The port to connect to. This defaults to 22. 50 51 * `timeout` - The timeout to wait for the connection to become available. This defaults 52 to 5 minutes. Should be provided as a string like "30s" or "5m". 53