Skip to content

azurermMssqlJobAgent

Manages an Elastic Job Agent.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "northeurope",
    name: "example",
  }
);
const azurermMssqlServerExample = new azurerm.mssqlServer.MssqlServer(
  this,
  "example_1",
  {
    administrator_login: "4dm1n157r470r",
    administrator_login_password: "4-v3ry-53cr37-p455w0rd",
    location: azurermResourceGroupExample.location,
    name: "example-server",
    resource_group_name: azurermResourceGroupExample.name,
    version: "12.0",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMssqlServerExample.overrideLogicalId("example");
const azurermMssqlDatabaseExample = new azurerm.mssqlDatabase.MssqlDatabase(
  this,
  "example_2",
  {
    collation: "SQL_Latin1_General_CP1_CI_AS",
    name: "example-db",
    server_id: azurermMssqlServerExample.id,
    sku_name: "S1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMssqlDatabaseExample.overrideLogicalId("example");
const azurermMssqlJobAgentExample = new azurerm.mssqlJobAgent.MssqlJobAgent(
  this,
  "example_3",
  {
    database_id: azurermMssqlDatabaseExample.id,
    location: azurermResourceGroupExample.location,
    name: "example-job-agent",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMssqlJobAgentExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Elastic Job Agent. Changing this forces a new Elastic Job Agent to be created.

  • location - (Required) The Azure Region where the Elastic Job Agent should exist. Changing this forces a new Elastic Job Agent to be created.

  • databaseId - (Required) The ID of the database to store metadata for the Elastic Job Agent. Changing this forces a new Elastic Job Agent to be created.


  • tags - (Optional) A mapping of tags which should be assigned to the Database.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Elastic Job Agent.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 1 hour) Used when creating the Database.
  • read - (Defaults to 5 minutes) Used when retrieving the Database.
  • update - (Defaults to 1 hour) Used when updating the Database.
  • delete - (Defaults to 1 hour) Used when deleting the Database.

Import

Elastic Job Agents can be imported using the id, e.g.

terraform import azurerm_mssql_job_agent.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Sql/servers/myserver1/jobAgents/myjobagent1