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

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

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

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.LogzSubAccountArgs.builder
import com.pulumi.azure.monitoring.kotlin.inputs.LogzSubAccountUserArgs
import com.pulumi.azure.monitoring.kotlin.inputs.LogzSubAccountUserArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a logz Sub Account.
 * !> **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",
 *     },
 * });
 * const exampleLogzSubAccount = new azure.monitoring.LogzSubAccount("example", {
 *     name: "example-subaccount",
 *     logzMonitorId: exampleLogzMonitor.id,
 *     user: {
 *         email: exampleLogzMonitor.user.apply(user => user.email),
 *         firstName: exampleLogzMonitor.user.apply(user => user.firstName),
 *         lastName: exampleLogzMonitor.user.apply(user => user.lastName),
 *         phoneNumber: exampleLogzMonitor.user.apply(user => user.phoneNumber),
 *     },
 * });
 * ```
 * ```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",
 *     })
 * example_logz_sub_account = azure.monitoring.LogzSubAccount("example",
 *     name="example-subaccount",
 *     logz_monitor_id=example_logz_monitor.id,
 *     user={
 *         "email": example_logz_monitor.user.email,
 *         "first_name": example_logz_monitor.user.first_name,
 *         "last_name": example_logz_monitor.user.last_name,
 *         "phone_number": example_logz_monitor.user.phone_number,
 *     })
 * ```
 * ```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",
 *         },
 *     });
 *     var exampleLogzSubAccount = new Azure.Monitoring.LogzSubAccount("example", new()
 *     {
 *         Name = "example-subaccount",
 *         LogzMonitorId = exampleLogzMonitor.Id,
 *         User = new Azure.Monitoring.Inputs.LogzSubAccountUserArgs
 *         {
 *             Email = exampleLogzMonitor.User.Apply(user => user.Email),
 *             FirstName = exampleLogzMonitor.User.Apply(user => user.FirstName),
 *             LastName = exampleLogzMonitor.User.Apply(user => user.LastName),
 *             PhoneNumber = exampleLogzMonitor.User.Apply(user => user.PhoneNumber),
 *         },
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleLogzMonitor, 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
 * 		}
 * 		_, err = monitoring.NewLogzSubAccount(ctx, "example", &monitoring.LogzSubAccountArgs{
 * 			Name:          pulumi.String("example-subaccount"),
 * 			LogzMonitorId: exampleLogzMonitor.ID(),
 * 			User: &monitoring.LogzSubAccountUserArgs{
 * 				Email: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) {
 * 					return &user.Email, nil
 * 				}).(pulumi.StringPtrOutput),
 * 				FirstName: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) {
 * 					return &user.FirstName, nil
 * 				}).(pulumi.StringPtrOutput),
 * 				LastName: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) {
 * 					return &user.LastName, nil
 * 				}).(pulumi.StringPtrOutput),
 * 				PhoneNumber: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) {
 * 					return &user.PhoneNumber, nil
 * 				}).(pulumi.StringPtrOutput),
 * 			},
 * 		})
 * 		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 com.pulumi.azure.monitoring.LogzSubAccount;
 * import com.pulumi.azure.monitoring.LogzSubAccountArgs;
 * import com.pulumi.azure.monitoring.inputs.LogzSubAccountUserArgs;
 * 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());
 *         var exampleLogzSubAccount = new LogzSubAccount("exampleLogzSubAccount", LogzSubAccountArgs.builder()
 *             .name("example-subaccount")
 *             .logzMonitorId(exampleLogzMonitor.id())
 *             .user(LogzSubAccountUserArgs.builder()
 *                 .email(exampleLogzMonitor.user().applyValue(user -> user.email()))
 *                 .firstName(exampleLogzMonitor.user().applyValue(user -> user.firstName()))
 *                 .lastName(exampleLogzMonitor.user().applyValue(user -> user.lastName()))
 *                 .phoneNumber(exampleLogzMonitor.user().applyValue(user -> user.phoneNumber()))
 *                 .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'
 *   exampleLogzSubAccount:
 *     type: azure:monitoring:LogzSubAccount
 *     name: example
 *     properties:
 *       name: example-subaccount
 *       logzMonitorId: ${exampleLogzMonitor.id}
 *       user:
 *         email: ${exampleLogzMonitor.user.email}
 *         firstName: ${exampleLogzMonitor.user.firstName}
 *         lastName: ${exampleLogzMonitor.user.lastName}
 *         phoneNumber: ${exampleLogzMonitor.user.phoneNumber}
 * ```
 * 
 * ## Import
 * logz SubAccounts can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/logzSubAccount:LogzSubAccount example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logz/monitors/monitor1/accounts/subAccount1
 * ```
 * @property enabled Whether the resource monitoring is enabled? Defaults to `true`.
 * @property logzMonitorId The ID of the Logz Monitor. Changing this forces a new logz Sub Account to be created.
 * @property name The name which should be used for this logz Sub Account. Possible values must be between 1 and 32 characters in length and may contain only letters, numbers, hyphens and underscores. Changing this forces a new logz Sub Account to be created.
 * @property tags A mapping of tags which should be assigned to the logz Sub Account.
 * @property user A `user` block as defined below. Changing this forces a new resource to be created.
 */
public data class LogzSubAccountArgs(
    public val enabled: Output? = null,
    public val logzMonitorId: Output? = null,
    public val name: Output? = null,
    public val tags: Output>? = null,
    public val user: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.LogzSubAccountArgs =
        com.pulumi.azure.monitoring.LogzSubAccountArgs.builder()
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .logzMonitorId(logzMonitorId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .user(user?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [LogzSubAccountArgs].
 */
@PulumiTagMarker
public class LogzSubAccountArgsBuilder internal constructor() {
    private var enabled: Output? = null

    private var logzMonitorId: Output? = null

    private var name: Output? = null

    private var tags: Output>? = null

    private var user: Output? = null

    /**
     * @param value Whether the resource monitoring is enabled? Defaults to `true`.
     */
    @JvmName("ygkdcytxbuqhtjfp")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value The ID of the Logz Monitor. Changing this forces a new logz Sub Account to be created.
     */
    @JvmName("nabfweaeeaeiuuet")
    public suspend fun logzMonitorId(`value`: Output) {
        this.logzMonitorId = value
    }

    /**
     * @param value The name which should be used for this logz Sub Account. Possible values must be between 1 and 32 characters in length and may contain only letters, numbers, hyphens and underscores. Changing this forces a new logz Sub Account to be created.
     */
    @JvmName("gcbmemddblqmtgwl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the logz Sub Account.
     */
    @JvmName("dkokocveqaycjrwg")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A `user` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("quhtuiwmrevilcml")
    public suspend fun user(`value`: Output) {
        this.user = value
    }

    /**
     * @param value Whether the resource monitoring is enabled? Defaults to `true`.
     */
    @JvmName("wnrutxemqfhpqnaa")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value The ID of the Logz Monitor. Changing this forces a new logz Sub Account to be created.
     */
    @JvmName("cnmhsveerrkpumyv")
    public suspend fun logzMonitorId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logzMonitorId = mapped
    }

    /**
     * @param value The name which should be used for this logz Sub Account. Possible values must be between 1 and 32 characters in length and may contain only letters, numbers, hyphens and underscores. Changing this forces a new logz Sub Account to be created.
     */
    @JvmName("ybwxmrqevpoiqldr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the logz Sub Account.
     */
    @JvmName("ixmxfewvbskntutd")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the logz Sub Account.
     */
    @JvmName("xtpoxrvpfuitbwdf")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value A `user` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("gqifoleoqtehogeb")
    public suspend fun user(`value`: LogzSubAccountUserArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.user = mapped
    }

    /**
     * @param argument A `user` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("rwefpvqbvmydnjxg")
    public suspend fun user(argument: suspend LogzSubAccountUserArgsBuilder.() -> Unit) {
        val toBeMapped = LogzSubAccountUserArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.user = mapped
    }

    internal fun build(): LogzSubAccountArgs = LogzSubAccountArgs(
        enabled = enabled,
        logzMonitorId = logzMonitorId,
        name = name,
        tags = tags,
        user = user,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy