com.pulumi.azure.datadog.kotlin.MonitorArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.datadog.kotlin
import com.pulumi.azure.datadog.MonitorArgs.builder
import com.pulumi.azure.datadog.kotlin.inputs.MonitorDatadogOrganizationArgs
import com.pulumi.azure.datadog.kotlin.inputs.MonitorDatadogOrganizationArgsBuilder
import com.pulumi.azure.datadog.kotlin.inputs.MonitorIdentityArgs
import com.pulumi.azure.datadog.kotlin.inputs.MonitorIdentityArgsBuilder
import com.pulumi.azure.datadog.kotlin.inputs.MonitorUserArgs
import com.pulumi.azure.datadog.kotlin.inputs.MonitorUserArgsBuilder
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 datadog Monitor.
* ## Example Usage
* ### Monitor creation with linking to Datadog organization
*
* ```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",
* },
* });
* ```
* ```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=azure.datadog.MonitorDatadogOrganizationArgs(
* api_key="XXXX",
* application_key="XXXX",
* ),
* user=azure.datadog.MonitorUserArgs(
* name="Example",
* email="[email protected]",
* ),
* sku_name="Linked",
* identity=azure.datadog.MonitorIdentityArgs(
* type="SystemAssigned",
* ))
* ```
* ```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",
* },
* });
* });
* ```
* ```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
* }
* _, 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
* }
* 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 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());
* }
* }
* ```
* ```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
* ```
*
* ## Role Assignment
* To enable metrics flow, perform role assignment on the identity created above. `Monitoring reader(43d0d8ad-25c7-4714-9337-8ba259a9fe05)` role is required .
* ### Role assignment on the monitor created
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const primary = azure.core.getSubscription({});
* const monitoringReader = azure.authorization.getRoleDefinition({
* name: "Monitoring Reader",
* });
* const example = new azure.authorization.Assignment("example", {
* scope: primary.then(primary => primary.id),
* roleDefinitionId: monitoringReader.then(monitoringReader => monitoringReader.roleDefinitionId),
* principalId: exampleAzurermDatadogMonitor.identity[0].principalId,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* primary = azure.core.get_subscription()
* monitoring_reader = azure.authorization.get_role_definition(name="Monitoring Reader")
* example = azure.authorization.Assignment("example",
* scope=primary.id,
* role_definition_id=monitoring_reader.role_definition_id,
* principal_id=example_azurerm_datadog_monitor["identity"][0]["principalId"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var primary = Azure.Core.GetSubscription.Invoke();
* var monitoringReader = Azure.Authorization.GetRoleDefinition.Invoke(new()
* {
* Name = "Monitoring Reader",
* });
* var example = new Azure.Authorization.Assignment("example", new()
* {
* Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id),
* RoleDefinitionId = monitoringReader.Apply(getRoleDefinitionResult => getRoleDefinitionResult.RoleDefinitionId),
* PrincipalId = exampleAzurermDatadogMonitor.Identity[0].PrincipalId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* primary, err := core.LookupSubscription(ctx, nil, nil)
* if err != nil {
* return err
* }
* monitoringReader, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{
* Name: pulumi.StringRef("Monitoring Reader"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
* Scope: pulumi.String(primary.Id),
* RoleDefinitionId: pulumi.String(monitoringReader.RoleDefinitionId),
* PrincipalId: pulumi.Any(exampleAzurermDatadogMonitor.Identity[0].PrincipalId),
* })
* 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.CoreFunctions;
* import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
* import com.pulumi.azure.authorization.AuthorizationFunctions;
* import com.pulumi.azure.authorization.inputs.GetRoleDefinitionArgs;
* import com.pulumi.azure.authorization.Assignment;
* import com.pulumi.azure.authorization.AssignmentArgs;
* 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) {
* final var primary = CoreFunctions.getSubscription();
* final var monitoringReader = AuthorizationFunctions.getRoleDefinition(GetRoleDefinitionArgs.builder()
* .name("Monitoring Reader")
* .build());
* var example = new Assignment("example", AssignmentArgs.builder()
* .scope(primary.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
* .roleDefinitionId(monitoringReader.applyValue(getRoleDefinitionResult -> getRoleDefinitionResult.roleDefinitionId()))
* .principalId(exampleAzurermDatadogMonitor.identity()[0].principalId())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:authorization:Assignment
* properties:
* scope: ${primary.id}
* roleDefinitionId: ${monitoringReader.roleDefinitionId}
* principalId: ${exampleAzurermDatadogMonitor.identity[0].principalId}
* variables:
* primary:
* fn::invoke:
* Function: azure:core:getSubscription
* Arguments: {}
* monitoringReader:
* fn::invoke:
* Function: azure:authorization:getRoleDefinition
* Arguments:
* name: Monitoring Reader
* ```
*
* ## Import
* Datadog Monitors can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:datadog/monitor:Monitor example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Datadog/monitors/monitor1
* ```
* @property datadogOrganization A `datadog_organization` block as defined below.
* @property identity A `identity` block as defined below.
* @property location The Azure Region where the Datadog Monitor should exist. Changing this forces a new Datadog Monitor to be created.
* @property monitoringEnabled Is monitoring enabled? Defaults to `true`.
* @property name The name of the user that will be associated with the Datadog Monitor. Changing this forces a new Datadog Monitor to be created.
* @property resourceGroupName The name of the Resource Group where the Datadog Monitor should exist. Changing this forces a new Datadog Monitor to be created.
* @property skuName The name which should be used for this sku.
* @property tags A mapping of tags which should be assigned to the Datadog Monitor.
* @property user A `user` block as defined below.
*/
public data class MonitorArgs(
public val datadogOrganization: Output? = null,
public val identity: Output? = null,
public val location: Output? = null,
public val monitoringEnabled: Output? = null,
public val name: Output? = null,
public val resourceGroupName: Output? = null,
public val skuName: Output? = null,
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy