-
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.
Added terraform definitions for known resources.
- Apparently Azure stuff is all-too-fragile and I had to create both Cosmos DB and PostgreSQL twice. - See: hashicorp/terraform-provider-azurerm#3813
- Loading branch information
Showing
12 changed files
with
2,437 additions
and
2,315 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,7 @@ | ||
resource "azurerm_servicebus_topic" "chat-app" { | ||
name = "chat-app-coordination-topic" | ||
resource_group_name = "${azurerm_resource_group.chat-app.name}" | ||
namespace_name = "${azurerm_servicebus_namespace.chat-app.name}" | ||
|
||
enable_partitioning = true | ||
} |
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,21 @@ | ||
resource "azurerm_cosmosdb_account" "messages-db" { | ||
name = "chat-app-account" | ||
location = "${azurerm_resource_group.chat-app.location}" | ||
resource_group_name = "${azurerm_resource_group.chat-app.name}" | ||
offer_type = "Standard" | ||
kind = "GlobalDocumentDB" | ||
|
||
enable_automatic_failover = false | ||
|
||
consistency_policy { | ||
consistency_level = "BoundedStaleness" | ||
max_interval_in_seconds = 10 | ||
max_staleness_prefix = 200 | ||
} | ||
|
||
geo_location { | ||
prefix = "chat-app-account" | ||
location = "${azurerm_resource_group.chat-app.location}" | ||
failover_priority = 0 | ||
} | ||
} |
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 @@ | ||
resource "azurerm_servicebus_namespace" "chat-app" { | ||
name = "chat-app-namespace" | ||
location = "${azurerm_resource_group.chat-app.location}" | ||
resource_group_name = "${azurerm_resource_group.chat-app.name}" | ||
sku = "Standard" | ||
|
||
tags = { | ||
source = "terraform" | ||
} | ||
} |
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 @@ | ||
resource "azurerm_virtual_network" "chat-app" { | ||
name = "chat-app-network" | ||
resource_group_name = "${azurerm_resource_group.chat-app.name}" | ||
location = "${azurerm_resource_group.chat-app.location}" | ||
address_space = ["10.0.0.0/16"] | ||
} |
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,3 @@ | ||
provider "azurerm" { | ||
version = "1.33.0" | ||
} |
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 @@ | ||
resource "azurerm_resource_group" "chat-app" { | ||
name = "chat-app" | ||
location = "North Europe" | ||
} |
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 @@ | ||
resource "azurerm_service_fabric_cluster" "chat-app" { | ||
name = "chat-app-cluster" | ||
resource_group_name = "${azurerm_resource_group.chat-app.name}" | ||
location = "${azurerm_resource_group.chat-app.location}" | ||
reliability_level = "Bronze" | ||
upgrade_mode = "Automatic" | ||
vm_image = "Linux" | ||
management_endpoint = "https://chat-app.cloudapp.net:19080" | ||
|
||
node_type { | ||
name = "chats" | ||
instance_count = 3 | ||
is_primary = true | ||
client_endpoint_port = 2020 | ||
http_endpoint_port = 80 | ||
} | ||
} |
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,23 @@ | ||
resource "azurerm_postgresql_server" "chat-app" { | ||
name = "postgresql-server-1" | ||
location = "${azurerm_resource_group.chat-app.location}" | ||
resource_group_name = "${azurerm_resource_group.chat-app.name}" | ||
|
||
sku { | ||
name = "B_Gen5_2" | ||
capacity = 2 | ||
tier = "Basic" | ||
family = "Gen5" | ||
} | ||
|
||
storage_profile { | ||
storage_mb = 5120 | ||
backup_retention_days = 7 | ||
geo_redundant_backup = "Disabled" | ||
} | ||
|
||
administrator_login = "psqladmin" | ||
administrator_login_password = "T0o$ecret7oo$ecure7oo4urious" | ||
version = "10" | ||
ssl_enforcement = "Enabled" | ||
} |
Oops, something went wrong.