github.com/rjeczalik/terraform@v0.6.7-0.20160812060014-e251d5c7bd39/website/source/docs/providers/archive/r/file.html.md (about) 1 --- 2 layout: "archive" 3 page_title: "Archive: archive_file" 4 sidebar_current: "docs-archive-resource-file" 5 description: |- 6 Generates an archive from content, a file, or directory of files. 7 --- 8 9 # archive\_file 10 11 Generates an archive from content, a file, or directory of files. 12 13 ## Example Usage 14 15 ``` 16 resource "archive_file" "init" { 17 template = "${file("${path.module}/init.tpl")}" 18 } 19 ``` 20 21 ## Argument Reference 22 23 The following arguments are supported: 24 25 NOTE: One of `source_content_filename` (with `source_content`), `source_file`, or `source_dir` must be specified. 26 27 * `type` - (required) The type of archive to generate. 28 NOTE: `archive` is supported. 29 30 * `output_path` - (required) The output of the archive file. 31 32 * `source_content` - (optional) Add only this content to the archive with `source_content_filename` as the filename. 33 34 * `source_content_filename` - (optional) Set this as the filename when using `source_content`. 35 36 * `source_file` - (optional) Package this file into the archive. 37 38 * `source_dir` - (optional) Package entire contents of this directory into the archive. 39 40 ## Attributes Reference 41 42 The following attributes are exported: 43 44 * `output_size` - The size of the output archive file. 45 * `output_sha` - The SHA1 checksum of output archive file.