Skip to content

Commit

Permalink
test: add example project for testing terragrunt dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustafa Mujahid committed Jul 29, 2022
1 parent 8d99fa3 commit 6b88230
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test_examples/cross_project_dependencies/app/main.tf
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 test_examples/cross_project_dependencies/app/terragrunt.hcl
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
}
20 changes: 20 additions & 0 deletions test_examples/cross_project_dependencies/roles/main.tf
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 test_examples/cross_project_dependencies/roles/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include {
path = find_in_parent_folders()
}

Empty file.

0 comments on commit 6b88230

Please sign in to comment.