Api Args
data class ApiArgs(val apiId: Output<String>? = null, val displayName: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val managedService: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<ApiArgs>
A consumable API that can be used by multiple Gateways. To get more information about Api, see:
How-to Guides
Example Usage
Apigateway Api Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const api = new gcp.apigateway.Api("api", {apiId: "my-api"});
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
api = gcp.apigateway.Api("api", api_id="my-api")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var api = new Gcp.ApiGateway.Api("api", new()
{
ApiId = "my-api",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/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("my-api"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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 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("my-api")
.build());
}
}
Content copied to clipboard
resources:
api:
type: gcp:apigateway:Api
properties:
apiId: my-api
Content copied to clipboard
Import
Api can be imported using any of these accepted formats:
projects/{{project}}/locations/global/apis/{{api_id}}
{{project}}/{{api_id}}
{{api_id}}
When using thepulumi import
command, Api can be imported using one of the formats above. For example:
$ pulumi import gcp:apigateway/api:Api default projects/{{project}}/locations/global/apis/{{api_id}}
Content copied to clipboard
$ pulumi import gcp:apigateway/api:Api default {{project}}/{{api_id}}
Content copied to clipboard
$ pulumi import gcp:apigateway/api:Api default {{api_id}}
Content copied to clipboard
Constructors
Properties
Link copied to clipboard
A user-visible name for the API.
Link copied to clipboard
Link copied to clipboard
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.