forked from brikis98/terraform-up-and-running-code
-
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.
- Loading branch information
Showing
46 changed files
with
192 additions
and
130 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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
# OPA example | ||
|
||
This folder contains example [Open Policy Agent (OPA)](https://www.openpolicyagent.org/) policy that enforces all | ||
module source URLs come from the `brikis98` GitHub org. | ||
resources include a specific tag. | ||
|
||
For more info, please see Chapter 9, "How to test Terraform code", of | ||
*[Terraform: Up and Running](http://www.terraformupandrunning.com)*. | ||
|
||
## Quick start | ||
|
||
The best way to run this test is with Terratest. See | ||
[opa_test.go](../../terraform/09-testing-terraform-code/test/opa_test.go). | ||
Please see the README in the companion Terraform module at | ||
[09-testing-terraform-code/examples/opa](../../terraform/09-testing-terraform-code/examples/opa) for instructions on | ||
how to use this policy to test that module. | ||
|
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
package tuar | ||
|
||
allow { | ||
resource_change := input.resource_changes[_] | ||
resource_change.change.after.tags["ManagedBy"] | ||
} |
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,6 +1,7 @@ | ||
# Define the function in one place | ||
def example_function() | ||
puts "Hello, World" | ||
end | ||
|
||
# Other places in your code | ||
# Use the function in multiple other places | ||
example_function() |
3 changes: 2 additions & 1 deletion
3
code/ruby/04-terraform-modules/function-with-input-and-output-params-example.rb
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,6 +1,7 @@ | ||
# A function that returns a value | ||
def example_function(param1, param2) | ||
return "Hello, #{param1} #{param2}" | ||
end | ||
|
||
# Other places in your code | ||
# Call the function and get the return value | ||
return_value = example_function("foo", "bar") |
3 changes: 2 additions & 1 deletion
3
code/ruby/04-terraform-modules/function-with-input-params-example.rb
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,6 +1,7 @@ | ||
# A function with two input parameters | ||
def example_function(param1, param2) | ||
puts "Hello, #{param1} #{param2}" | ||
end | ||
|
||
# Other places in your code | ||
# Pass two input parameters to the function | ||
example_function("foo", "bar") |
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
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 |
---|---|---|
|
@@ -17,11 +17,7 @@ module "webserver_cluster" { | |
|
||
# Since the terraform-up-and-running-code repo is open source, we're using an HTTPS URL here. If it was a private | ||
# repo, we'd instead use an SSH URL ([email protected]:brikis98/terraform-up-and-running-code.git) to leverage SSH auth | ||
# TODO: restore proper source URL with ref 0.2.0 when ready! | ||
# source = "github.com/brikis98/terraform-up-and-running-code//code/terraform/04-terraform-module/module-example/modules/services/webserver-cluster?ref=v0.1.0" | ||
|
||
# TODO: This is a temporary replacement for the proper source URL above! | ||
source = "../../../../../module-example/modules/services/webserver-cluster" | ||
source = "github.com/brikis98/terraform-up-and-running-code//code/terraform/04-terraform-module/module-example/modules/services/webserver-cluster?ref=v0.2.0" | ||
|
||
cluster_name = var.cluster_name | ||
db_remote_state_bucket = var.db_remote_state_bucket | ||
|
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 |
---|---|---|
|
@@ -17,11 +17,7 @@ module "webserver_cluster" { | |
|
||
# Since the terraform-up-and-running-code repo is open source, we're using an HTTPS URL here. If it was a private | ||
# repo, we'd instead use an SSH URL ([email protected]:brikis98/terraform-up-and-running-code.git) to leverage SSH auth | ||
# TODO: restore proper source URL with ref 0.2.0 when ready! | ||
# source = "github.com/brikis98/terraform-up-and-running-code//code/terraform/04-terraform-module/module-example/modules/services/webserver-cluster?ref=v0.1.0" | ||
|
||
# TODO: This is a temporary replacement for the proper source URL above! | ||
source = "../../../../../module-example/modules/services/webserver-cluster" | ||
source = "github.com/brikis98/terraform-up-and-running-code//code/terraform/04-terraform-module/module-example/modules/services/webserver-cluster?ref=v0.2.0" | ||
|
||
cluster_name = var.cluster_name | ||
db_remote_state_bucket = var.db_remote_state_bucket | ||
|
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
4 changes: 2 additions & 2 deletions
4
...ps-and-tricks/loops-and-if-statements/live/global/three-iam-users-unique-names/outputs.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
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
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
1 change: 1 addition & 0 deletions
1
code/terraform/06-managing-secrets-with-terraform/mysql-kms/db-creds.yml.encrypted
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 @@ | ||
AQICAHiW/pC9neuNL5xt932ECXblZ4rRBXSupBikz9dF7kD3SgEwcp7lzid8y1I+1myk8vYuAAABpDCCAaAGCSqGSIb3DQEHBqCCAZEwggGNAgEAMIIBhgYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAwkQAx6ePTKR2C1OlECARCAggFXOrrfDxwuQ48rGvFqNZlaQ+II0FtrIrC77CNmH3uCtWbRSQZ9M4+7mm/hyHP+74bFCSBTtPmz6HK9dxkPMUPHxW1Zut7h18nufGxIixXkcIPI/ZH1L0N/yvNIk0/7lgC3UHcQsDO1yXTJyg+90NopksdBqh4yaO/XG8v0Bz700UP6bcvdIHve2mv1F6oXLMhlDoBh7AmkLI92vAjKcnDBmCmutai4c478gGcBRTrrJc2gd+nzFYy97YFf2ONpKx0zRS5An2Shcye8cbD8Iv/E5Xy6Hih+Pt2ItJBIeqS/gC0fAxEjtfURiXktZ3wC2Mplx9Iyedvl4nIxp0M2ztnbAxZ2IrfmcfP/z726ukAABd+gkkLbt9EoumIgqoj5gJMW2zovW7nyy61/D8bCEBt1nnGIPOki8mDcbUzn2a06ZCY/9cuTfRjynTrg9TNg45+6o2N9O28hdg== |
Oops, something went wrong.