Skip to content

Commit

Permalink
Merge pull request #11 from clouddrove/CD-201
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
Sohan Yadav authored Aug 11, 2020
2 parents d706277 + c581855 commit a396891
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 84 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,29 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest for default-s3'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test/default-s3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest for encryption-s3'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test/encryption-s3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest for website-s3'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test/website-s3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: 'Terratest for default-s3'
# uses: clouddrove/[email protected]
# with:
# actions_subcommand: 'terratest'
# tf_actions_working_dir: ./_test/default-s3
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: 'Terratest for encryption-s3'
# uses: clouddrove/[email protected]
# with:
# actions_subcommand: 'terratest'
# tf_actions_working_dir: ./_test/encryption-s3
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: 'Terratest for website-s3'
# uses: clouddrove/[email protected]
# with:
# actions_subcommand: 'terratest'
# tf_actions_working_dir: ./_test/website-s3
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
Expand Down
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Terraform AWS S3
</h1>

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

Expand Down Expand Up @@ -38,7 +38,7 @@
<hr>


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

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.

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

## Prerequisites

This module has a few dependencies:
This module has a few dependencies:

- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Go](https://golang.org/doc/install)
Expand All @@ -72,9 +72,8 @@ Here are some examples of how you can use this module in your inventory structur
### Basic Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "secure-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -86,9 +85,8 @@ module "s3_bucket" {
### Encryption Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "encryption-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -101,9 +99,8 @@ module "s3_bucket" {
### Logging-Encryption Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "logging-encryption-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -118,9 +115,8 @@ module "s3_bucket" {
### Logging Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "logging-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -134,9 +130,8 @@ module "s3_bucket" {
### Website Host Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "website-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand Down Expand Up @@ -224,7 +219,7 @@ data "aws_iam_policy_document" "default" {


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

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



## Feedback
## Feedback
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 [[email protected]](mailto:[email protected]).

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-s3)!
Expand Down
15 changes: 5 additions & 10 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ usage : |-
### Basic Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "secure-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -50,9 +49,8 @@ usage : |-
### Encryption Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "encryption-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -65,9 +63,8 @@ usage : |-
### Logging-Encryption Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "logging-encryption-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -82,9 +79,8 @@ usage : |-
### Logging Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "logging-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand All @@ -98,9 +94,8 @@ usage : |-
### Website Host Bucket
```hcl
module "s3_bucket" {
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.5"
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.7"
name = "website-bucket"
region = "eu-west-1"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
Expand Down
10 changes: 4 additions & 6 deletions _example/default-s3/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ provider "aws" {
module "s3_bucket" {
source = "./../../"

name = "secure-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]

region = "eu-west-1"
name = "secure-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
bucket_enabled = true
Expand Down
10 changes: 4 additions & 6 deletions _example/encryption-s3/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ data "aws_iam_policy_document" "default" {
module "s3_bucket" {
source = "./../../"

name = "encryption-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]

region = "eu-west-1"
name = "encryption-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
bucket_encryption_enabled = true
Expand Down
10 changes: 4 additions & 6 deletions _example/logging-encryption-s3/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ provider "aws" {
module "s3_bucket" {
source = "./../../"

name = "logging-encryption-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]

region = "eu-west-1"
name = "logging-encryption-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
bucket_logging_encryption_enabled = true
Expand Down
10 changes: 4 additions & 6 deletions _example/logging-s3/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ provider "aws" {
module "s3_bucket" {
source = "./../../"

name = "logging-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]

region = "eu-west-1"
name = "logging-bucket"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
versioning = true
acl = "private"
bucket_logging_enabled = true
Expand Down
1 change: 0 additions & 1 deletion _example/website-s3/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module "s3_bucket" {
environment = "test"
label_order = ["environment", "application", "name"]

region = "eu-west-1"
versioning = true
acl = "private"
website_hosting_bucket = true
Expand Down
5 changes: 0 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ resource "aws_s3_bucket" "s3_default" {

bucket = module.labels.id
force_destroy = var.force_destroy
region = var.region
acl = var.acl

versioning {
Expand Down Expand Up @@ -87,7 +86,6 @@ resource "aws_s3_bucket" "s3_website" {

bucket = module.labels.id
force_destroy = var.force_destroy
region = var.region
acl = var.acl

versioning {
Expand Down Expand Up @@ -155,7 +153,6 @@ resource "aws_s3_bucket" "s3_logging" {

bucket = module.labels.id
force_destroy = var.force_destroy
region = var.region
acl = var.acl

versioning {
Expand Down Expand Up @@ -212,7 +209,6 @@ resource "aws_s3_bucket" "s3_logging_encryption" {

bucket = module.labels.id
force_destroy = var.force_destroy
region = var.region
acl = var.acl

versioning {
Expand Down Expand Up @@ -298,7 +294,6 @@ resource "aws_s3_bucket" "s3_encryption" {

bucket = module.labels.id
force_destroy = var.force_destroy
region = var.region
acl = var.acl

versioning {
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ variable "versioning" {
description = "Enable Versioning of S3."
}

variable "region" {
type = string
default = ""
description = "Region Where you want to host S3."
}

variable "acl" {
type = string
default = ""
Expand Down

0 comments on commit a396891

Please sign in to comment.