terraform/website/source/docs/providers/archive/r/file.html.md

1.2 KiB

layout page_title sidebar_current description
archive Archive: archive_file docs-archive-resource-file Generates an archive from content, a file, or directory of files.

archive_file

Generates an archive from content, a file, or directory of files.

Example Usage

resource "archive_file" "init" {
    template = "${file("${path.module}/init.tpl")}"
}

Argument Reference

The following arguments are supported:

NOTE: One of source_content_filename (with source_content), source_file, or source_dir must be specified.

  • type - (required) The type of archive to generate. NOTE: archive is supported.

  • output_path - (required) The output of the archive file.

  • source_content - (optional) Add only this content to the archive with source_content_filename as the filename.

  • source_content_filename - (optional) Set this as the filename when using source_content.

  • source_file - (optional) Package this file into the archive.

  • source_dir - (optional) Package entire contents of this directory into the archive.

Attributes Reference

The following attributes are exported:

  • output_size - The size of the output archive file.
  • output_sha - The SHA1 checksum of output archive file.