-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72d2fab
commit 3af7ace
Showing
7 changed files
with
289 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ | |
.terraform | ||
.idea | ||
*.iml | ||
|
||
.build-harness | ||
build-harness |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
SHELL := /bin/bash | ||
|
||
# List of targets the `readme` target should call before generating the readme | ||
export README_DEPS ?= docs/targets.md docs/terraform.md | ||
|
||
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness) | ||
|
||
## Lint terraform code | ||
lint: | ||
$(SELF) terraform:install terraform:get-modules terraform:get-plugins terraform:lint terraform:validate | ||
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
# terraform-aws-s3-log-storage [![Build Status](https://travis-ci.org/cloudposse/terraform-aws-s3-log-storage.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-aws-s3-log-storage) | ||
<!-- This file was automatically generated by the `build-harness`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. --> | ||
|
||
[![Cloud Posse](https://cloudposse.com/logo-300x69.svg)](https://cloudposse.com) | ||
|
||
# terraform-aws-s3-log-storage [![Build Status](https://travis-ci.org/cloudposse/terraform-aws-s3-log-storage.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-aws-s3-log-storage) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-s3-log-storage.svg)](https://github.com/cloudposse/terraform-aws-s3-log-storage/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) | ||
|
||
|
||
This module creates an S3 bucket suitable for receiving logs from other `AWS` services such as `S3`, `CloudFront`, and `CloudTrails`. | ||
|
||
|
@@ -9,6 +14,22 @@ It enables server-side default encryption. | |
https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html | ||
|
||
|
||
--- | ||
|
||
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps. | ||
|
||
|
||
It's 100% Open Source and licensed under the [APACHE2](LICENSE). | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Usage | ||
|
||
```hcl | ||
|
@@ -26,47 +47,95 @@ module "log_storage" { | |
``` | ||
|
||
|
||
## Variables | ||
| Name | Default | Description | Required | | ||
|:------------------------------------|:-------------------:|:---------------------------------------------------------------------------------------------------|:--------:| | ||
| `namespace` | `` | Namespace (e.g. `cp` or `cloudposse`) | Yes | | ||
| `stage` | `` | Stage (e.g. `prod`, `dev`, `staging`) | Yes | | ||
| `name` | `` | Name (e.g. `log`) | Yes | | ||
| `attributes` | `[]` | Additional attributes (e.g. `policy` or `role`) | No | | ||
| `tags` | `{}` | Additional tags (e.g. `map("BusinessUnit","XYZ")` | No | | ||
| `acl` | `log-delivery-write`| The canned ACL to apply | No | | ||
| `policy` | `` | A valid bucket policy JSON document | No | | ||
| `prefix` | `` | Object key prefix identifying one or more objects to which the lifecycle rule applies | No | | ||
| `region` | `` | If specified, the AWS region this bucket should reside in. Defaults to region of callee. | No | | ||
| `force_destroy` | `` | All objects will be forcefully deleted from the bucket when bucket destroyed | No | | ||
| `lifecycle_rule_enabled` | `true` | Enable object lifecycle rules on this bucket | No | | ||
| `versioning_enabled` | `false` | Versioning is a means of keeping multiple variants of an object in the same bucket | No | | ||
| `noncurrent_version_transition_days`| `30` | Number of days to persist in the standard storage tier before moving to the glacier tier | No | | ||
| `noncurrent_version_expiration_days`| `90` | Specifies when noncurrent object versions expire | No | | ||
| `standard_transition_days` | `30` | Number of days to persist in the standard storage tier before moving to the infrequent access tier | No | | ||
| `glacier_transition_days` | `60` | Number of days after which to move the data to the glacier storage tier | No | | ||
| `expiration_days` | `90` | Number of days after which to expunge the objects | No | | ||
| `sse_algorithm` | `AES256` | The server-side encryption algorithm to use. Valid values are `AES256` and `aws:kms` | No | | ||
| `kms_master_key_id` | `` | The AWS KMS master key ID used for the SSE-KMS encryption. This can only be used when you set the value of `sse_algorithm` as `aws:kms`. The default AWS/S3 AWS KMS master key is used if this element is absent while the sse_algorithm is `aws:kms` | No | | ||
|
||
|
||
|
||
|
||
## Makefile Targets | ||
``` | ||
Available targets: | ||
help This help screen | ||
help/all Display help for all targets | ||
lint Lint terraform code | ||
``` | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| acl | (Optional) The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services | string | `log-delivery-write` | no | | ||
| attributes | Additional attributes (e.g. `policy` or `role`) | list | `<list>` | no | | ||
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no | | ||
| expiration_days | Number of days after which to expunge the objects | string | `90` | no | | ||
| force_destroy | (Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. | string | `false` | no | | ||
| glacier_transition_days | Number of days after which to move the data to the glacier storage tier | string | `60` | no | | ||
| kms_master_key_id | The AWS KMS master key ID used for the SSE-KMS encryption. This can only be used when you set the value of sse_algorithm as aws:kms. The default aws/s3 AWS KMS master key is used if this element is absent while the sse_algorithm is aws:kms | string | `` | no | | ||
| lifecycle_rule_enabled | (Optional) enable lifecycle events on this bucket | string | `true` | no | | ||
| name | Name (e.g. `app` or `db`) | string | - | yes | | ||
| namespace | Namespace (e.g. `cp` or `cloudposse`) | string | - | yes | | ||
| noncurrent_version_expiration_days | (Optional) Specifies when noncurrent object versions expire. | string | `90` | no | | ||
| noncurrent_version_transition_days | (Optional) Specifies when noncurrent object versions transitions | string | `30` | no | | ||
| policy | A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. | string | `` | no | | ||
| prefix | (Optional) Key prefix. Used to manage object lifecycle events. | string | `` | no | | ||
| region | (Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee. | string | `` | no | | ||
| sse_algorithm | The server-side encryption algorithm to use. Valid values are AES256 and aws:kms | string | `AES256` | no | | ||
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes | | ||
| standard_transition_days | Number of days to persist in the standard storage tier before moving to the infrequent access tier | string | `30` | no | | ||
| tags | Additional tags (e.g. map('BusinessUnit`,`XYZ`) | map | `<map>` | no | | ||
| versioning_enabled | (Optional) A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket. | string | `false` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|:----------------------|:--------------------------------------| | ||
| `bucket_domain_name` | FQDN of bucket | | ||
| `bucket_id` | Bucket Name (aka ID) | | ||
| `bucket_arn` | Bucket ARN | | ||
| `prefix` | Prefix configured for lifecycle rules | | ||
| Name | Description | | ||
|------|-------------| | ||
| bucket_arn | Bucket ARN | | ||
| bucket_domain_name | FQDN of bucket | | ||
| bucket_id | Bucket Name (aka ID) | | ||
| prefix | Prefix configured for lifecycle rules | | ||
|
||
|
||
|
||
|
||
## Related Projects | ||
|
||
Check out these related projects. | ||
|
||
- [terraform-aws-cloudfront-s3-cdn](https://github.com/cloudposse/terraform-aws-cloudfront-s3-cdn) - Terraform module to easily provision CloudFront CDN backed by an S3 origin | ||
- [terraform-aws-s3-website](https://github.com/cloudposse/terraform-aws-s3-website) - Terraform Module for Creating S3 backed Websites and Route53 DNS | ||
- [terraform-aws-user-data-s3-backend](https://github.com/cloudposse/terraform-aws-user-data-s3-backend) - Terraform Module to Offload User Data to S3 | ||
- [terraform-aws-s3-logs-athena-query](https://github.com/cloudposse/terraform-aws-s3-logs-athena-query) - A Terraform module that creates an Athena Database and Structure for querying S3 access logs | ||
- [terraform-aws-lb-s3-bucket](https://github.com/cloudposse/terraform-aws-lb-s3-bucket) - Terraform module to provision an S3 bucket with built in IAM policy to allow AWS Load Balancers to ship access logs | ||
|
||
|
||
|
||
## Help | ||
|
||
**Got a question?** | ||
|
||
File a GitHub [issue](https://github.com/cloudposse/terraform-aws-s3-log-storage/issues), send us an [email](mailto:[email protected]) or reach out to us on [Gitter](https://gitter.im/cloudposse/). | ||
File a GitHub [issue](https://github.com/cloudposse/terraform-aws-s3-log-storage/issues), send us an [email][email] or join our [Slack Community][slack]. | ||
|
||
## Commerical Support | ||
|
||
Work directly with our team of DevOps experts via email, slack, and video conferencing. | ||
|
||
We provide *commercial support* for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a fulltime engineer. | ||
|
||
[![E-Mail](https://img.shields.io/badge/[email protected])](mailto:[email protected]) | ||
|
||
- **Questions.** We'll use a Shared Slack channel between your team and ours. | ||
- **Troubleshooting.** We'll help you triage why things aren't working. | ||
- **Code Reviews.** We'll review your Pull Requests and provide constructive feedback. | ||
- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects. | ||
- **Build New Terraform Modules.** We'll develop original modules to provision infrastructure. | ||
- **Cloud Architecture.** We'll assist with your cloud strategy and design. | ||
- **Implementation.** We'll provide hands on support to implement our reference architectures. | ||
|
||
|
||
## Community Forum | ||
|
||
Get access to our [Open Source Community Forum][slack] on Slack. It's **FREE** to join for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build *sweet* infrastructure. | ||
|
||
## Contributing | ||
|
||
|
@@ -76,22 +145,28 @@ Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-s3-lo | |
|
||
### Developing | ||
|
||
If you are interested in being a contributor and want to get involved in developing `terraform-aws-s3-log-storage`, we would love to hear from you! Shoot us an [email](mailto:[email protected]). | ||
If you are interested in being a contributor and want to get involved in developing this project or [help out](https://github.com/orgs/cloudposse/projects/3) with our other projects, we would love to hear from you! Shoot us an [email](mailto:[email protected]). | ||
|
||
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. | ||
|
||
1. **Fork** the repo on GitHub | ||
2. **Clone** the project to your own machine | ||
3. **Commit** changes to your own branch | ||
4. **Push** your work back up to your fork | ||
5. Submit a **Pull request** so that we can review your changes | ||
5. Submit a **Pull Request** so that we can review your changes | ||
|
||
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request! | ||
|
||
|
||
## Copyright | ||
|
||
**NOTE:** Be sure to merge the latest from "upstream" before making a pull request! | ||
Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com) | ||
|
||
|
||
## License | ||
|
||
[APACHE 2.0](LICENSE) © 2018 [Cloud Posse, LLC](https://cloudposse.com) | ||
## License | ||
|
||
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | ||
|
||
See [LICENSE](LICENSE) for full details. | ||
|
||
|
@@ -103,7 +178,7 @@ See [LICENSE](LICENSE) for full details. | |
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
|
@@ -113,31 +188,50 @@ See [LICENSE](LICENSE) for full details. | |
under the License. | ||
|
||
|
||
## About | ||
|
||
`terraform-aws-s3-log-storage` is maintained and funded by [Cloud Posse, LLC][website]. | ||
|
||
![Cloud Posse](https://cloudposse.com/logo-300x69.png) | ||
|
||
|
||
Like it? Please let us know at <[email protected]> | ||
|
||
We love [Open Source Software](https://github.com/cloudposse/)! | ||
|
||
See [our other projects][community] | ||
or [hire us][hire] to help build your next cloud platform. | ||
|
||
## Trademarks | ||
|
||
All other trademarks referenced herein are the property of their respective owners. | ||
|
||
## About | ||
|
||
This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know at <[email protected]> | ||
|
||
[![Cloud Posse](https://cloudposse.com/logo-300x69.svg)](https://cloudposse.com) | ||
|
||
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We love [Open Source Software](https://github.com/cloudposse/)! | ||
|
||
We offer paid support on all of our projects. | ||
|
||
Check out [our other projects][github], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation. | ||
|
||
[docs]: https://docs.cloudposse.com/ | ||
[website]: https://cloudposse.com/ | ||
[community]: https://github.com/cloudposse/ | ||
[github]: https://github.com/cloudposse/ | ||
[jobs]: https://cloudposse.com/jobs/ | ||
[hire]: https://cloudposse.com/contact/ | ||
[slack]: https://slack.cloudposse.com/ | ||
[linkedin]: https://www.linkedin.com/company/cloudposse | ||
[twitter]: https://twitter.com/cloudposse/ | ||
[email]: mailto:[email protected] | ||
|
||
|
||
### Contributors | ||
|
||
| [![Erik Osterman][erik_img]][erik_web]<br/>[Erik Osterman][erik_web] | [![Andriy Knysh][andriy_img]][andriy_web]<br/>[Andriy Knysh][andriy_web] | | ||
|-------------------------------------------------------|------------------------------------------------------------------| | ||
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] | | ||
|---|---|---| | ||
|
||
[osterman_homepage]: https://github.com/osterman | ||
[osterman_avatar]: https://github.com/osterman.png?size=150 | ||
[aknysh_homepage]: https://github.com/aknysh | ||
[aknysh_avatar]: https://github.com/aknysh.png?size=150 | ||
[SweetOps_homepage]: https://github.com/SweetOps | ||
[SweetOps_avatar]: https://github.com/SweetOps.png?size=150 | ||
|
||
|
||
[erik_img]: http://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144 | ||
[erik_web]: https://github.com/osterman/ | ||
[andriy_img]: https://avatars0.githubusercontent.com/u/7356997?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 | ||
[andriy_web]: https://github.com/aknysh/ |
Oops, something went wrong.