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

com.pulumi.azure.iot.kotlin.SecuritySolution.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.iot.kotlin

import com.pulumi.azure.iot.kotlin.outputs.SecuritySolutionAdditionalWorkspace
import com.pulumi.azure.iot.kotlin.outputs.SecuritySolutionRecommendationsEnabled
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.iot.kotlin.outputs.SecuritySolutionAdditionalWorkspace.Companion.toKotlin as securitySolutionAdditionalWorkspaceToKotlin
import com.pulumi.azure.iot.kotlin.outputs.SecuritySolutionRecommendationsEnabled.Companion.toKotlin as securitySolutionRecommendationsEnabledToKotlin

/**
 * Builder for [SecuritySolution].
 */
@PulumiTagMarker
public class SecuritySolutionResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: SecuritySolutionArgs = SecuritySolutionArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend SecuritySolutionArgsBuilder.() -> Unit) {
        val builder = SecuritySolutionArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): SecuritySolution {
        val builtJavaResource = com.pulumi.azure.iot.SecuritySolution(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return SecuritySolution(builtJavaResource)
    }
}

/**
 * Manages an iot security solution.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleIoTHub = new azure.iot.IoTHub("example", {
 *     name: "example-IoTHub",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: {
 *         name: "S1",
 *         capacity: 1,
 *     },
 * });
 * const exampleSecuritySolution = new azure.iot.SecuritySolution("example", {
 *     name: "example-Iot-Security-Solution",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     displayName: "Iot Security Solution",
 *     iothubIds: [exampleIoTHub.id],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_io_t_hub = azure.iot.IoTHub("example",
 *     name="example-IoTHub",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku={
 *         "name": "S1",
 *         "capacity": 1,
 *     })
 * example_security_solution = azure.iot.SecuritySolution("example",
 *     name="example-Iot-Security-Solution",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     display_name="Iot Security Solution",
 *     iothub_ids=[example_io_t_hub.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-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleIoTHub = new Azure.Iot.IoTHub("example", new()
 *     {
 *         Name = "example-IoTHub",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
 *         {
 *             Name = "S1",
 *             Capacity = 1,
 *         },
 *     });
 *     var exampleSecuritySolution = new Azure.Iot.SecuritySolution("example", new()
 *     {
 *         Name = "example-Iot-Security-Solution",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         DisplayName = "Iot Security Solution",
 *         IothubIds = new[]
 *         {
 *             exampleIoTHub.Id,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot"
 * 	"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-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleIoTHub, err := iot.NewIoTHub(ctx, "example", &iot.IoTHubArgs{
 * 			Name:              pulumi.String("example-IoTHub"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Sku: &iot.IoTHubSkuArgs{
 * 				Name:     pulumi.String("S1"),
 * 				Capacity: pulumi.Int(1),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = iot.NewSecuritySolution(ctx, "example", &iot.SecuritySolutionArgs{
 * 			Name:              pulumi.String("example-Iot-Security-Solution"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			DisplayName:       pulumi.String("Iot Security Solution"),
 * 			IothubIds: pulumi.StringArray{
 * 				exampleIoTHub.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.iot.IoTHub;
 * import com.pulumi.azure.iot.IoTHubArgs;
 * import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
 * import com.pulumi.azure.iot.SecuritySolution;
 * import com.pulumi.azure.iot.SecuritySolutionArgs;
 * 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-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
 *             .name("example-IoTHub")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sku(IoTHubSkuArgs.builder()
 *                 .name("S1")
 *                 .capacity("1")
 *                 .build())
 *             .build());
 *         var exampleSecuritySolution = new SecuritySolution("exampleSecuritySolution", SecuritySolutionArgs.builder()
 *             .name("example-Iot-Security-Solution")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .displayName("Iot Security Solution")
 *             .iothubIds(exampleIoTHub.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleIoTHub:
 *     type: azure:iot:IoTHub
 *     name: example
 *     properties:
 *       name: example-IoTHub
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       sku:
 *         name: S1
 *         capacity: '1'
 *   exampleSecuritySolution:
 *     type: azure:iot:SecuritySolution
 *     name: example
 *     properties:
 *       name: example-Iot-Security-Solution
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       displayName: Iot Security Solution
 *       iothubIds:
 *         - ${exampleIoTHub.id}
 * ```
 * 
 * ## Import
 * Iot Security Solution can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:iot/securitySolution:SecuritySolution example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Security/iotSecuritySolutions/solution1
 * ```
 */
public class SecuritySolution internal constructor(
    override val javaResource: com.pulumi.azure.iot.SecuritySolution,
) : KotlinCustomResource(javaResource, SecuritySolutionMapper) {
    /**
     * A `additional_workspace` block as defined below.
     */
    public val additionalWorkspaces: Output>?
        get() = javaResource.additionalWorkspaces().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        securitySolutionAdditionalWorkspaceToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * A list of disabled data sources for the Iot Security Solution. Possible value is `TwinData`.
     */
    public val disabledDataSources: Output>?
        get() = javaResource.disabledDataSources().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies the Display Name for this Iot Security Solution.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Is the Iot Security Solution enabled? Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A list of data which is to exported to analytic workspace. Valid values include `RawEvents`.
     */
    public val eventsToExports: Output>?
        get() = javaResource.eventsToExports().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies the IoT Hub resource IDs to which this Iot Security Solution is applied.
     */
    public val iothubIds: Output>
        get() = javaResource.iothubIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Specifies the Log Analytics Workspace ID to which the security data will be sent.
     */
    public val logAnalyticsWorkspaceId: Output?
        get() = javaResource.logAnalyticsWorkspaceId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Should IP addressed be unmasked in the log? Defaults to `false`.
     */
    public val logUnmaskedIpsEnabled: Output?
        get() = javaResource.logUnmaskedIpsEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the name of the Iot Security Solution. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * An Azure Resource Graph query used to set the resources monitored.
     */
    public val queryForResources: Output
        get() = javaResource.queryForResources().applyValue({ args0 -> args0 })

    /**
     * A list of subscription Ids on which the user defined resources query should be executed.
     */
    public val querySubscriptionIds: Output>
        get() = javaResource.querySubscriptionIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * A `recommendations_enabled` block of options to enable or disable as defined below.
     */
    public val recommendationsEnabled: Output
        get() = javaResource.recommendationsEnabled().applyValue({ args0 ->
            args0.let({ args0 ->
                securitySolutionRecommendationsEnabledToKotlin(args0)
            })
        })

    /**
     * Specifies the name of the resource group in which to create the Iot Security Solution. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object SecuritySolutionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.iot.SecuritySolution::class == javaResource::class

    override fun map(javaResource: Resource): SecuritySolution = SecuritySolution(
        javaResource as
            com.pulumi.azure.iot.SecuritySolution,
    )
}

/**
 * @see [SecuritySolution].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [SecuritySolution].
 */
public suspend fun securitySolution(
    name: String,
    block: suspend SecuritySolutionResourceBuilder.() -> Unit,
): SecuritySolution {
    val builder = SecuritySolutionResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [SecuritySolution].
 * @param name The _unique_ name of the resulting resource.
 */
public fun securitySolution(name: String): SecuritySolution {
    val builder = SecuritySolutionResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy