Skip to content

dhoppeIT/terraform-local-file

Repository files navigation

terraform-local-file

Terraform module to manage the following resources:

  • local_file

Usage

Copy and paste the following code snippet to your Terraform configuration, specify the required variables and run the command terraform init.

module "local_file" {
  source  = "gitlab.com/terraform-child-modules-48151/terraform-local-file/local"
  version = "1.0.0"

  filename = "/tmp/example/file"

  content              = "example-text"
  directory_permission = "0755"
  file_permission      = "0644"
}

Requirements

Name Version
terraform >= 1.0
local ~> 2.0

Providers

Name Version
local ~> 2.0

Modules

No modules.

Resources

Name Type
local_file.this resource

Inputs

Name Description Type Default Required
content Content to store in the file, expected to be a UTF-8 encoded string string null no
content_base64 Content to store in the file, expected to be binary encoded as base64 string string null no
directory_permission Permissions to set for directories created string "0777" no
file_permission Permissions to set for the output file string "0777" no
filename The path to the file that will be created string n/a yes

Outputs

Name Description
content_base64sha256 Base64 encoded SHA256 checksum of file content
content_base64sha512 Base64 encoded SHA512 checksum of file content
content_md5 MD5 checksum of file content
content_sha1 SHA1 checksum of file content
content_sha256 SHA256 checksum of file content
content_sha512 SHA512 checksum of file content
id The hexadecimal encoding of the SHA1 checksum of the file content

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.