Skip to content

Commit a396891

Browse files
author
Sohan Yadav
authored
Merge pull request #11 from clouddrove/CD-201
LGTM
2 parents d706277 + c581855 commit a396891

File tree

10 files changed

+54
-84
lines changed

10 files changed

+54
-84
lines changed

.github/workflows/terraform.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,29 @@ jobs:
7979
env:
8080
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8181

82-
- name: 'Terratest for default-s3'
83-
uses: clouddrove/github-actions@v2.0
84-
with:
85-
actions_subcommand: 'terratest'
86-
tf_actions_working_dir: ./_test/default-s3
87-
env:
88-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
90-
- name: 'Terratest for encryption-s3'
91-
uses: clouddrove/github-actions@v2.0
92-
with:
93-
actions_subcommand: 'terratest'
94-
tf_actions_working_dir: ./_test/encryption-s3
95-
env:
96-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
98-
- name: 'Terratest for website-s3'
99-
uses: clouddrove/github-actions@v2.0
100-
with:
101-
actions_subcommand: 'terratest'
102-
tf_actions_working_dir: ./_test/website-s3
103-
env:
104-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
# - name: 'Terratest for default-s3'
83+
# uses: clouddrove/github-actions@v2.0
84+
# with:
85+
# actions_subcommand: 'terratest'
86+
# tf_actions_working_dir: ./_test/default-s3
87+
# env:
88+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
90+
# - name: 'Terratest for encryption-s3'
91+
# uses: clouddrove/github-actions@v2.0
92+
# with:
93+
# actions_subcommand: 'terratest'
94+
# tf_actions_working_dir: ./_test/encryption-s3
95+
# env:
96+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
98+
# - name: 'Terratest for website-s3'
99+
# uses: clouddrove/github-actions@v2.0
100+
# with:
101+
# actions_subcommand: 'terratest'
102+
# tf_actions_working_dir: ./_test/website-s3
103+
# env:
104+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105105

106106
- name: 'Slack Notification'
107107
uses: clouddrove/action-slack@v2

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Terraform AWS S3
88
</h1>
99

10-
<p align="center" style="font-size: 1.2rem;">
10+
<p align="center" style="font-size: 1.2rem;">
1111
Terraform module to create default S3 bucket with logging and encryption type specific features.
1212
</p>
1313

@@ -38,7 +38,7 @@
3838
<hr>
3939

4040

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.
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

@@ -49,7 +49,7 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c
4949

5050
## Prerequisites
5151

52-
This module has a few dependencies:
52+
This module has a few dependencies:
5353

5454
- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
5555
- [Go](https://golang.org/doc/install)
@@ -72,9 +72,8 @@ Here are some examples of how you can use this module in your inventory structur
7272
### Basic Bucket
7373
```hcl
7474
module "s3_bucket" {
75-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
75+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
7676
name = "secure-bucket"
77-
region = "eu-west-1"
7877
application = "clouddrove"
7978
environment = "test"
8079
label_order = ["environment", "application", "name"]
@@ -86,9 +85,8 @@ module "s3_bucket" {
8685
### Encryption Bucket
8786
```hcl
8887
module "s3_bucket" {
89-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
88+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
9089
name = "encryption-bucket"
91-
region = "eu-west-1"
9290
application = "clouddrove"
9391
environment = "test"
9492
label_order = ["environment", "application", "name"]
@@ -101,9 +99,8 @@ module "s3_bucket" {
10199
### Logging-Encryption Bucket
102100
```hcl
103101
module "s3_bucket" {
104-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
102+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
105103
name = "logging-encryption-bucket"
106-
region = "eu-west-1"
107104
application = "clouddrove"
108105
environment = "test"
109106
label_order = ["environment", "application", "name"]
@@ -118,9 +115,8 @@ module "s3_bucket" {
118115
### Logging Bucket
119116
```hcl
120117
module "s3_bucket" {
121-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
118+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
122119
name = "logging-bucket"
123-
region = "eu-west-1"
124120
application = "clouddrove"
125121
environment = "test"
126122
label_order = ["environment", "application", "name"]
@@ -134,9 +130,8 @@ module "s3_bucket" {
134130
### Website Host Bucket
135131
```hcl
136132
module "s3_bucket" {
137-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
133+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
138134
name = "website-bucket"
139-
region = "eu-west-1"
140135
application = "clouddrove"
141136
environment = "test"
142137
label_order = ["environment", "application", "name"]
@@ -224,7 +219,7 @@ data "aws_iam_policy_document" "default" {
224219

225220

226221
## Testing
227-
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.
222+
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.
228223

229224
You need to run the following command in the testing folder:
230225
```hcl
@@ -233,7 +228,7 @@ You need to run the following command in the testing folder:
233228

234229

235230

236-
## Feedback
231+
## Feedback
237232
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).
238233

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

README.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ usage : |-
3636
### Basic Bucket
3737
```hcl
3838
module "s3_bucket" {
39-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
39+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
4040
name = "secure-bucket"
41-
region = "eu-west-1"
4241
application = "clouddrove"
4342
environment = "test"
4443
label_order = ["environment", "application", "name"]
@@ -50,9 +49,8 @@ usage : |-
5049
### Encryption Bucket
5150
```hcl
5251
module "s3_bucket" {
53-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
52+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
5453
name = "encryption-bucket"
55-
region = "eu-west-1"
5654
application = "clouddrove"
5755
environment = "test"
5856
label_order = ["environment", "application", "name"]
@@ -65,9 +63,8 @@ usage : |-
6563
### Logging-Encryption Bucket
6664
```hcl
6765
module "s3_bucket" {
68-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
66+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
6967
name = "logging-encryption-bucket"
70-
region = "eu-west-1"
7168
application = "clouddrove"
7269
environment = "test"
7370
label_order = ["environment", "application", "name"]
@@ -82,9 +79,8 @@ usage : |-
8279
### Logging Bucket
8380
```hcl
8481
module "s3_bucket" {
85-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
82+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
8683
name = "logging-bucket"
87-
region = "eu-west-1"
8884
application = "clouddrove"
8985
environment = "test"
9086
label_order = ["environment", "application", "name"]
@@ -98,9 +94,8 @@ usage : |-
9894
### Website Host Bucket
9995
```hcl
10096
module "s3_bucket" {
101-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
97+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
10298
name = "website-bucket"
103-
region = "eu-west-1"
10499
application = "clouddrove"
105100
environment = "test"
106101
label_order = ["environment", "application", "name"]

_example/default-s3/example.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ provider "aws" {
55
module "s3_bucket" {
66
source = "./../../"
77

8-
name = "secure-bucket"
9-
application = "clouddrove"
10-
environment = "test"
11-
label_order = ["environment", "application", "name"]
12-
13-
region = "eu-west-1"
8+
name = "secure-bucket"
9+
application = "clouddrove"
10+
environment = "test"
11+
label_order = ["environment", "application", "name"]
1412
versioning = true
1513
acl = "private"
1614
bucket_enabled = true

_example/encryption-s3/example.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ data "aws_iam_policy_document" "default" {
3333
module "s3_bucket" {
3434
source = "./../../"
3535

36-
name = "encryption-bucket"
37-
application = "clouddrove"
38-
environment = "test"
39-
label_order = ["environment", "application", "name"]
40-
41-
region = "eu-west-1"
36+
name = "encryption-bucket"
37+
application = "clouddrove"
38+
environment = "test"
39+
label_order = ["environment", "application", "name"]
4240
versioning = true
4341
acl = "private"
4442
bucket_encryption_enabled = true

_example/logging-encryption-s3/example.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ provider "aws" {
55
module "s3_bucket" {
66
source = "./../../"
77

8-
name = "logging-encryption-bucket"
9-
application = "clouddrove"
10-
environment = "test"
11-
label_order = ["environment", "application", "name"]
12-
13-
region = "eu-west-1"
8+
name = "logging-encryption-bucket"
9+
application = "clouddrove"
10+
environment = "test"
11+
label_order = ["environment", "application", "name"]
1412
versioning = true
1513
acl = "private"
1614
bucket_logging_encryption_enabled = true

_example/logging-s3/example.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ provider "aws" {
55
module "s3_bucket" {
66
source = "./../../"
77

8-
name = "logging-bucket"
9-
application = "clouddrove"
10-
environment = "test"
11-
label_order = ["environment", "application", "name"]
12-
13-
region = "eu-west-1"
8+
name = "logging-bucket"
9+
application = "clouddrove"
10+
environment = "test"
11+
label_order = ["environment", "application", "name"]
1412
versioning = true
1513
acl = "private"
1614
bucket_logging_enabled = true

_example/website-s3/example.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module "s3_bucket" {
1010
environment = "test"
1111
label_order = ["environment", "application", "name"]
1212

13-
region = "eu-west-1"
1413
versioning = true
1514
acl = "private"
1615
website_hosting_bucket = true

main.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ resource "aws_s3_bucket" "s3_default" {
2424

2525
bucket = module.labels.id
2626
force_destroy = var.force_destroy
27-
region = var.region
2827
acl = var.acl
2928

3029
versioning {
@@ -87,7 +86,6 @@ resource "aws_s3_bucket" "s3_website" {
8786

8887
bucket = module.labels.id
8988
force_destroy = var.force_destroy
90-
region = var.region
9189
acl = var.acl
9290

9391
versioning {
@@ -155,7 +153,6 @@ resource "aws_s3_bucket" "s3_logging" {
155153

156154
bucket = module.labels.id
157155
force_destroy = var.force_destroy
158-
region = var.region
159156
acl = var.acl
160157

161158
versioning {
@@ -212,7 +209,6 @@ resource "aws_s3_bucket" "s3_logging_encryption" {
212209

213210
bucket = module.labels.id
214211
force_destroy = var.force_destroy
215-
region = var.region
216212
acl = var.acl
217213

218214
versioning {
@@ -298,7 +294,6 @@ resource "aws_s3_bucket" "s3_encryption" {
298294

299295
bucket = module.labels.id
300296
force_destroy = var.force_destroy
301-
region = var.region
302297
acl = var.acl
303298

304299
versioning {

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ variable "versioning" {
6262
description = "Enable Versioning of S3."
6363
}
6464

65-
variable "region" {
66-
type = string
67-
default = ""
68-
description = "Region Where you want to host S3."
69-
}
70-
7165
variable "acl" {
7266
type = string
7367
default = ""

0 commit comments

Comments
 (0)