Skip to content

Commit dc10769

Browse files
author
Nikita Dugar
authored
fix labels managedby variables (#5)
* fix labels managedby variables * fix labels managedby variables * fix labels managedby variables
1 parent c315d8b commit dc10769

File tree

4 files changed

+59
-46
lines changed

4 files changed

+59
-46
lines changed

README.md

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<hr>
3939

4040

41-
We eat, drink, sleep and most importantly love **DevOps**. We are working towards stratergies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
41+
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
4242

4343
This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
4444

@@ -61,16 +61,18 @@ This module has a few dependencies:
6161

6262

6363

64+
6465
## Examples
6566

67+
6668
**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-s3/releases).
6769

6870

6971
Here are some examples of how you can use this module in your inventory structure:
7072
### Basic Bucket
7173
```hcl
7274
module "s3_bucket" {
73-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
75+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
7476
name = "secure-bucket"
7577
region = "eu-west-1"
7678
application = "clouddrove"
@@ -84,7 +86,7 @@ module "s3_bucket" {
8486
### Encryption Bucket
8587
```hcl
8688
module "s3_bucket" {
87-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
89+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
8890
name = "encryption-bucket"
8991
region = "eu-west-1"
9092
application = "clouddrove"
@@ -99,7 +101,7 @@ module "s3_bucket" {
99101
### Logging Bucket
100102
```hcl
101103
module "s3_bucket" {
102-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
104+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
103105
name = "logging-bucket"
104106
region = "eu-west-1"
105107
application = "clouddrove"
@@ -115,7 +117,7 @@ module "s3_bucket" {
115117
### Website Host Bucket
116118
```hcl
117119
module "s3_bucket" {
118-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
120+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
119121
name = "website-bucket"
120122
region = "eu-west-1"
121123
application = "clouddrove"
@@ -149,57 +151,61 @@ data "aws_iam_policy_document" "default" {
149151

150152

151153

154+
155+
156+
152157
## Inputs
153158

154159
| Name | Description | Type | Default | Required |
155160
|------|-------------|:----:|:-----:|:-----:|
156-
| acl | Canned ACL to apply to the S3 bucket. | string | `` | no |
157-
| application | Application (e.g. `cd` or `clouddrove`). | string | `` | no |
158-
| attributes | Additional attributes (e.g. `1`). | list | `<list>` | no |
159-
| aws_iam_policy_document | Specifies the number of days after object creation when the object expires. | string | `` | no |
160-
| bucket_enabled | Enable simple S3. | bool | `false` | no |
161-
| bucket_logging_enabled | Enable logging of S3. | bool | `false` | no |
162-
| bucket_policy | Conditionally create S3 bucket policy. | bool | `false` | no |
163-
| create_bucket | Conditionally create S3 bucket. | bool | `true` | no |
164-
| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | string | `-` | no |
165-
| encryption_enabled | Enable encryption of S3. | bool | `false` | no |
166-
| environment | Environment (e.g. `prod`, `dev`, `staging`). | string | `` | no |
167-
| force_destroy | 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. | bool | `false` | no |
168-
| 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 |
169-
| label_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
170-
| lifecycle_days_to_expiration | Specifies the number of days after object creation when the object expires. | number | `365` | no |
171-
| lifecycle_days_to_glacier_transition | Specifies the number of days after object creation when it will be moved to Glacier storage. | number | `180` | no |
172-
| lifecycle_days_to_infrequent_storage_transition | Specifies the number of days after object creation when it will be moved to standard infrequent access storage. | number | `60` | no |
173-
| lifecycle_expiration_enabled | Specifies expiration lifecycle rule status. | bool | `false` | no |
174-
| lifecycle_expiration_object_prefix | Object key prefix identifying one or more objects to which the lifecycle rule applies. | string | `` | no |
175-
| lifecycle_glacier_object_prefix | Object key prefix identifying one or more objects to which the lifecycle rule applies. | string | `` | no |
176-
| lifecycle_glacier_transition_enabled | Specifies Glacier transition lifecycle rule status. | bool | `false` | no |
177-
| lifecycle_infrequent_storage_object_prefix | Object key prefix identifying one or more objects to which the lifecycle rule applies. | string | `` | no |
178-
| lifecycle_infrequent_storage_transition_enabled | Specifies infrequent storage transition lifecycle rule status. | bool | `false` | no |
179-
| name | Name (e.g. `app` or `cluster`). | string | `` | no |
180-
| region | Region Where you want to host S3. | string | `` | no |
181-
| sse_algorithm | The server-side encryption algorithm to use. Valid values are AES256 and aws:kms. | string | `AES256` | no |
182-
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | map | `<map>` | no |
183-
| target_bucket | The name of the bucket that will receive the log objects. | string | `` | no |
184-
| target_prefix | To specify a key prefix for log objects. | string | `` | no |
185-
| versioning | Enable Versioning of S3. | bool | `false` | no |
186-
| website_error | An absolute path to the document to return in case of a 4XX error. | string | `error.html` | no |
187-
| website_hosting_bucket | Enable website hosting of S3. | bool | `false` | no |
188-
| website_index | Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders. | string | `index.html` | no |
161+
| acl | Canned ACL to apply to the S3 bucket. | string | `""` | no |
162+
| application | Application \(e.g. `cd` or `clouddrove`\). | string | `""` | no |
163+
| attributes | Additional attributes \(e.g. `1`\). | list | `<list>` | no |
164+
| aws\_iam\_policy\_document | Specifies the number of days after object creation when the object expires. | string | `""` | no |
165+
| bucket\_enabled | Enable simple S3. | bool | `"false"` | no |
166+
| bucket\_logging\_enabled | Enable logging of S3. | bool | `"false"` | no |
167+
| bucket\_policy | Conditionally create S3 bucket policy. | bool | `"false"` | no |
168+
| create\_bucket | Conditionally create S3 bucket. | bool | `"true"` | no |
169+
| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | string | `"-"` | no |
170+
| encryption\_enabled | Enable encryption of S3. | bool | `"false"` | no |
171+
| environment | Environment \(e.g. `prod`, `dev`, `staging`\). | string | `""` | no |
172+
| force\_destroy | 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. | bool | `"false"` | no |
173+
| 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 |
174+
| label\_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
175+
| lifecycle\_days\_to\_expiration | Specifies the number of days after object creation when the object expires. | number | `"365"` | no |
176+
| lifecycle\_days\_to\_glacier\_transition | Specifies the number of days after object creation when it will be moved to Glacier storage. | number | `"180"` | no |
177+
| lifecycle\_days\_to\_infrequent\_storage\_transition | Specifies the number of days after object creation when it will be moved to standard infrequent access storage. | number | `"60"` | no |
178+
| lifecycle\_expiration\_enabled | Specifies expiration lifecycle rule status. | bool | `"false"` | no |
179+
| lifecycle\_expiration\_object\_prefix | Object key prefix identifying one or more objects to which the lifecycle rule applies. | string | `""` | no |
180+
| lifecycle\_glacier\_object\_prefix | Object key prefix identifying one or more objects to which the lifecycle rule applies. | string | `""` | no |
181+
| lifecycle\_glacier\_transition\_enabled | Specifies Glacier transition lifecycle rule status. | bool | `"false"` | no |
182+
| lifecycle\_infrequent\_storage\_object\_prefix | Object key prefix identifying one or more objects to which the lifecycle rule applies. | string | `""` | no |
183+
| lifecycle\_infrequent\_storage\_transition\_enabled | Specifies infrequent storage transition lifecycle rule status. | bool | `"false"` | no |
184+
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no |
185+
| name | Name \(e.g. `app` or `cluster`\). | string | `""` | no |
186+
| region | Region Where you want to host S3. | string | `""` | no |
187+
| sse\_algorithm | The server-side encryption algorithm to use. Valid values are AES256 and aws:kms. | string | `"AES256"` | no |
188+
| tags | Additional tags \(e.g. map\(`BusinessUnit`,`XYZ`\). | map | `<map>` | no |
189+
| target\_bucket | The name of the bucket that will receive the log objects. | string | `""` | no |
190+
| target\_prefix | To specify a key prefix for log objects. | string | `""` | no |
191+
| versioning | Enable Versioning of S3. | bool | `"false"` | no |
192+
| website\_error | An absolute path to the document to return in case of a 4XX error. | string | `"error.html"` | no |
193+
| website\_hosting\_bucket | Enable website hosting of S3. | bool | `"false"` | no |
194+
| website\_index | Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders. | string | `"index.html"` | no |
189195

190196
## Outputs
191197

192198
| Name | Description |
193199
|------|-------------|
194200
| arn | The ARN of the s3 bucket. |
195-
| bucket_domain_name | The Domain of the s3 bucket. |
201+
| bucket\_domain\_name | The Domain of the s3 bucket. |
196202
| id | The ID of the s3 bucket. |
197203
| tags | A mapping of tags to assign to the resource. |
198204

199205

200206

201-
## Testing
202207

208+
## Testing
203209
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
204210

205211
You need to run the following command in the testing folder:
@@ -212,7 +218,7 @@ You need to run the following command in the testing folder:
212218
## Feedback
213219
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-s3/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).
214220

215-
If you have found it worth your time, go ahead and give us a * on [our GitHub](https://github.com/clouddrove/terraform-aws-s3)!
221+
If you have found it worth your time, go ahead and give us a on [our GitHub](https://github.com/clouddrove/terraform-aws-s3)!
216222

217223
## About us
218224

@@ -227,4 +233,4 @@ At [CloudDrove][website], we offer expert guidance, implementation support and s
227233
[linkedin]: https://cpco.io/linkedin
228234
[twitter]: https://twitter.com/clouddrove/
229235
[email]: https://clouddrove.com/contact-us.html
230-
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=
236+
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=

README.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ usage : |-
3636
### Basic Bucket
3737
```hcl
3838
module "s3_bucket" {
39-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
39+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
4040
name = "secure-bucket"
4141
region = "eu-west-1"
4242
application = "clouddrove"
@@ -50,7 +50,7 @@ usage : |-
5050
### Encryption Bucket
5151
```hcl
5252
module "s3_bucket" {
53-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
53+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
5454
name = "encryption-bucket"
5555
region = "eu-west-1"
5656
application = "clouddrove"
@@ -65,7 +65,7 @@ usage : |-
6565
### Logging Bucket
6666
```hcl
6767
module "s3_bucket" {
68-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
68+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
6969
name = "logging-bucket"
7070
region = "eu-west-1"
7171
application = "clouddrove"
@@ -81,7 +81,7 @@ usage : |-
8181
### Website Host Bucket
8282
```hcl
8383
module "s3_bucket" {
84-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.3"
84+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
8585
name = "website-bucket"
8686
region = "eu-west-1"
8787
application = "clouddrove"

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module "labels" {
1212
name = var.name
1313
application = var.application
1414
environment = var.environment
15+
managedby = var.managedby
1516
label_order = var.label_order
1617
}
1718

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "label_order" {
2424
description = "Label order, e.g. `name`,`application`."
2525
}
2626

27+
variable "managedby" {
28+
type = string
29+
default = "anmol@clouddrove.com"
30+
description = "ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'."
31+
}
32+
2733
variable "attributes" {
2834
type = list
2935
default = []

0 commit comments

Comments
 (0)