-
Notifications
You must be signed in to change notification settings - Fork 0
Update tf files for Cosmos DB #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c0f1901
5597d20
d083696
62b4a8a
cf75a56
1f85c6f
e84f0ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
provider "azurerm" { | ||
version = "=1.38.0" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
backend "azurerm" { | ||
resource_group_name = "example-tfstate" | ||
storage_account_name = "exampletfstate" | ||
container_name = "tfstate" | ||
key = "cosmosdb/terraform.tfstate" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
locals { | ||
network = { | ||
name = data.terraform_remote_state.network.outputs.network_name | ||
region = data.terraform_remote_state.network.outputs.region | ||
} | ||
|
||
kubernetes = { | ||
node_pool_subnet_id = data.terraform_remote_state.kubernetes.outputs.node_pool_subnet_id | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module "cosmosdb" { | ||
source = "git::https://github.com/scalar-labs/scalar-terraform.git//modules/azure/cosmosdb?ref=master" | ||
|
||
# Required Variables | ||
network = local.network | ||
kubernetes = local.kubernetes | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
output "cosmosdb_account_endpoint" { | ||
value = module.cosmosdb.cosmosdb_account_endpoint | ||
} | ||
|
||
output "cosmosdb_account_primary_master_key" { | ||
value = module.cosmosdb.cosmosdb_account_primary_master_key | ||
} | ||
|
||
output "cosmosdb_account_secondary_master_key" { | ||
value = module.cosmosdb.cosmosdb_account_secondary_master_key | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
data "terraform_remote_state" "network" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In scalar-k8s, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this PR, I have added But to be fully consistent, BTW, basically, should we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks!
I think it can be done in one PR or separate PRs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the summary! Sure! |
||
backend = "local" | ||
|
||
config = { | ||
path = "../network/terraform.tfstate" | ||
} | ||
} | ||
|
||
data "terraform_remote_state" "kubernetes" { | ||
backend = "local" | ||
|
||
config = { | ||
path = "../kubernetes/terraform.tfstate" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
data "terraform_remote_state" "network" { | ||
backend = "azurerm" | ||
|
||
config = { | ||
storage_account_name = "exampletfstate" | ||
container_name = "tfstate" | ||
key = "network/terraform.tfstate" | ||
} | ||
} | ||
|
||
data "terraform_remote_state" "kubernetes" { | ||
backend = "azurerm" | ||
|
||
config = { | ||
storage_account_name = "exampletfstate" | ||
container_name = "tfstate" | ||
key = "kubernetes/terraform.tfstate" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following may not be necessary.
cidr
dns
id
bastion_ip
bastion_provision_id
internal_domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1f85c6f