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

com.pulumi.gcp.monitoring.kotlin.MonitoredProjectArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.monitoring.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.monitoring.MonitoredProjectArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * A [project being monitored](https://cloud.google.com/monitoring/settings/multiple-projects#create-multi) by a Metrics Scope.
 * To get more information about MonitoredProject, see:
 * * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v1/locations.global.metricsScopes.projects)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/monitoring/settings/manage-api)
 * ## Example Usage
 * ### Monitoring Monitored Project Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const basic = new gcp.organizations.Project("basic", {
 *     projectId: "m-id",
 *     name: "m-id-display",
 *     orgId: "123456789",
 * });
 * const primary = new gcp.monitoring.MonitoredProject("primary", {
 *     metricsScope: "my-project-name",
 *     name: basic.projectId,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * basic = gcp.organizations.Project("basic",
 *     project_id="m-id",
 *     name="m-id-display",
 *     org_id="123456789")
 * primary = gcp.monitoring.MonitoredProject("primary",
 *     metrics_scope="my-project-name",
 *     name=basic.project_id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var basic = new Gcp.Organizations.Project("basic", new()
 *     {
 *         ProjectId = "m-id",
 *         Name = "m-id-display",
 *         OrgId = "123456789",
 *     });
 *     var primary = new Gcp.Monitoring.MonitoredProject("primary", new()
 *     {
 *         MetricsScope = "my-project-name",
 *         Name = basic.ProjectId,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		basic, err := organizations.NewProject(ctx, "basic", &organizations.ProjectArgs{
 * 			ProjectId: pulumi.String("m-id"),
 * 			Name:      pulumi.String("m-id-display"),
 * 			OrgId:     pulumi.String("123456789"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewMonitoredProject(ctx, "primary", &monitoring.MonitoredProjectArgs{
 * 			MetricsScope: pulumi.String("my-project-name"),
 * 			Name:         basic.ProjectId,
 * 		})
 * 		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.gcp.organizations.Project;
 * import com.pulumi.gcp.organizations.ProjectArgs;
 * import com.pulumi.gcp.monitoring.MonitoredProject;
 * import com.pulumi.gcp.monitoring.MonitoredProjectArgs;
 * 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 basic = new Project("basic", ProjectArgs.builder()
 *             .projectId("m-id")
 *             .name("m-id-display")
 *             .orgId("123456789")
 *             .build());
 *         var primary = new MonitoredProject("primary", MonitoredProjectArgs.builder()
 *             .metricsScope("my-project-name")
 *             .name(basic.projectId())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   primary:
 *     type: gcp:monitoring:MonitoredProject
 *     properties:
 *       metricsScope: my-project-name
 *       name: ${basic.projectId}
 *   basic:
 *     type: gcp:organizations:Project
 *     properties:
 *       projectId: m-id
 *       name: m-id-display
 *       orgId: '123456789'
 * ```
 * 
 * ## Import
 * MonitoredProject can be imported using any of these accepted formats:
 * * `v1/locations/global/metricsScopes/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, MonitoredProject can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:monitoring/monitoredProject:MonitoredProject default v1/locations/global/metricsScopes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:monitoring/monitoredProject:MonitoredProject default {{name}}
 * ```
 * @property metricsScope Required. The resource name of the existing Metrics Scope that will monitor this project. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
 * - - -
 * @property name Immutable. The resource name of the `MonitoredProject`. On input, the resource name includes the scoping project ID and monitored project ID. On output, it contains the equivalent project numbers. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
 */
public data class MonitoredProjectArgs(
    public val metricsScope: Output? = null,
    public val name: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.monitoring.MonitoredProjectArgs =
        com.pulumi.gcp.monitoring.MonitoredProjectArgs.builder()
            .metricsScope(metricsScope?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [MonitoredProjectArgs].
 */
@PulumiTagMarker
public class MonitoredProjectArgsBuilder internal constructor() {
    private var metricsScope: Output? = null

    private var name: Output? = null

    /**
     * @param value Required. The resource name of the existing Metrics Scope that will monitor this project. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
     * - - -
     */
    @JvmName("ffbixtrogouvctbd")
    public suspend fun metricsScope(`value`: Output) {
        this.metricsScope = value
    }

    /**
     * @param value Immutable. The resource name of the `MonitoredProject`. On input, the resource name includes the scoping project ID and monitored project ID. On output, it contains the equivalent project numbers. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
     */
    @JvmName("okrxsibfexjhxdem")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Required. The resource name of the existing Metrics Scope that will monitor this project. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
     * - - -
     */
    @JvmName("pukfklrbggxveiev")
    public suspend fun metricsScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricsScope = mapped
    }

    /**
     * @param value Immutable. The resource name of the `MonitoredProject`. On input, the resource name includes the scoping project ID and monitored project ID. On output, it contains the equivalent project numbers. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
     */
    @JvmName("girsapxifemevdnw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    internal fun build(): MonitoredProjectArgs = MonitoredProjectArgs(
        metricsScope = metricsScope,
        name = name,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy