Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cruxstack/terraform-aws-s3-zip-uploader

Terraform Module to an upload zip to S3 bucket
https://github.com/cruxstack/terraform-aws-s3-zip-uploader

artifact artifacts aws cloudposse s3 s3-bucket sweetops terraform terraform-module utility zip

Last synced: 2 months ago
JSON representation

Terraform Module to an upload zip to S3 bucket

Awesome Lists containing this project

README

        

# Terraform Module: AWS S3 ZIP Uploader

This Terraform module is a utility for uploading the contents of a ZIP file to
an AWS S3 bucket. It's especially useful when you need to manage an unknown
number of files at plan time, a scenario where Terraform's built-in capabilities
fall short.

## Features

- Handles an unknown number of files at plan time by working with ZIP files.
- Uploads a ZIP file from a local path to an S3 bucket.
- Unzips the ZIP file and uploads its contents to an S3 bucket.
- Provides customizable options for bucket names and paths.
- Automatically creates and configures necessary AWS resources.

This module offers a handy solution for deploying static websites, managing
large data sets, and handling other situations where the number of files can't
be determined in advance.

## Usage

```hcl
module "s3_zip_uploader" {
source = "cruxstack/s3-zip-uploader/aws"
version = "x.x.x"

artifact_src_local_path = "/path/to/yourfile.zip"
artifact_dst_bucket_arn = "arn:aws:s3:::yourdestinationbucket"
}
```

## Inputs

In addition to the variables documented below, this module includes several
other optional variables (e.g., `name`, `tags`, etc.) provided by the
`cloudposse/label/null` module. Please refer to its [documentation](https://registry.terraform.io/modules/cloudposse/label/null/latest)
for more details on these variables.

| Name | Description | Type | Default | Required |
|----------------------------|-----------------------------------------------------------------------------------------------------------------|--------|-----------------------------|----------|
| `artifact_src_bucket_arn` | ARN of the S3 bucket to store the source artifact zip file. Defaults to the destination bucket if not provided. | string | `""` | No |
| `artifact_src_bucket_path` | Path in the S3 bucket where the source artifact zip file is located. | string | `"__upload__/artifact.zip"` | No |
| `artifact_src_local_path` | Local path of the artifact zip file where Terraform is executed. | string | N/A | Yes |
| `artifact_dst_bucket_arn` | ARN of the destination S3 bucket to upload the contents of the zip file. | string | N/A | Yes |
| `artifact_dst_bucket_path` | Path in the destination S3 bucket to upload the contents of the zip file. | string | `"/"` | No |

## Outputs

_This module does not currently provide any outputs._

## Contributing

We welcome contributions to this project. For information on setting up a
development environment and how to make a contribution, see [CONTRIBUTING](./CONTRIBUTING.md)
documentation.