Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ned1313 committed Feb 21, 2024
2 parents d344724 + e1765b7 commit 8766f2a
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 74 deletions.
5 changes: 4 additions & 1 deletion 2020-06-30-ModuleLooping/file-creator/outputs.tf
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# No outputs defined
# No outputs defined
output "stuff" {
value = local_file.my_file.id
}
17 changes: 17 additions & 0 deletions 2020-06-30-ModuleLooping/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,21 @@ module "files_foreach" {
content = each.value
filename = "${each.key}.txt"

}

provider "local" {
alias = "alt"
}

resource "local_file" "test" {
for_each = toset(["a", "b", "c"])
provider = local.alt

content = each.key
filename = "${each.key}.txt"
}

output "names" {
value = module.files[*].stuff

}
22 changes: 22 additions & 0 deletions 2024-02-20-TestingFramework/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<html>
<head>
<meta charset="utf-8">
<title>I love cats! 😽</title>
<title>🐈🌮 I love tacocat! 🌮🐈</title>
</head>
<body>
<h1>Hi! Here's a cat.</h1>
<h1>Hi! Here's a taco: 🌮</h1>
<p>And here's a cat:</p>
<img src="https://placekitten.com/200/300" alt="Meow!">
<p>TACOCAT!</p>
</body>
</html>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ terraform {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Create a random integer for website naming
/*
run "random_int_apply" {
module {
source = "./tests/setup"
Expand Down Expand Up @@ -27,4 +28,5 @@ run "check_site" {
condition = data.http.main.status_code == 200
error_message = "Website ${run.execute.homepage_url} returned the status code ${data.http.main.status_code}. Expected 200."
}
}
}
*/
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ run "sa_test_1" {
error_message = "${var.website_name} did not render properly. Received ${local.storage_account_name}."
}
}

/*
run "sa_test_2" {
command = plan
Expand All @@ -38,14 +38,16 @@ run "sa_test_3" {
}
}
run "sa_test_4" {
command = plan
variables {
website_name = "ThisNameIsTOOLONG2Use"
website_name = "ThisIsAReallyLongName"
}
expect_failures = [
var.website_name,
]
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ variable "location" {

variable "website_name" {
description = "The website name to use to create related resources in Azure."
default = "catmandu"
default = "tacocat"

validation {
condition = length(var.website_name) <= 16
error_message = "Website name must be 16 or less characters. Submitted value was ${length(var.website_name)}"
condition = length(var.website_name) <= 17
error_message = "The website name must be 17 characters or fewer."
}
}

Expand Down
60 changes: 0 additions & 60 deletions testing-framework/.terraform.lock.hcl

This file was deleted.

0 comments on commit 8766f2a

Please sign in to comment.