Skip to content

Commit 77ed1a2

Browse files
committed
Add test code. Fix syntax
1 parent cc1cdd7 commit 77ed1a2

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ resource "aws_s3_bucket" "this" {
2525
bucket = "${var.namespaced ?
2626
format("%s-%s-%s", var.org, var.environment, element(var.names, count.index)) :
2727
format("%s-%s", var.org, element(var.names, count.index))}"
28-
acl = "${var.public ? public-read : private}"
28+
acl = "${var.public ? "public-read" : "private"}"
2929
versioning {
3030
enabled = "${var.versioned}"
3131
}

test/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
module "s3-single" {
3+
source = ".."
4+
names = ["bucket"]
5+
environment = "${var.environment}"
6+
org = "zapter"
7+
}
8+
9+
module "s3-multi" {
10+
source = ".."
11+
names = ["bucket-1", "bucket2", "bucket_3"]
12+
environment = "${var.environment}"
13+
org = "zapter"
14+
}

test/provider.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
}

test/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
variable "environment" {
2+
default = "dev"
3+
}
4+
variable "region" {
5+
default = "us-west-2"
6+
}

0 commit comments

Comments
 (0)