archive_file (Data Source)

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

Example Usage

# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.archive.data_archive_file import DataArchiveFile
class MyConvertedCode(TerraformStack):
    def __init__(self, scope, name):
        super().__init__(scope, name)
        DataArchiveFile(self, "init",
            output_path="${path.module}/files/init.zip",
            source_file="${path.module}/init.tpl",
            type="zip"
        )
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import Token, TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.archive.data_archive_file import DataArchiveFile
class MyConvertedCode(TerraformStack):
    def __init__(self, scope, name):
        super().__init__(scope, name)
        DataArchiveFile(self, "dotfiles",
            excludes=["${path.module}/unwanted.zip"],
            output_path="${path.module}/files/dotfiles.zip",
            source=[DataArchiveFileSource(
                content=Token.as_string(vimrc.rendered),
                filename=".vimrc"
            ), DataArchiveFileSource(
                content=Token.as_string(ssh_config.rendered),
                filename=".ssh/config"
            )
            ],
            type="zip"
        )
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.archive.data_archive_file import DataArchiveFile
class MyConvertedCode(TerraformStack):
    def __init__(self, scope, name):
        super().__init__(scope, name)
        DataArchiveFile(self, "lambda_my_function",
            output_file_mode="0666",
            output_path="${path.module}/files/lambda-my-function.js.zip",
            source_file="${path.module}/../lambda/my-function/index.js",
            type="zip"
        )

Schema

Required

Optional

Read-Only

Nested Schema for source

Required: