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
module "cosmosdb_northwind_customers" { | |
source = "../../../submodules/terraform-azurerm/services/cosmos-db/container/v1" | |
context = module.coreinfra.context | |
service_settings = { | |
account_name = module.cosmosdb_account.name | |
database_name = module.cosmosdb_database.name |
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
resource "azurerm_cosmosdb_sql_database" "database" { | |
name = var.service_settings.name | |
resource_group_name = var.context.resource_group_name | |
account_name = var.service_settings.account_name | |
autoscale_settings { | |
max_throughput = var.service_settings.max_throughput | |
} | |
} |
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
module cosmosdb_database { | |
source = "../../../submodules/terraform-azurerm/services/cosmos-db/database/sql/base/v1" | |
context = module.coreinfra.context | |
service_settings = { | |
name = "Northwind-Customers" | |
account_name = module.cosmosdb_account.name | |
# for autoscaling resources, shared between all containers | |
# the module just does shared autoscaling at this time. | |
# We can create more modules in the library as needed. | |
max_throughput = 4000 |
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
resource "azurerm_cosmosdb_account" "account" { | |
name = "${var.service_settings.name}-${random_string.random.result}" | |
location = var.context.location | |
resource_group_name = var.context.resource_group_name | |
offer_type = var.service_settings.tier | |
kind = var.service_settings.kind | |
enable_automatic_failover = true | |
consistency_policy { |
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
# | |
# Create a cosmosDB account | |
# | |
module cosmosdb_account { | |
depends_on = [ azurerm_key_vault_access_policy.current_user ] | |
source = "../../../submodules/terraform-azurerm/services/cosmos-db/endpoint/dual/secure/v1" | |
context = module.coreinfra.context | |
observability_settings = module.coreinfra.observability_settings | |
service_settings = { | |
name = local.resource_name |
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
steve_dillon@Azure:~$ git clone git://github.com/persistentsystems/terraform-azurerm-samples.git | |
Cloning into 'terraform-azurerm-samples'... | |
steve_dillon@Azure:~$ cd terraform-azurerm-samples/ | |
steve_dillon@Azure:~/terraform-azurerm-samples$ git submodule init | |
Submodule 'submodules/terraform-azurerm' (git://github.com/persistentsystems/terraform-azurerm.git) registered for path 'submodules/terraform-azurerm' | |
steve_dillon@Azure:~/terraform-azurerm-samples$ git submodule update | |
Cloning into '/home/steve_dillon/terraform-azurerm-samples/submodules/terraform-azurerm'... | |
Submodule path 'submodules/terraform-azurerm': checked out '0fe1907fc7bb48ea989893715a1532f5b5879421' |
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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
# This must match annotation "consul.hashicorp.com/connect-service": | |
name: demo-helloworld | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: |
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
# if you deployed consul with consul-helm then | |
# you need to verify spec->address matches your | |
# helm release name. Do a 'kubectl get service' | |
# to verify your consul server name. Or | |
# helm list to get the release name | |
--- | |
apiVersion: getambassador.io/v2 | |
kind: ConsulResolver | |
metadata: | |
name: consul-dc1 |
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
# | |
# You MUST edit the last line of file file and add | |
# the name of your consul-helm deployment. | |
# most likely this is consul | |
# | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRole | |
metadata: |
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
kubectl apply -f - << EOF | |
# | |
# This mapping maps to the sidecar-proxy | |
# so that Ambassador can do mTLS with Consul | |
--- | |
apiVersion: getambassador.io/v2 | |
kind: Mapping | |
metadata: | |
name: demo-helloworld | |
spec: |
NewerOlder