Google Cloud (GCP) Classic

v6.44.0 published on Tuesday, Nov 29, 2022 by Pulumi

GenericService

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

To get more information about GenericService, see:

Example Usage

Monitoring Service Example

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var myService = new Gcp.Monitoring.GenericService("myService", new()
    {
        BasicService = new Gcp.Monitoring.Inputs.GenericServiceBasicServiceArgs
        {
            ServiceLabels = 
            {
                { "moduleId", "another-module-id" },
            },
            ServiceType = "APP_ENGINE",
        },
        DisplayName = "My Service my-service",
        ServiceId = "my-service",
        UserLabels = 
        {
            { "my_key", "my_value" },
            { "my_other_key", "my_other_value" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/monitoring"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := monitoring.NewGenericService(ctx, "myService", &monitoring.GenericServiceArgs{
			BasicService: &monitoring.GenericServiceBasicServiceArgs{
				ServiceLabels: pulumi.StringMap{
					"moduleId": pulumi.String("another-module-id"),
				},
				ServiceType: pulumi.String("APP_ENGINE"),
			},
			DisplayName: pulumi.String("My Service my-service"),
			ServiceId:   pulumi.String("my-service"),
			UserLabels: pulumi.StringMap{
				"my_key":       pulumi.String("my_value"),
				"my_other_key": pulumi.String("my_other_value"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.GenericService;
import com.pulumi.gcp.monitoring.GenericServiceArgs;
import com.pulumi.gcp.monitoring.inputs.GenericServiceBasicServiceArgs;
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 myService = new GenericService("myService", GenericServiceArgs.builder()        
            .basicService(GenericServiceBasicServiceArgs.builder()
                .serviceLabels(Map.of("moduleId", "another-module-id"))
                .serviceType("APP_ENGINE")
                .build())
            .displayName("My Service my-service")
            .serviceId("my-service")
            .userLabels(Map.ofEntries(
                Map.entry("my_key", "my_value"),
                Map.entry("my_other_key", "my_other_value")
            ))
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

my_service = gcp.monitoring.GenericService("myService",
    basic_service=gcp.monitoring.GenericServiceBasicServiceArgs(
        service_labels={
            "moduleId": "another-module-id",
        },
        service_type="APP_ENGINE",
    ),
    display_name="My Service my-service",
    service_id="my-service",
    user_labels={
        "my_key": "my_value",
        "my_other_key": "my_other_value",
    })
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myService = new gcp.monitoring.GenericService("my_service", {
    basicService: {
        serviceLabels: {
            module_id: "another-module-id",
        },
        serviceType: "APP_ENGINE",
    },
    displayName: "My Service my-service",
    serviceId: "my-service",
    userLabels: {
        my_key: "my_value",
        my_other_key: "my_other_value",
    },
});
resources:
  myService:
    type: gcp:monitoring:GenericService
    properties:
      basicService:
        serviceLabels:
          moduleId: another-module-id
        serviceType: APP_ENGINE
      displayName: My Service my-service
      serviceId: my-service
      userLabels:
        my_key: my_value
        my_other_key: my_other_value

Create GenericService Resource

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

name string
The unique name of the resource.
args GenericServiceArgs
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 GenericServiceArgs
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 GenericServiceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GenericServiceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args GenericServiceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

GenericService 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 GenericService resource accepts the following input properties:

ServiceId string

An optional service ID to use. If not given, the server will generate a service ID.

BasicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

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.

ServiceId string

An optional service ID to use. If not given, the server will generate a service ID.

BasicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

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.

serviceId String

An optional service ID to use. If not given, the server will generate a service ID.

basicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

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.

serviceId string

An optional service ID to use. If not given, the server will generate a service ID.

basicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

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.

service_id str

An optional service ID to use. If not given, the server will generate a service ID.

basic_service GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

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.

serviceId String

An optional service ID to use. If not given, the server will generate a service ID.

basicService Property Map

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

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 GenericService 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].

Telemetries List<GenericServiceTelemetry>

Configuration for how to query telemetry on a Service.

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].

Telemetries []GenericServiceTelemetry

Configuration for how to query telemetry on a Service.

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].

telemetries List<GenericServiceTelemetry>

Configuration for how to query telemetry on a Service.

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].

telemetries GenericServiceTelemetry[]

Configuration for how to query telemetry on a Service.

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].

telemetries Sequence[GenericServiceTelemetry]

Configuration for how to query telemetry on a Service.

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].

telemetries List<Property Map>

Configuration for how to query telemetry on a Service.

Look up Existing GenericService Resource

Get an existing GenericService 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?: GenericServiceState, opts?: CustomResourceOptions): GenericService
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        basic_service: Optional[GenericServiceBasicServiceArgs] = None,
        display_name: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        service_id: Optional[str] = None,
        telemetries: Optional[Sequence[GenericServiceTelemetryArgs]] = None,
        user_labels: Optional[Mapping[str, str]] = None) -> GenericService
func GetGenericService(ctx *Context, name string, id IDInput, state *GenericServiceState, opts ...ResourceOption) (*GenericService, error)
public static GenericService Get(string name, Input<string> id, GenericServiceState? state, CustomResourceOptions? opts = null)
public static GenericService get(String name, Output<String> id, GenericServiceState 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:
BasicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

Telemetries List<GenericServiceTelemetryArgs>

Configuration for how to query telemetry on a Service.

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.

BasicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

Telemetries []GenericServiceTelemetryArgs

Configuration for how to query telemetry on a Service.

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.

basicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

telemetries List<GenericServiceTelemetryArgs>

Configuration for how to query telemetry on a Service.

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.

basicService GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

telemetries GenericServiceTelemetryArgs[]

Configuration for how to query telemetry on a Service.

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.

basic_service GenericServiceBasicServiceArgs

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

telemetries Sequence[GenericServiceTelemetryArgs]

Configuration for how to query telemetry on a Service.

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.

basicService Property Map

A well-known service type, defined by its service type and service labels. Valid values are described at https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli Structure is documented below.

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.

telemetries List<Property Map>

Configuration for how to query telemetry on a Service.

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

GenericServiceBasicService

ServiceLabels Dictionary<string, string>

Labels that specify the resource that emits the monitoring data which is used for SLO reporting of this Service.

ServiceType string

The type of service that this basic service defines, e.g. APP_ENGINE service type

ServiceLabels map[string]string

Labels that specify the resource that emits the monitoring data which is used for SLO reporting of this Service.

ServiceType string

The type of service that this basic service defines, e.g. APP_ENGINE service type

serviceLabels Map<String,String>

Labels that specify the resource that emits the monitoring data which is used for SLO reporting of this Service.

serviceType String

The type of service that this basic service defines, e.g. APP_ENGINE service type

serviceLabels {[key: string]: string}

Labels that specify the resource that emits the monitoring data which is used for SLO reporting of this Service.

serviceType string

The type of service that this basic service defines, e.g. APP_ENGINE service type

service_labels Mapping[str, str]

Labels that specify the resource that emits the monitoring data which is used for SLO reporting of this Service.

service_type str

The type of service that this basic service defines, e.g. APP_ENGINE service type

serviceLabels Map<String>

Labels that specify the resource that emits the monitoring data which is used for SLO reporting of this Service.

serviceType String

The type of service that this basic service defines, e.g. APP_ENGINE service type

GenericServiceTelemetry

Import

GenericService can be imported using any of these accepted formats

 $ pulumi import gcp:monitoring/genericService:GenericService default projects/{{project}}/services/{{service_id}}
 $ pulumi import gcp:monitoring/genericService:GenericService default {{project}}/{{service_id}}
 $ pulumi import gcp:monitoring/genericService:GenericService default {{service_id}}

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.