-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(terraform): support cross-modules edges (#3909)
* support cross-modules edges * fix getting the source modules * fix test * add UT
- Loading branch information
1 parent
f61ced9
commit 59692f6
Showing
11 changed files
with
119 additions
and
10 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
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
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,8 @@ | ||
module "test" { | ||
source = "./module" | ||
bucket = aws_s3_bucket.example.id | ||
} | ||
|
||
resource "aws_s3_bucket" "example" { | ||
bucket = "example" | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/terraform/graph/resources/cross_modules/module/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,11 @@ | ||
locals { | ||
bucket = var.bucket | ||
} | ||
|
||
resource "aws_s3_bucket_public_access_block" "var_bucket" { | ||
bucket = local.bucket | ||
block_public_acls = true | ||
block_public_policy = true | ||
ignore_public_acls = true | ||
restrict_public_buckets = true | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/terraform/graph/resources/cross_modules/module/variables.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,3 @@ | ||
variable "bucket" { | ||
type = string | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/terraform/graph/resources/cross_modules2/inner_module/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,11 @@ | ||
locals { | ||
bucket = var.bucket | ||
} | ||
|
||
resource "aws_s3_bucket_public_access_block" "var_bucket" { | ||
bucket = local.bucket | ||
block_public_acls = true | ||
block_public_policy = true | ||
ignore_public_acls = true | ||
restrict_public_buckets = true | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/terraform/graph/resources/cross_modules2/inner_module/variables.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,3 @@ | ||
variable "bucket" { | ||
type = string | ||
} |
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,8 @@ | ||
module "test" { | ||
source = "./module" | ||
bucket = aws_s3_bucket.example.id | ||
} | ||
|
||
resource "aws_s3_bucket" "example" { | ||
bucket = "example" | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/terraform/graph/resources/cross_modules2/module/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,8 @@ | ||
locals { | ||
bucket = var.bucket | ||
} | ||
|
||
module "inner_module" { | ||
source = "../inner_module" | ||
bucket = local.bucket | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/terraform/graph/resources/cross_modules2/module/variables.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,3 @@ | ||
variable "bucket" { | ||
type = string | ||
} |