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

com.pulumi.azure.datadog.kotlin.MonitorSsoConfiguration.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.datadog.kotlin

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

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

    public var args: MonitorSsoConfigurationArgs = MonitorSsoConfigurationArgs()

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

/**
 * Manages SingleSignOn on the datadog Monitor.
 * ## Example Usage
 * ### Enabling SSO on monitor
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-datadog",
 *     location: "West US 2",
 * });
 * const exampleMonitor = new azure.datadog.Monitor("example", {
 *     name: "example-monitor",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     datadogOrganization: {
 *         apiKey: "XXXX",
 *         applicationKey: "XXXX",
 *     },
 *     user: {
 *         name: "Example",
 *         email: "[email protected]",
 *     },
 *     skuName: "Linked",
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleMonitorSsoConfiguration = new azure.datadog.MonitorSsoConfiguration("example", {
 *     datadogMonitorId: exampleMonitor.id,
 *     singleSignOnEnabled: "Enable",
 *     enterpriseApplicationId: "XXXX",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-datadog",
 *     location="West US 2")
 * example_monitor = azure.datadog.Monitor("example",
 *     name="example-monitor",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     datadog_organization={
 *         "api_key": "XXXX",
 *         "application_key": "XXXX",
 *     },
 *     user={
 *         "name": "Example",
 *         "email": "[email protected]",
 *     },
 *     sku_name="Linked",
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * example_monitor_sso_configuration = azure.datadog.MonitorSsoConfiguration("example",
 *     datadog_monitor_id=example_monitor.id,
 *     single_sign_on_enabled="Enable",
 *     enterprise_application_id="XXXX")
 * ```
 * ```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-datadog",
 *         Location = "West US 2",
 *     });
 *     var exampleMonitor = new Azure.Datadog.Monitor("example", new()
 *     {
 *         Name = "example-monitor",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         DatadogOrganization = new Azure.Datadog.Inputs.MonitorDatadogOrganizationArgs
 *         {
 *             ApiKey = "XXXX",
 *             ApplicationKey = "XXXX",
 *         },
 *         User = new Azure.Datadog.Inputs.MonitorUserArgs
 *         {
 *             Name = "Example",
 *             Email = "[email protected]",
 *         },
 *         SkuName = "Linked",
 *         Identity = new Azure.Datadog.Inputs.MonitorIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleMonitorSsoConfiguration = new Azure.Datadog.MonitorSsoConfiguration("example", new()
 *     {
 *         DatadogMonitorId = exampleMonitor.Id,
 *         SingleSignOnEnabled = "Enable",
 *         EnterpriseApplicationId = "XXXX",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datadog"
 * 	"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-datadog"),
 * 			Location: pulumi.String("West US 2"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleMonitor, err := datadog.NewMonitor(ctx, "example", &datadog.MonitorArgs{
 * 			Name:              pulumi.String("example-monitor"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			DatadogOrganization: &datadog.MonitorDatadogOrganizationArgs{
 * 				ApiKey:         pulumi.String("XXXX"),
 * 				ApplicationKey: pulumi.String("XXXX"),
 * 			},
 * 			User: &datadog.MonitorUserArgs{
 * 				Name:  pulumi.String("Example"),
 * 				Email: pulumi.String("[email protected]"),
 * 			},
 * 			SkuName: pulumi.String("Linked"),
 * 			Identity: &datadog.MonitorIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datadog.NewMonitorSsoConfiguration(ctx, "example", &datadog.MonitorSsoConfigurationArgs{
 * 			DatadogMonitorId:        exampleMonitor.ID(),
 * 			SingleSignOnEnabled:     pulumi.String("Enable"),
 * 			EnterpriseApplicationId: pulumi.String("XXXX"),
 * 		})
 * 		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.datadog.Monitor;
 * import com.pulumi.azure.datadog.MonitorArgs;
 * import com.pulumi.azure.datadog.inputs.MonitorDatadogOrganizationArgs;
 * import com.pulumi.azure.datadog.inputs.MonitorUserArgs;
 * import com.pulumi.azure.datadog.inputs.MonitorIdentityArgs;
 * import com.pulumi.azure.datadog.MonitorSsoConfiguration;
 * import com.pulumi.azure.datadog.MonitorSsoConfigurationArgs;
 * 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-datadog")
 *             .location("West US 2")
 *             .build());
 *         var exampleMonitor = new Monitor("exampleMonitor", MonitorArgs.builder()
 *             .name("example-monitor")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .datadogOrganization(MonitorDatadogOrganizationArgs.builder()
 *                 .apiKey("XXXX")
 *                 .applicationKey("XXXX")
 *                 .build())
 *             .user(MonitorUserArgs.builder()
 *                 .name("Example")
 *                 .email("[email protected]")
 *                 .build())
 *             .skuName("Linked")
 *             .identity(MonitorIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleMonitorSsoConfiguration = new MonitorSsoConfiguration("exampleMonitorSsoConfiguration", MonitorSsoConfigurationArgs.builder()
 *             .datadogMonitorId(exampleMonitor.id())
 *             .singleSignOnEnabled("Enable")
 *             .enterpriseApplicationId("XXXX")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-datadog
 *       location: West US 2
 *   exampleMonitor:
 *     type: azure:datadog:Monitor
 *     name: example
 *     properties:
 *       name: example-monitor
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       datadogOrganization:
 *         apiKey: XXXX
 *         applicationKey: XXXX
 *       user:
 *         name: Example
 *         email: [email protected]
 *       skuName: Linked
 *       identity:
 *         type: SystemAssigned
 *   exampleMonitorSsoConfiguration:
 *     type: azure:datadog:MonitorSsoConfiguration
 *     name: example
 *     properties:
 *       datadogMonitorId: ${exampleMonitor.id}
 *       singleSignOnEnabled: Enable
 *       enterpriseApplicationId: XXXX
 * ```
 * 
 * ## Import
 * SingleSignOn on the Datadog Monitor can be imported using the `signle sign on resource id`, e.g.
 * ```sh
 * $ pulumi import azure:datadog/monitorSsoConfiguration:MonitorSsoConfiguration example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Datadog/monitors/monitor1/singleSignOnConfigurations/default
 * ```
 */
public class MonitorSsoConfiguration internal constructor(
    override val javaResource: com.pulumi.azure.datadog.MonitorSsoConfiguration,
) : KotlinCustomResource(javaResource, MonitorSsoConfigurationMapper) {
    /**
     * The Datadog Monitor Id which should be used for this Datadog Monitor SSO Configuration. Changing this forces a new Datadog Monitor SSO Configuration to be created.
     */
    public val datadogMonitorId: Output
        get() = javaResource.datadogMonitorId().applyValue({ args0 -> args0 })

    /**
     * The application Id to perform SSO operation.
     */
    public val enterpriseApplicationId: Output
        get() = javaResource.enterpriseApplicationId().applyValue({ args0 -> args0 })

    /**
     * The SingleSignOn URL to login to Datadog org.
     */
    public val loginUrl: Output
        get() = javaResource.loginUrl().applyValue({ args0 -> args0 })

    /**
     * The name of the SingleSignOn configuration. Defaults to `default`.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The state of SingleSignOn configuration. Possible values are `Enable` and `Disable`.
     */
    public val singleSignOnEnabled: Output
        get() = javaResource.singleSignOnEnabled().applyValue({ args0 -> args0 })
}

public object MonitorSsoConfigurationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.datadog.MonitorSsoConfiguration::class == javaResource::class

    override fun map(javaResource: Resource): MonitorSsoConfiguration =
        MonitorSsoConfiguration(javaResource as com.pulumi.azure.datadog.MonitorSsoConfiguration)
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy