Class Service
Allows management of a single API service for an existing Google Cloud Platform project.
For a list of services available, visit the
API library page or run gcloud services list.
Example Usage
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var project = new Gcp.Projects.Service("project", new Gcp.Projects.ServiceArgs
{
DisableDependentServices = true,
Project = "your-project-id",
Service = "iam.googleapis.com",
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Projects
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 SourceDisableDependentServices
If true, services that are enabled and which depend on this service should also be disabled when this service is destroyed.
If false or unset, an error will be generated if any enabled services depend on this service when destroying it.
Declaration
public Output<bool?> DisableDependentServices { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
DisableOnDestroy
If true, disable the service when the resource is destroyed. Defaults to true. May be useful in the event that a project is long-lived but the infrastructure running in that project changes frequently.
Declaration
public Output<bool?> DisableOnDestroy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Project
The project ID. If not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ServiceName
The service to enable.
Declaration
public Output<string> ServiceName { 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 |