Class Service
An individual service. A service contains a name and optional metadata.
To get more information about Service, see:
- API documentation
- How-to Guides
- Configuring a service
Example Usage - Service Directory Service Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var exampleNamespace = new Gcp.ServiceDirectory.Namespace("exampleNamespace", new Gcp.ServiceDirectory.NamespaceArgs
{
NamespaceId = "example-namespace",
Location = "us-central1",
});
var exampleService = new Gcp.ServiceDirectory.Service("exampleService", new Gcp.ServiceDirectory.ServiceArgs
{
ServiceId = "example-service",
Namespace = exampleNamespace.Id,
Metadata =
{
{ "stage", "prod" },
{ "region", "us-central1" },
},
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.ServiceDirectory
Assembly: Pulumi.Gcp.dll
Syntax
public class Service : CustomResource
Constructors
View SourceService(String, ServiceArgs, CustomResourceOptions)
Create a Service resource with the given unique name, arguments, and options.
Declaration
public Service(string name, ServiceArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ServiceArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceMetadata
Metadata for the service. This data can be consumed by service clients. The entire metadata dictionary may contain up to 2000 characters, spread across all key-value pairs. Metadata that goes beyond any these limits will be rejected.
Declaration
public Output<ImmutableDictionary<string, string>> Metadata { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
Name
The resource name for the service in the format 'projects//locations//namespaces//services/'.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Namespace
The resource name of the namespace this service will belong to.
Declaration
public Output<string> Namespace { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ServiceId
The Resource ID must be 1-63 characters long, including digits, lowercase letters or the hyphen character.
Declaration
public Output<string> ServiceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ServiceState, CustomResourceOptions)
Get an existing Service resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Service Get(string name, Input<string> id, ServiceState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ServiceState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Service |