All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.securitycenter.kotlin.StorageDefenderArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.securitycenter.kotlin

import com.pulumi.azure.securitycenter.StorageDefenderArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages the Defender for Storage.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "westus2",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "exampleacc",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleStorageDefender = new azure.securitycenter.StorageDefender("example", {storageAccountId: exampleAccount.id});
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-rg",
 *     location="westus2")
 * example_account = azure.storage.Account("example",
 *     name="exampleacc",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="LRS")
 * example_storage_defender = azure.securitycenter.StorageDefender("example", storage_account_id=example_account.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-rg",
 *         Location = "westus2",
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "exampleacc",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "LRS",
 *     });
 *     var exampleStorageDefender = new Azure.SecurityCenter.StorageDefender("example", new()
 *     {
 *         StorageAccountId = exampleAccount.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-rg"),
 * 			Location: pulumi.String("westus2"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("exampleacc"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("LRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = securitycenter.NewStorageDefender(ctx, "example", &securitycenter.StorageDefenderArgs{
 * 			StorageAccountId: exampleAccount.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.securitycenter.StorageDefender;
 * import com.pulumi.azure.securitycenter.StorageDefenderArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-rg")
 *             .location("westus2")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("exampleacc")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("LRS")
 *             .build());
 *         var exampleStorageDefender = new StorageDefender("exampleStorageDefender", StorageDefenderArgs.builder()
 *             .storageAccountId(exampleAccount.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-rg
 *       location: westus2
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: exampleacc
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: LRS
 *   exampleStorageDefender:
 *     type: azure:securitycenter:StorageDefender
 *     name: example
 *     properties:
 *       storageAccountId: ${exampleAccount.id}
 * ```
 * 
 * ## Import
 * The setting can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:securitycenter/storageDefender:StorageDefender example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/storageacc
 * ```
 * @property malwareScanningOnUploadCapGbPerMonth The max GB to be scanned per Month. Must be `-1` or above `0`. Omit this property or set to `-1` if no capping is needed. Defaults to `-1`.
 * @property malwareScanningOnUploadEnabled Whether On Upload malware scanning should be enabled. Defaults to `false`.
 * @property overrideSubscriptionSettingsEnabled Whether the settings defined for this storage account should override the settings defined for the subscription. Defaults to `false`.
 * @property scanResultsEventGridTopicId The Event Grid Topic where every scan result will be sent to. When you set an Event Grid custom topic, you must set `override_subscription_settings_enabled` to `true` to override the subscription-level settings.
 * @property sensitiveDataDiscoveryEnabled Whether Sensitive Data Discovery should be enabled. Defaults to `false`.
 * @property storageAccountId The ID of the storage account the defender applied to. Changing this forces a new resource to be created.
 */
public data class StorageDefenderArgs(
    public val malwareScanningOnUploadCapGbPerMonth: Output? = null,
    public val malwareScanningOnUploadEnabled: Output? = null,
    public val overrideSubscriptionSettingsEnabled: Output? = null,
    public val scanResultsEventGridTopicId: Output? = null,
    public val sensitiveDataDiscoveryEnabled: Output? = null,
    public val storageAccountId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.securitycenter.StorageDefenderArgs =
        com.pulumi.azure.securitycenter.StorageDefenderArgs.builder()
            .malwareScanningOnUploadCapGbPerMonth(
                malwareScanningOnUploadCapGbPerMonth?.applyValue({ args0 ->
                    args0
                }),
            )
            .malwareScanningOnUploadEnabled(malwareScanningOnUploadEnabled?.applyValue({ args0 -> args0 }))
            .overrideSubscriptionSettingsEnabled(
                overrideSubscriptionSettingsEnabled?.applyValue({ args0 ->
                    args0
                }),
            )
            .scanResultsEventGridTopicId(scanResultsEventGridTopicId?.applyValue({ args0 -> args0 }))
            .sensitiveDataDiscoveryEnabled(sensitiveDataDiscoveryEnabled?.applyValue({ args0 -> args0 }))
            .storageAccountId(storageAccountId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [StorageDefenderArgs].
 */
@PulumiTagMarker
public class StorageDefenderArgsBuilder internal constructor() {
    private var malwareScanningOnUploadCapGbPerMonth: Output? = null

    private var malwareScanningOnUploadEnabled: Output? = null

    private var overrideSubscriptionSettingsEnabled: Output? = null

    private var scanResultsEventGridTopicId: Output? = null

    private var sensitiveDataDiscoveryEnabled: Output? = null

    private var storageAccountId: Output? = null

    /**
     * @param value The max GB to be scanned per Month. Must be `-1` or above `0`. Omit this property or set to `-1` if no capping is needed. Defaults to `-1`.
     */
    @JvmName("gmxsdhguxsqrpser")
    public suspend fun malwareScanningOnUploadCapGbPerMonth(`value`: Output) {
        this.malwareScanningOnUploadCapGbPerMonth = value
    }

    /**
     * @param value Whether On Upload malware scanning should be enabled. Defaults to `false`.
     */
    @JvmName("kenkhdkmjenqomgh")
    public suspend fun malwareScanningOnUploadEnabled(`value`: Output) {
        this.malwareScanningOnUploadEnabled = value
    }

    /**
     * @param value Whether the settings defined for this storage account should override the settings defined for the subscription. Defaults to `false`.
     */
    @JvmName("cgnawrahhlsobrgf")
    public suspend fun overrideSubscriptionSettingsEnabled(`value`: Output) {
        this.overrideSubscriptionSettingsEnabled = value
    }

    /**
     * @param value The Event Grid Topic where every scan result will be sent to. When you set an Event Grid custom topic, you must set `override_subscription_settings_enabled` to `true` to override the subscription-level settings.
     */
    @JvmName("hrxpbtuadvfcyrnq")
    public suspend fun scanResultsEventGridTopicId(`value`: Output) {
        this.scanResultsEventGridTopicId = value
    }

    /**
     * @param value Whether Sensitive Data Discovery should be enabled. Defaults to `false`.
     */
    @JvmName("sowesmkstgptljun")
    public suspend fun sensitiveDataDiscoveryEnabled(`value`: Output) {
        this.sensitiveDataDiscoveryEnabled = value
    }

    /**
     * @param value The ID of the storage account the defender applied to. Changing this forces a new resource to be created.
     */
    @JvmName("llcysbtehpsluptf")
    public suspend fun storageAccountId(`value`: Output) {
        this.storageAccountId = value
    }

    /**
     * @param value The max GB to be scanned per Month. Must be `-1` or above `0`. Omit this property or set to `-1` if no capping is needed. Defaults to `-1`.
     */
    @JvmName("klebwwseuefshimi")
    public suspend fun malwareScanningOnUploadCapGbPerMonth(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.malwareScanningOnUploadCapGbPerMonth = mapped
    }

    /**
     * @param value Whether On Upload malware scanning should be enabled. Defaults to `false`.
     */
    @JvmName("bqlbbpumvxuguwoo")
    public suspend fun malwareScanningOnUploadEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.malwareScanningOnUploadEnabled = mapped
    }

    /**
     * @param value Whether the settings defined for this storage account should override the settings defined for the subscription. Defaults to `false`.
     */
    @JvmName("sulwtmmneephilpg")
    public suspend fun overrideSubscriptionSettingsEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.overrideSubscriptionSettingsEnabled = mapped
    }

    /**
     * @param value The Event Grid Topic where every scan result will be sent to. When you set an Event Grid custom topic, you must set `override_subscription_settings_enabled` to `true` to override the subscription-level settings.
     */
    @JvmName("ejoikqnpscdguwyy")
    public suspend fun scanResultsEventGridTopicId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scanResultsEventGridTopicId = mapped
    }

    /**
     * @param value Whether Sensitive Data Discovery should be enabled. Defaults to `false`.
     */
    @JvmName("woegyloaofohffsf")
    public suspend fun sensitiveDataDiscoveryEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sensitiveDataDiscoveryEnabled = mapped
    }

    /**
     * @param value The ID of the storage account the defender applied to. Changing this forces a new resource to be created.
     */
    @JvmName("swduexxafxaaeeab")
    public suspend fun storageAccountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageAccountId = mapped
    }

    internal fun build(): StorageDefenderArgs = StorageDefenderArgs(
        malwareScanningOnUploadCapGbPerMonth = malwareScanningOnUploadCapGbPerMonth,
        malwareScanningOnUploadEnabled = malwareScanningOnUploadEnabled,
        overrideSubscriptionSettingsEnabled = overrideSubscriptionSettingsEnabled,
        scanResultsEventGridTopicId = scanResultsEventGridTopicId,
        sensitiveDataDiscoveryEnabled = sensitiveDataDiscoveryEnabled,
        storageAccountId = storageAccountId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy