Google Cloud (GCP) Classic

Pulumi Official
Package maintained by Pulumi
v6.34.0 published on Wednesday, Aug 17, 2022 by Pulumi

Api

A consumable API that can be used by multiple Gateways.

To get more information about Api, see:

Example Usage

Apigateway Api Basic

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

return await Deployment.RunAsync(() => 
{
    var api = new Gcp.ApiGateway.Api("api", new()
    {
        ApiId = "api",
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.NewApi(ctx, "api", &apigateway.ApiArgs{
			ApiId: pulumi.String("api"),
		}, pulumi.Provider(google_beta))
		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.apigateway.Api;
import com.pulumi.gcp.apigateway.ApiArgs;
import com.pulumi.resources.CustomResourceOptions;
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 api = new Api("api", ApiArgs.builder()        
            .apiId("api")
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

api = gcp.apigateway.Api("api", api_id="api",
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const api = new gcp.apigateway.Api("api", {apiId: "api"}, {
    provider: google_beta,
});
resources:
  api:
    type: gcp:apigateway:Api
    properties:
      apiId: api
    options:
      provider: ${["google-beta"]}

Create a Api Resource

new Api(name: string, args: ApiArgs, opts?: CustomResourceOptions);
@overload
def Api(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        api_id: Optional[str] = None,
        display_name: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        managed_service: Optional[str] = None,
        project: Optional[str] = None)
@overload
def Api(resource_name: str,
        args: ApiArgs,
        opts: Optional[ResourceOptions] = None)
func NewApi(ctx *Context, name string, args ApiArgs, opts ...ResourceOption) (*Api, error)
public Api(string name, ApiArgs args, CustomResourceOptions? opts = null)
public Api(String name, ApiArgs args)
public Api(String name, ApiArgs args, CustomResourceOptions options)
type: gcp:apigateway:Api
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

ApiId string

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

DisplayName string

A user-visible name for the API.

Labels Dictionary<string, string>

Resource labels to represent user-provided metadata.

ManagedService string

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

ApiId string

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

DisplayName string

A user-visible name for the API.

Labels map[string]string

Resource labels to represent user-provided metadata.

ManagedService string

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

apiId String

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

displayName String

A user-visible name for the API.

labels Map<String,String>

Resource labels to represent user-provided metadata.

managedService String

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

apiId string

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

displayName string

A user-visible name for the API.

labels {[key: string]: string}

Resource labels to represent user-provided metadata.

managedService string

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

api_id str

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

display_name str

A user-visible name for the API.

labels Mapping[str, str]

Resource labels to represent user-provided metadata.

managed_service str

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

apiId String

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

displayName String

A user-visible name for the API.

labels Map<String>

Resource labels to represent user-provided metadata.

managedService String

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

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

CreateTime string

Creation timestamp in RFC3339 text format.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

CreateTime string

Creation timestamp in RFC3339 text format.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

createTime String

Creation timestamp in RFC3339 text format.

id String

The provider-assigned unique ID for this managed resource.

name String

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

createTime string

Creation timestamp in RFC3339 text format.

id string

The provider-assigned unique ID for this managed resource.

name string

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

create_time str

Creation timestamp in RFC3339 text format.

id str

The provider-assigned unique ID for this managed resource.

name str

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

createTime String

Creation timestamp in RFC3339 text format.

id String

The provider-assigned unique ID for this managed resource.

name String

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

Look up an Existing Api Resource

Get an existing Api 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?: ApiState, opts?: CustomResourceOptions): Api
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_id: Optional[str] = None,
        create_time: Optional[str] = None,
        display_name: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        managed_service: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None) -> Api
func GetApi(ctx *Context, name string, id IDInput, state *ApiState, opts ...ResourceOption) (*Api, error)
public static Api Get(string name, Input<string> id, ApiState? state, CustomResourceOptions? opts = null)
public static Api get(String name, Output<String> id, ApiState 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:
ApiId string

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

CreateTime string

Creation timestamp in RFC3339 text format.

DisplayName string

A user-visible name for the API.

Labels Dictionary<string, string>

Resource labels to represent user-provided metadata.

ManagedService string

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

Name string

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

ApiId string

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

CreateTime string

Creation timestamp in RFC3339 text format.

DisplayName string

A user-visible name for the API.

Labels map[string]string

Resource labels to represent user-provided metadata.

ManagedService string

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

Name string

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

apiId String

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

createTime String

Creation timestamp in RFC3339 text format.

displayName String

A user-visible name for the API.

labels Map<String,String>

Resource labels to represent user-provided metadata.

managedService String

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

name String

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

apiId string

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

createTime string

Creation timestamp in RFC3339 text format.

displayName string

A user-visible name for the API.

labels {[key: string]: string}

Resource labels to represent user-provided metadata.

managedService string

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

name string

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

api_id str

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

create_time str

Creation timestamp in RFC3339 text format.

display_name str

A user-visible name for the API.

labels Mapping[str, str]

Resource labels to represent user-provided metadata.

managed_service str

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

name str

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

apiId String

Identifier to assign to the API. Must be unique within scope of the parent resource(project)

createTime String

Creation timestamp in RFC3339 text format.

displayName String

A user-visible name for the API.

labels Map<String>

Resource labels to represent user-provided metadata.

managedService String

Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.

name String

The resource name of the API. Format 'projects/{{project}}/locations/global/apis/{{apiId}}'

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Import

Api can be imported using any of these accepted formats

 $ pulumi import gcp:apigateway/api:Api default projects/{{project}}/locations/global/apis/{{api_id}}
 $ pulumi import gcp:apigateway/api:Api default {{project}}/{{api_id}}
 $ pulumi import gcp:apigateway/api:Api default {{api_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.