forked from terraform-aws-modules/terraform-aws-s3-bucket
-
Notifications
You must be signed in to change notification settings - Fork 0
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 terraform-aws-modules#5 from hashicorp/find-resour…
…ces-being-read-too find resources only being read too
- Loading branch information
Showing
11 changed files
with
64 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
policy "enforce-mandatory-tags" { | ||
enforcement_level = "hard-mandatory" | ||
} | ||
|
||
module "tfplan-functions" { | ||
source = "https://raw.githubusercontent.com/hashicorp/terraform-guides/master/governance/third-generation/common-functions/tfplan-functions/tfplan-functions.sentinel" | ||
} | ||
|
||
policy "enforce-mandatory-tags" { | ||
enforcement_level = "hard-mandatory" | ||
module "find-resources" { | ||
source = "../common-functions/find-resources.sentinel" | ||
} |
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
policy "enforce-mandatory-tags" { | ||
enforcement_level = "hard-mandatory" | ||
} | ||
|
||
module "tfplan-functions" { | ||
source = "https://raw.githubusercontent.com/hashicorp/terraform-guides/master/governance/third-generation/common-functions/tfplan-functions/tfplan-functions.sentinel" | ||
} | ||
|
||
policy "enforce-mandatory-tags" { | ||
enforcement_level = "hard-mandatory" | ||
module "find-resources" { | ||
source = "../common-functions/find-resources.sentinel" | ||
} |
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
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 @@ | ||
# Function that finds all resources of a specified type that are being | ||
# created, updated, or read. | ||
|
||
# Standard tfplan/v2 import | ||
import "tfplan/v2" as tfplan | ||
|
||
find_resources = func(type) { | ||
resources = filter tfplan.resource_changes as address, rc { | ||
rc.type is type and | ||
rc.mode is "managed" and | ||
(rc.change.actions contains "create" or | ||
rc.change.actions contains "update" or | ||
rc.change.actions contains "read") | ||
} | ||
|
||
return resources | ||
} |
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
policy "enforce-mandatory-labels" { | ||
enforcement_level = "hard-mandatory" | ||
} | ||
|
||
module "tfplan-functions" { | ||
source = "https://raw.githubusercontent.com/hashicorp/terraform-guides/master/governance/third-generation/common-functions/tfplan-functions/tfplan-functions.sentinel" | ||
} | ||
|
||
policy "enforce-mandatory-labels" { | ||
enforcement_level = "hard-mandatory" | ||
module "find-resources" { | ||
source = "../common-functions/find-resources.sentinel" | ||
} |