Skip to content

azurermAdvancedThreatProtection

Manages a resources Advanced Threat Protection setting.

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: "West Europe",
    name: "atp-example",
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_1",
  {
    account_replication_type: "LRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "examplestorage",
    resource_group_name: azurermResourceGroupExample.name,
    tags: {
      environment: "example",
    },
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageAccountExample.overrideLogicalId("example");
const azurermAdvancedThreatProtectionExample =
  new azurerm.advancedThreatProtection.AdvancedThreatProtection(
    this,
    "example_2",
    {
      enabled: true,
      target_resource_id: azurermStorageAccountExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAdvancedThreatProtectionExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • targetResourceId - (Required) The ID of the Azure Resource which to enable Advanced Threat Protection on. Changing this forces a new resource to be created.

  • enabled - (Required) Should Advanced Threat Protection be enabled on this resource?

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the Advanced Threat Protection resource.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Advanced Threat Protection.
  • update - (Defaults to 30 minutes) Used when updating the Advanced Threat Protection.
  • read - (Defaults to 5 minutes) Used when retrieving the Advanced Threat Protection.
  • delete - (Defaults to 30 minutes) Used when deleting the Advanced Threat Protection.

Import

Advanced Threat Protection can be imported using the resourceId, e.g.

terraform import azurerm_advanced_threat_protection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/exampleResourceGroup/providers/Microsoft.Storage/storageAccounts/exampleaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/default