-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add example project for testing terragrunt dependency
- Loading branch information
Mustafa Mujahid
committed
Jul 29, 2022
1 parent
8d99fa3
commit 6b88230
Showing
5 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
variable "role_name" { | ||
description = "Name of the role we want to bring in" | ||
type = string | ||
} | ||
|
||
output "role_name" { | ||
value = var.role_name | ||
} |
10 changes: 10 additions & 0 deletions
10
test_examples/cross_project_dependencies/app/terragrunt.hcl
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,10 @@ | ||
dependency "roles" { | ||
config_path = "../roles" | ||
mock_outputs = { | ||
role_arn = "placeholder" | ||
} | ||
} | ||
|
||
inputs = { | ||
role_arn = dependency.roles.outputs.role_arn | ||
} |
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,20 @@ | ||
resource "aws_iam_role" "test_role" { | ||
name = "test_role_terragrunt_atlantis_project" | ||
|
||
assume_role_policy = data.aws_iam_policy_document.policy.json | ||
} | ||
|
||
data "aws_iam_policy_document" "policy" { | ||
statement { | ||
actions = ["sts:AssumeRole"] | ||
|
||
principals { | ||
type = "Service" | ||
identifiers = ["ec2.amazonaws.com"] | ||
} | ||
} | ||
} | ||
|
||
output "role_name" { | ||
value = aws_iam_role.test_role.name | ||
} |
4 changes: 4 additions & 0 deletions
4
test_examples/cross_project_dependencies/roles/terragrunt.hcl
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,4 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
Empty file.