1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. monitoring
  5. CustomService
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.monitoring.CustomService

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    A Service is a discrete, autonomous, and network-accessible unit, designed to solve an individual concern. In Cloud Monitoring, a Service acts as the root resource under which operational aspects of the service are accessible

    To get more information about Service, see:

    Example Usage

    Monitoring Service Custom

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom = new gcp.monitoring.CustomService("custom", {
        serviceId: "custom-srv",
        displayName: "My Custom Service custom-srv",
        telemetry: {
            resourceName: "//product.googleapis.com/foo/foo/services/test",
        },
        userLabels: {
            my_key: "my_value",
            my_other_key: "my_other_value",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom = gcp.monitoring.CustomService("custom",
        service_id="custom-srv",
        display_name="My Custom Service custom-srv",
        telemetry={
            "resource_name": "//product.googleapis.com/foo/foo/services/test",
        },
        user_labels={
            "my_key": "my_value",
            "my_other_key": "my_other_value",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/monitoring"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := monitoring.NewCustomService(ctx, "custom", &monitoring.CustomServiceArgs{
    			ServiceId:   pulumi.String("custom-srv"),
    			DisplayName: pulumi.String("My Custom Service custom-srv"),
    			Telemetry: &monitoring.CustomServiceTelemetryArgs{
    				ResourceName: pulumi.String("//product.googleapis.com/foo/foo/services/test"),
    			},
    			UserLabels: pulumi.StringMap{
    				"my_key":       pulumi.String("my_value"),
    				"my_other_key": pulumi.String("my_other_value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var custom = new Gcp.Monitoring.CustomService("custom", new()
        {
            ServiceId = "custom-srv",
            DisplayName = "My Custom Service custom-srv",
            Telemetry = new Gcp.Monitoring.Inputs.CustomServiceTelemetryArgs
            {
                ResourceName = "//product.googleapis.com/foo/foo/services/test",
            },
            UserLabels = 
            {
                { "my_key", "my_value" },
                { "my_other_key", "my_other_value" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.monitoring.CustomService;
    import com.pulumi.gcp.monitoring.CustomServiceArgs;
    import com.pulumi.gcp.monitoring.inputs.CustomServiceTelemetryArgs;
    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 custom = new CustomService("custom", CustomServiceArgs.builder()
                .serviceId("custom-srv")
                .displayName("My Custom Service custom-srv")
                .telemetry(CustomServiceTelemetryArgs.builder()
                    .resourceName("//product.googleapis.com/foo/foo/services/test")
                    .build())
                .userLabels(Map.ofEntries(
                    Map.entry("my_key", "my_value"),
                    Map.entry("my_other_key", "my_other_value")
                ))
                .build());
    
        }
    }
    
    resources:
      custom:
        type: gcp:monitoring:CustomService
        properties:
          serviceId: custom-srv
          displayName: My Custom Service custom-srv
          telemetry:
            resourceName: //product.googleapis.com/foo/foo/services/test
          userLabels:
            my_key: my_value
            my_other_key: my_other_value
    

    Create CustomService Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CustomService(name: string, args?: CustomServiceArgs, opts?: CustomResourceOptions);
    @overload
    def CustomService(resource_name: str,
                      args: Optional[CustomServiceArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomService(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      display_name: Optional[str] = None,
                      project: Optional[str] = None,
                      service_id: Optional[str] = None,
                      telemetry: Optional[CustomServiceTelemetryArgs] = None,
                      user_labels: Optional[Mapping[str, str]] = None)
    func NewCustomService(ctx *Context, name string, args *CustomServiceArgs, opts ...ResourceOption) (*CustomService, error)
    public CustomService(string name, CustomServiceArgs? args = null, CustomResourceOptions? opts = null)
    public CustomService(String name, CustomServiceArgs args)
    public CustomService(String name, CustomServiceArgs args, CustomResourceOptions options)
    
    type: gcp:monitoring:CustomService
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CustomServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CustomServiceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CustomServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomServiceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var customServiceResource = new Gcp.Monitoring.CustomService("customServiceResource", new()
    {
        DisplayName = "string",
        Project = "string",
        ServiceId = "string",
        Telemetry = new Gcp.Monitoring.Inputs.CustomServiceTelemetryArgs
        {
            ResourceName = "string",
        },
        UserLabels = 
        {
            { "string", "string" },
        },
    });
    
    example, err := monitoring.NewCustomService(ctx, "customServiceResource", &monitoring.CustomServiceArgs{
    	DisplayName: pulumi.String("string"),
    	Project:     pulumi.String("string"),
    	ServiceId:   pulumi.String("string"),
    	Telemetry: &monitoring.CustomServiceTelemetryArgs{
    		ResourceName: pulumi.String("string"),
    	},
    	UserLabels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var customServiceResource = new CustomService("customServiceResource", CustomServiceArgs.builder()
        .displayName("string")
        .project("string")
        .serviceId("string")
        .telemetry(CustomServiceTelemetryArgs.builder()
            .resourceName("string")
            .build())
        .userLabels(Map.of("string", "string"))
        .build());
    
    custom_service_resource = gcp.monitoring.CustomService("customServiceResource",
        display_name="string",
        project="string",
        service_id="string",
        telemetry={
            "resourceName": "string",
        },
        user_labels={
            "string": "string",
        })
    
    const customServiceResource = new gcp.monitoring.CustomService("customServiceResource", {
        displayName: "string",
        project: "string",
        serviceId: "string",
        telemetry: {
            resourceName: "string",
        },
        userLabels: {
            string: "string",
        },
    });
    
    type: gcp:monitoring:CustomService
    properties:
        displayName: string
        project: string
        serviceId: string
        telemetry:
            resourceName: string
        userLabels:
            string: string
    

    CustomService Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The CustomService resource accepts the following input properties:

    DisplayName string
    Name used for UI elements listing this Service.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ServiceId string
    An optional service ID to use. If not given, the server will generate a service ID.
    Telemetry CustomServiceTelemetry
    Configuration for how to query telemetry on a Service. Structure is documented below.
    UserLabels Dictionary<string, string>
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    DisplayName string
    Name used for UI elements listing this Service.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ServiceId string
    An optional service ID to use. If not given, the server will generate a service ID.
    Telemetry CustomServiceTelemetryArgs
    Configuration for how to query telemetry on a Service. Structure is documented below.
    UserLabels map[string]string
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    displayName String
    Name used for UI elements listing this Service.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    serviceId String
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry CustomServiceTelemetry
    Configuration for how to query telemetry on a Service. Structure is documented below.
    userLabels Map<String,String>
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    displayName string
    Name used for UI elements listing this Service.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    serviceId string
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry CustomServiceTelemetry
    Configuration for how to query telemetry on a Service. Structure is documented below.
    userLabels {[key: string]: string}
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    display_name str
    Name used for UI elements listing this Service.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    service_id str
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry CustomServiceTelemetryArgs
    Configuration for how to query telemetry on a Service. Structure is documented below.
    user_labels Mapping[str, str]
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    displayName String
    Name used for UI elements listing this Service.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    serviceId String
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry Property Map
    Configuration for how to query telemetry on a Service. Structure is documented below.
    userLabels Map<String>
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CustomService resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].

    Look up Existing CustomService Resource

    Get an existing CustomService resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CustomServiceState, opts?: CustomResourceOptions): CustomService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            display_name: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            service_id: Optional[str] = None,
            telemetry: Optional[CustomServiceTelemetryArgs] = None,
            user_labels: Optional[Mapping[str, str]] = None) -> CustomService
    func GetCustomService(ctx *Context, name string, id IDInput, state *CustomServiceState, opts ...ResourceOption) (*CustomService, error)
    public static CustomService Get(string name, Input<string> id, CustomServiceState? state, CustomResourceOptions? opts = null)
    public static CustomService get(String name, Output<String> id, CustomServiceState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DisplayName string
    Name used for UI elements listing this Service.
    Name string
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ServiceId string
    An optional service ID to use. If not given, the server will generate a service ID.
    Telemetry CustomServiceTelemetry
    Configuration for how to query telemetry on a Service. Structure is documented below.
    UserLabels Dictionary<string, string>
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    DisplayName string
    Name used for UI elements listing this Service.
    Name string
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ServiceId string
    An optional service ID to use. If not given, the server will generate a service ID.
    Telemetry CustomServiceTelemetryArgs
    Configuration for how to query telemetry on a Service. Structure is documented below.
    UserLabels map[string]string
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    displayName String
    Name used for UI elements listing this Service.
    name String
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    serviceId String
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry CustomServiceTelemetry
    Configuration for how to query telemetry on a Service. Structure is documented below.
    userLabels Map<String,String>
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    displayName string
    Name used for UI elements listing this Service.
    name string
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    serviceId string
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry CustomServiceTelemetry
    Configuration for how to query telemetry on a Service. Structure is documented below.
    userLabels {[key: string]: string}
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    display_name str
    Name used for UI elements listing this Service.
    name str
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    service_id str
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry CustomServiceTelemetryArgs
    Configuration for how to query telemetry on a Service. Structure is documented below.
    user_labels Mapping[str, str]
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
    displayName String
    Name used for UI elements listing this Service.
    name String
    The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    serviceId String
    An optional service ID to use. If not given, the server will generate a service ID.
    telemetry Property Map
    Configuration for how to query telemetry on a Service. Structure is documented below.
    userLabels Map<String>
    Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.

    Supporting Types

    CustomServiceTelemetry, CustomServiceTelemetryArgs

    ResourceName string
    The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names.
    ResourceName string
    The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names.
    resourceName String
    The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names.
    resourceName string
    The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names.
    resource_name str
    The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names.
    resourceName String
    The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names.

    Import

    Service can be imported using any of these accepted formats:

    • {{name}}

    When using the pulumi import command, Service can be imported using one of the formats above. For example:

    $ pulumi import gcp:monitoring/customService:CustomService default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi