Skip to content
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

Replace template_file data source with templatefile function call #27

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### Changed

- Use `templatefile` instead of `data "template_file`

## [0.17.0] - 2024-01-17

### Added
Expand Down
16 changes: 5 additions & 11 deletions covalent_azurebatch_plugin/assets/infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "azurerm_resource_group" "batch" {
}

data "azurerm_resource_group" "batch" {
name = var.batch_resource_group
name = var.batch_resource_group
count = var.create_batch_account ? 0 : 1
}

Expand Down Expand Up @@ -99,10 +99,9 @@ EOF
}
}

data "template_file" "executor_config" {
template = file("${path.module}/azurebatch.conf.tftpl")

vars = {
resource "local_file" "executor_config" {
filename = "${path.module}/azurebatch.conf"
content = templatefile("${path.module}/azurebatch.conf.tftpl", {
subscription_id = var.subscription_id
tenant_id = var.tenant_id
client_id = "${azuread_application.batch.client_id}"
Expand All @@ -114,10 +113,5 @@ data "template_file" "executor_config" {
pool_id = "${azurerm_batch_pool.covalent.name}"
retries = 3
base_image_uri = "${azurerm_container_registry.batch.login_server}/covalent-executor-base:latest"
}
}

resource "local_file" "executor_config" {
content = data.template_file.executor_config.rendered
filename = "${path.module}/azurebatch.conf"
})
}
Loading