-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from acc-jon/issue365
properly handle nested submodules (#365)
- Loading branch information
Showing
7 changed files
with
126 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
pkg/iac-providers/terraform/v12/testdata/deep-modules/modules/m4/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
variable "m4projectid" { | ||
type = string | ||
default = "asdfasdf" | ||
} | ||
|
||
module "m4a" { | ||
source = "./modules/m4a" | ||
m4aprojectid = var.m4projectid | ||
} | ||
|
||
resource "aws_s3_bucket" "bucket" { | ||
bucket = var.m4projectid | ||
policy = module.m4a.fullbucketpolicy | ||
} |
23 changes: 23 additions & 0 deletions
23
pkg/iac-providers/terraform/v12/testdata/deep-modules/modules/m4/modules/m4a/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
variable "m4aprojectid" { | ||
type = string | ||
default = "asdfasdf" | ||
} | ||
|
||
module "m4b" { | ||
source = "../m4b" | ||
m4bversionyear = "2012" | ||
m4bversionmonth = "10" | ||
m4bversionday = "17" | ||
m4bbucketname = module.m4c.fullbucketname | ||
} | ||
module "m4c" { | ||
source = "../m4c" | ||
m4cbucketname = var.m4aprojectid | ||
m4cenvironment = "dev" | ||
} | ||
|
||
|
||
resource "aws_s3_bucket" "bucket4a" { | ||
bucket = module.m4c.fullbucketname | ||
policy = module.m4b.fullbucketpolicy | ||
} |
36 changes: 36 additions & 0 deletions
36
pkg/iac-providers/terraform/v12/testdata/deep-modules/modules/m4/modules/m4b/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
variable "m4bversionyear" { | ||
type = string | ||
} | ||
variable "m4bversionmonth" { | ||
type = string | ||
} | ||
variable "m4bversionday" { | ||
type = string | ||
} | ||
variable "m4bbucketname" { | ||
type = string | ||
} | ||
data "aws_iam_policy_document" "readbuckets" { | ||
source_json = <<EOF | ||
{ | ||
"Version":"${var.m4bversionyear}-${var.m4bversionmonth}-${var.m4bversionday}", | ||
"Statement":[ | ||
{ | ||
"Sid": "PublicRead", | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Action": ["s3:GetObject"], | ||
"Resource": ["arn:aws:s3:::${var.m4bbucketname}/*"] | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
|
||
output "fullbucketpolicy" { | ||
value = data.aws_iam_policy_document.readbuckets.json | ||
} | ||
output "BucketARN" { | ||
value = var.m4bbucketname | ||
} | ||
|
17 changes: 17 additions & 0 deletions
17
pkg/iac-providers/terraform/v12/testdata/deep-modules/modules/m4/modules/m4c/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
variable "m4cbucketname" { | ||
type = string | ||
} | ||
variable "m4cenvironment" { | ||
type = string | ||
} | ||
|
||
output "fullbucketname" { | ||
value = "${var.m4cbucketname}-${var.m4cenvironment}" | ||
} | ||
output "sourcebucketname" { | ||
value = var.m4cbucketname | ||
} | ||
output "sourceenvironment" { | ||
value = var.m4cenvironment | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters