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

com.pulumi.azure.monitoring.kotlin.LogzMonitor.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.kotlin.outputs.LogzMonitorPlan
import com.pulumi.azure.monitoring.kotlin.outputs.LogzMonitorUser
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.Map
import com.pulumi.azure.monitoring.kotlin.outputs.LogzMonitorPlan.Companion.toKotlin as logzMonitorPlanToKotlin
import com.pulumi.azure.monitoring.kotlin.outputs.LogzMonitorUser.Companion.toKotlin as logzMonitorUserToKotlin

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

    public var args: LogzMonitorArgs = LogzMonitorArgs()

    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 LogzMonitorArgsBuilder.() -> Unit) {
        val builder = LogzMonitorArgsBuilder()
        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(): LogzMonitor {
        val builtJavaResource = com.pulumi.azure.monitoring.LogzMonitor(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return LogzMonitor(builtJavaResource)
    }
}

/**
 * Manages a logz Monitor.
 * !> **Note:** Logz REST API is being deprecated by Azure and new resources cannot be created. This resource will be removed in version 4.0 of the provider.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-logz",
 *     location: "West Europe",
 * });
 * const exampleLogzMonitor = new azure.monitoring.LogzMonitor("example", {
 *     name: "example-monitor",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     plan: {
 *         billingCycle: "MONTHLY",
 *         effectiveDate: "2022-06-06T00:00:00Z",
 *         usageType: "COMMITTED",
 *     },
 *     user: {
 *         email: "[email protected]",
 *         firstName: "Example",
 *         lastName: "User",
 *         phoneNumber: "+12313803556",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-logz",
 *     location="West Europe")
 * example_logz_monitor = azure.monitoring.LogzMonitor("example",
 *     name="example-monitor",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     plan={
 *         "billing_cycle": "MONTHLY",
 *         "effective_date": "2022-06-06T00:00:00Z",
 *         "usage_type": "COMMITTED",
 *     },
 *     user={
 *         "email": "[email protected]",
 *         "first_name": "Example",
 *         "last_name": "User",
 *         "phone_number": "+12313803556",
 *     })
 * ```
 * ```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-logz",
 *         Location = "West Europe",
 *     });
 *     var exampleLogzMonitor = new Azure.Monitoring.LogzMonitor("example", new()
 *     {
 *         Name = "example-monitor",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Plan = new Azure.Monitoring.Inputs.LogzMonitorPlanArgs
 *         {
 *             BillingCycle = "MONTHLY",
 *             EffectiveDate = "2022-06-06T00:00:00Z",
 *             UsageType = "COMMITTED",
 *         },
 *         User = new Azure.Monitoring.Inputs.LogzMonitorUserArgs
 *         {
 *             Email = "[email protected]",
 *             FirstName = "Example",
 *             LastName = "User",
 *             PhoneNumber = "+12313803556",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
 * 	"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-logz"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewLogzMonitor(ctx, "example", &monitoring.LogzMonitorArgs{
 * 			Name:              pulumi.String("example-monitor"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Plan: &monitoring.LogzMonitorPlanArgs{
 * 				BillingCycle:  pulumi.String("MONTHLY"),
 * 				EffectiveDate: pulumi.String("2022-06-06T00:00:00Z"),
 * 				UsageType:     pulumi.String("COMMITTED"),
 * 			},
 * 			User: &monitoring.LogzMonitorUserArgs{
 * 				Email:       pulumi.String("[email protected]"),
 * 				FirstName:   pulumi.String("Example"),
 * 				LastName:    pulumi.String("User"),
 * 				PhoneNumber: pulumi.String("+12313803556"),
 * 			},
 * 		})
 * 		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.monitoring.LogzMonitor;
 * import com.pulumi.azure.monitoring.LogzMonitorArgs;
 * import com.pulumi.azure.monitoring.inputs.LogzMonitorPlanArgs;
 * import com.pulumi.azure.monitoring.inputs.LogzMonitorUserArgs;
 * 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-logz")
 *             .location("West Europe")
 *             .build());
 *         var exampleLogzMonitor = new LogzMonitor("exampleLogzMonitor", LogzMonitorArgs.builder()
 *             .name("example-monitor")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .plan(LogzMonitorPlanArgs.builder()
 *                 .billingCycle("MONTHLY")
 *                 .effectiveDate("2022-06-06T00:00:00Z")
 *                 .usageType("COMMITTED")
 *                 .build())
 *             .user(LogzMonitorUserArgs.builder()
 *                 .email("[email protected]")
 *                 .firstName("Example")
 *                 .lastName("User")
 *                 .phoneNumber("+12313803556")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-logz
 *       location: West Europe
 *   exampleLogzMonitor:
 *     type: azure:monitoring:LogzMonitor
 *     name: example
 *     properties:
 *       name: example-monitor
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       plan:
 *         billingCycle: MONTHLY
 *         effectiveDate: 2022-06-06T00:00:00Z
 *         usageType: COMMITTED
 *       user:
 *         email: [email protected]
 *         firstName: Example
 *         lastName: User
 *         phoneNumber: '+12313803556'
 * ```
 * 
 * ## Import
 * logz Monitors can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/logzMonitor:LogzMonitor example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logz/monitors/monitor1
 * ```
 */
public class LogzMonitor internal constructor(
    override val javaResource: com.pulumi.azure.monitoring.LogzMonitor,
) : KotlinCustomResource(javaResource, LogzMonitorMapper) {
    /**
     * Name of the Logz organization. Changing this forces a new logz Monitor to be created.
     */
    public val companyName: Output?
        get() = javaResource.companyName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Whether the resource monitoring is enabled? Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID of the Enterprise App. Changing this forces a new logz Monitor to be created.
     * > **NOTE** Please follow [Set up Logz.io single sign-on](https://docs.microsoft.com/azure/partner-solutions/logzio/setup-sso) to create the ID of the Enterprise App.
     */
    public val enterpriseAppId: Output?
        get() = javaResource.enterpriseAppId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Azure Region where the logz Monitor should exist. Changing this forces a new logz Monitor to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The ID associated with the logz organization of this logz Monitor.
     */
    public val logzOrganizationId: Output
        get() = javaResource.logzOrganizationId().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this logz Monitor. Changing this forces a new logz Monitor to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * A `plan` block as defined below. Changing this forces a new resource to be created.
     */
    public val plan: Output
        get() = javaResource.plan().applyValue({ args0 ->
            args0.let({ args0 ->
                logzMonitorPlanToKotlin(args0)
            })
        })

    /**
     * The name of the Resource Group where the logz Monitor should exist. Changing this forces a new logz Monitor to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * The single sign on url associated with the logz organization of this logz Monitor.
     */
    public val singleSignOnUrl: Output
        get() = javaResource.singleSignOnUrl().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the logz Monitor.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A `user` block as defined below. Changing this forces a new resource to be created.
     */
    public val user: Output
        get() = javaResource.user().applyValue({ args0 ->
            args0.let({ args0 ->
                logzMonitorUserToKotlin(args0)
            })
        })
}

public object LogzMonitorMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.monitoring.LogzMonitor::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy