github.com/jmbataller/terraform@v0.6.8-0.20151125192640-b7a12e3a580c/website/source/docs/commands/init.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: init"
     4  sidebar_current: "docs-commands-init"
     5  description: |-
     6    The `terraform init` command is used to initialize a Terraform configuration using another module as a skeleton.
     7  ---
     8  
     9  # Command: init
    10  
    11  The `terraform init` command is used to initialize a Terraform configuration
    12  using another
    13  [module](/docs/modules/index.html)
    14  as a skeleton.
    15  
    16  ## Usage
    17  
    18  Usage: `terraform init [options] SOURCE [DIR]`
    19  
    20  Init will download the module from SOURCE and copy it into the DIR
    21  (which defaults to the current working directory). Version control
    22  information from the module (such as Git history) will not be copied.
    23  
    24  The directory being initialized must be empty of all Terraform configurations.
    25  If the module has other files which conflict with what is already in the
    26  directory, they _will be overwritten_.
    27  
    28  The command-line options available are a subset of the ones for the
    29  [remote command](/docs/commands/remote.html), and are used to initialize
    30  a remote state configuration if provided.
    31  
    32  The command-line flags are all optional. The list of available flags are:
    33  
    34  * `-backend=atlas` - Specifies the type of remote backend. Must be one
    35    of Atlas, Consul, S3, or HTTP. Defaults to Atlas.
    36  
    37  * `-backend-config="k=v"` - Specify a configuration variable for a backend. This is how you set the required variables for the selected backend (as detailed in the [remote command documentation](/docs/command/remote.html).
    38  
    39  
    40  ## Example: Consul
    41  
    42  This example will initialize the current directory and configure Consul remote storage:
    43  
    44  ```
    45  $ terraform init \
    46      -backend=consul \
    47      -backend-config="address=your.consul.endpoint:443" \
    48      -backend-config="scheme=https" \
    49      -backend-config="path=tf/path/for/project" \
    50      /path/to/source/module
    51  ```
    52  
    53  ## Example: S3
    54  
    55  This example will initialize the current directory and configure S3 remote storage:
    56  
    57  ```
    58  $ terraform init \
    59      -backend=s3 \
    60      -backend-config="bucket=your-s3-bucket" \
    61      -backend-config="key=tf/path/for/project.json" \
    62      -backend-config="acl=bucket-owner-full-control" \
    63      /path/to/source/module
    64  ```