DefenderForStorageArgs

data class DefenderForStorageArgs(val properties: Output<DefenderForStorageSettingPropertiesArgs>? = null, val resourceId: Output<String>? = null, val settingName: Output<String>? = null) : ConvertibleToJava<DefenderForStorageArgs>

The Defender for Storage resource. Uses Azure REST API version 2024-10-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-12-01-preview. Other available API versions: 2022-12-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native security [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Creates or updates the Defender for Storage settings on a specified resource.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var defenderForStorage = new AzureNative.Security.DefenderForStorage("defenderForStorage", new()
{
Properties = new AzureNative.Security.Inputs.DefenderForStorageSettingPropertiesArgs
{
IsEnabled = true,
MalwareScanning = new AzureNative.Security.Inputs.MalwareScanningPropertiesArgs
{
OnUpload = new AzureNative.Security.Inputs.OnUploadPropertiesArgs
{
CapGBPerMonth = -1,
IsEnabled = true,
},
ScanResultsEventGridTopicResourceId = "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic",
},
OverrideSubscriptionLevelSettings = true,
SensitiveDataDiscovery = new AzureNative.Security.Inputs.SensitiveDataDiscoveryPropertiesArgs
{
IsEnabled = true,
},
},
ResourceId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
SettingName = "current",
});
});
package main
import (
security "github.com/pulumi/pulumi-azure-native-sdk/security/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := security.NewDefenderForStorage(ctx, "defenderForStorage", &security.DefenderForStorageArgs{
Properties: &security.DefenderForStorageSettingPropertiesArgs{
IsEnabled: pulumi.Bool(true),
MalwareScanning: &security.MalwareScanningPropertiesArgs{
OnUpload: &security.OnUploadPropertiesArgs{
CapGBPerMonth: pulumi.Int(-1),
IsEnabled: pulumi.Bool(true),
},
ScanResultsEventGridTopicResourceId: pulumi.String("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"),
},
OverrideSubscriptionLevelSettings: pulumi.Bool(true),
SensitiveDataDiscovery: &security.SensitiveDataDiscoveryPropertiesArgs{
IsEnabled: pulumi.Bool(true),
},
},
ResourceId: pulumi.String("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount"),
SettingName: pulumi.String("current"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.security.DefenderForStorage;
import com.pulumi.azurenative.security.DefenderForStorageArgs;
import com.pulumi.azurenative.security.inputs.DefenderForStorageSettingPropertiesArgs;
import com.pulumi.azurenative.security.inputs.MalwareScanningPropertiesArgs;
import com.pulumi.azurenative.security.inputs.OnUploadPropertiesArgs;
import com.pulumi.azurenative.security.inputs.SensitiveDataDiscoveryPropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var defenderForStorage = new DefenderForStorage("defenderForStorage", DefenderForStorageArgs.builder()
.properties(DefenderForStorageSettingPropertiesArgs.builder()
.isEnabled(true)
.malwareScanning(MalwareScanningPropertiesArgs.builder()
.onUpload(OnUploadPropertiesArgs.builder()
.capGBPerMonth(-1)
.isEnabled(true)
.build())
.scanResultsEventGridTopicResourceId("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic")
.build())
.overrideSubscriptionLevelSettings(true)
.sensitiveDataDiscovery(SensitiveDataDiscoveryPropertiesArgs.builder()
.isEnabled(true)
.build())
.build())
.resourceId("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount")
.settingName("current")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:security:DefenderForStorage current /{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}

Constructors

Link copied to clipboard
constructor(properties: Output<DefenderForStorageSettingPropertiesArgs>? = null, resourceId: Output<String>? = null, settingName: Output<String>? = null)

Properties

Link copied to clipboard

Defender for Storage resource properties.

Link copied to clipboard
val resourceId: Output<String>? = null

The identifier of the resource.

Link copied to clipboard
val settingName: Output<String>? = null

Defender for Storage setting name.

Functions

Link copied to clipboard
open override fun toJava(): DefenderForStorageArgs