This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
forked from clouddrove/terraform-aws-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
114 lines (107 loc) · 3.68 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name : Terraform AWS S3
# License of this project
license: "MIT"
# Canonical GitHub repo
github_repo: clouddrove/terraform-aws-s3
# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v0.12-green"
url: "https://www.terraform.io"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
url: "LICENSE.md"
# description of this project
description: |-
Terraform module to create default S3 bucket with logging and encryption type specific features.
# extra content
include:
- "terraform.md"
# How to use this project
usage : |-
Here are some examples of how you can use this module in your inventory structure:
### Basic Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
name = "secure-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
bucket_enabled = true
}
```
### Encryption Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
name = "encryption-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
encryption_enabled = true
sse_algorithm = "AES256"
}
```
### Logging Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
name = "logging-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
bucket_logging_enabled = true
target_bucket = "bucket-logs12"
target_prefix = "logs"
}
```
### Website Host Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
name = "website-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
website_hosting_bucket = true
website_index = "index.html"
website_error = "error.html"
bucket_policy = true
lifecycle_expiration_enabled = true
lifecycle_expiration_object_prefix = "test"
lifecycle_days_to_expiration = 10
aws_iam_policy_document = data.aws_iam_policy_document.default.json
}
data "aws_iam_policy_document" "default" {
version = "2012-10-17"
statement {
sid = "Stmt1447315805704"
effect = "Allow"
principals {
type = "AWS"
identifiers = ["*"]
}
actions = ["s3:GetObject"]
resources = ["arn:aws:s3:::test-website-bucket-clouddrove/*"]
}
}
```