1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. apigateway
  5. Gateway
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.apigateway.Gateway

Explore with Pulumi AI

A consumable API that can be used by multiple Gateways.

To get more information about Gateway, see:

Example Usage

Create Gateway Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Gateway(name: string, args: GatewayArgs, opts?: CustomResourceOptions);
@overload
def Gateway(resource_name: str,
            args: GatewayArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Gateway(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            api_config: Optional[str] = None,
            gateway_id: Optional[str] = None,
            display_name: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            project: Optional[str] = None,
            region: Optional[str] = None)
func NewGateway(ctx *Context, name string, args GatewayArgs, opts ...ResourceOption) (*Gateway, error)
public Gateway(string name, GatewayArgs args, CustomResourceOptions? opts = null)
public Gateway(String name, GatewayArgs args)
public Gateway(String name, GatewayArgs args, CustomResourceOptions options)
type: gcp:apigateway:Gateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GatewayArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GatewayArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var gatewayResource = new Gcp.ApiGateway.Gateway("gatewayResource", new()
{
    ApiConfig = "string",
    GatewayId = "string",
    DisplayName = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Project = "string",
    Region = "string",
});
Copy
example, err := apigateway.NewGateway(ctx, "gatewayResource", &apigateway.GatewayArgs{
	ApiConfig:   pulumi.String("string"),
	GatewayId:   pulumi.String("string"),
	DisplayName: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Project: pulumi.String("string"),
	Region:  pulumi.String("string"),
})
Copy
var gatewayResource = new Gateway("gatewayResource", GatewayArgs.builder()
    .apiConfig("string")
    .gatewayId("string")
    .displayName("string")
    .labels(Map.of("string", "string"))
    .project("string")
    .region("string")
    .build());
Copy
gateway_resource = gcp.apigateway.Gateway("gatewayResource",
    api_config="string",
    gateway_id="string",
    display_name="string",
    labels={
        "string": "string",
    },
    project="string",
    region="string")
Copy
const gatewayResource = new gcp.apigateway.Gateway("gatewayResource", {
    apiConfig: "string",
    gatewayId: "string",
    displayName: "string",
    labels: {
        string: "string",
    },
    project: "string",
    region: "string",
});
Copy
type: gcp:apigateway:Gateway
properties:
    apiConfig: string
    displayName: string
    gatewayId: string
    labels:
        string: string
    project: string
    region: string
Copy

Gateway Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Gateway resource accepts the following input properties:

ApiConfig This property is required. string
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
GatewayId
This property is required.
Changes to this property will trigger replacement.
string
Identifier to assign to the Gateway. 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.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
The region of the gateway for the API.
ApiConfig This property is required. string
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
GatewayId
This property is required.
Changes to this property will trigger replacement.
string
Identifier to assign to the Gateway. 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.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
The region of the gateway for the API.
apiConfig This property is required. String
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
gatewayId
This property is required.
Changes to this property will trigger replacement.
String
Identifier to assign to the Gateway. 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.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
The region of the gateway for the API.
apiConfig This property is required. string
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
gatewayId
This property is required.
Changes to this property will trigger replacement.
string
Identifier to assign to the Gateway. 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.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
The region of the gateway for the API.
api_config This property is required. str
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
gateway_id
This property is required.
Changes to this property will trigger replacement.
str
Identifier to assign to the Gateway. 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.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
The region of the gateway for the API.
apiConfig This property is required. String
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
gatewayId
This property is required.
Changes to this property will trigger replacement.
String
Identifier to assign to the Gateway. 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.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
The region of the gateway for the API.

Outputs

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

DefaultHostname string
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
DefaultHostname string
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
defaultHostname String
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
defaultHostname string
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
default_hostname str
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
defaultHostname String
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.

Look up Existing Gateway Resource

Get an existing Gateway 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?: GatewayState, opts?: CustomResourceOptions): Gateway
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_config: Optional[str] = None,
        default_hostname: Optional[str] = None,
        display_name: Optional[str] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        gateway_id: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        region: Optional[str] = None) -> Gateway
func GetGateway(ctx *Context, name string, id IDInput, state *GatewayState, opts ...ResourceOption) (*Gateway, error)
public static Gateway Get(string name, Input<string> id, GatewayState? state, CustomResourceOptions? opts = null)
public static Gateway get(String name, Output<String> id, GatewayState state, CustomResourceOptions options)
resources:  _:    type: gcp:apigateway:Gateway    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ApiConfig string
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
DefaultHostname string
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
DisplayName string
A user-visible name for the API.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
GatewayId Changes to this property will trigger replacement. string
Identifier to assign to the Gateway. Must be unique within scope of the parent resource(project).


Labels Dictionary<string, string>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Name string
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
Region Changes to this property will trigger replacement. string
The region of the gateway for the API.
ApiConfig string
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
DefaultHostname string
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
DisplayName string
A user-visible name for the API.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
GatewayId Changes to this property will trigger replacement. string
Identifier to assign to the Gateway. Must be unique within scope of the parent resource(project).


Labels map[string]string

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Name string
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
Region Changes to this property will trigger replacement. string
The region of the gateway for the API.
apiConfig String
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
defaultHostname String
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
displayName String
A user-visible name for the API.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
gatewayId Changes to this property will trigger replacement. String
Identifier to assign to the Gateway. Must be unique within scope of the parent resource(project).


labels Map<String,String>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name String
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
region Changes to this property will trigger replacement. String
The region of the gateway for the API.
apiConfig string
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
defaultHostname string
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
displayName string
A user-visible name for the API.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
gatewayId Changes to this property will trigger replacement. string
Identifier to assign to the Gateway. Must be unique within scope of the parent resource(project).


labels {[key: string]: string}

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name string
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
region Changes to this property will trigger replacement. string
The region of the gateway for the API.
api_config str
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
default_hostname str
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
display_name str
A user-visible name for the API.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
gateway_id Changes to this property will trigger replacement. str
Identifier to assign to the Gateway. Must be unique within scope of the parent resource(project).


labels Mapping[str, str]

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name str
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
region Changes to this property will trigger replacement. str
The region of the gateway for the API.
apiConfig String
Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}. When changing api configs please ensure the new config is a new resource and the lifecycle rule create_before_destroy is set.
defaultHostname String
The default API Gateway host name of the form {gatewayId}-{hash}.{region_code}.gateway.dev.
displayName String
A user-visible name for the API.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
gatewayId Changes to this property will trigger replacement. String
Identifier to assign to the Gateway. Must be unique within scope of the parent resource(project).


labels Map<String>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name String
Resource name of the Gateway. Format: projects/{project}/locations/{region}/gateways/{gateway}
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
region Changes to this property will trigger replacement. String
The region of the gateway for the API.

Import

Gateway can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{region}}/gateways/{{gateway_id}}

  • {{project}}/{{region}}/{{gateway_id}}

  • {{region}}/{{gateway_id}}

  • {{gateway_id}}

When using the pulumi import command, Gateway can be imported using one of the formats above. For example:

$ pulumi import gcp:apigateway/gateway:Gateway default projects/{{project}}/locations/{{region}}/gateways/{{gateway_id}}
Copy
$ pulumi import gcp:apigateway/gateway:Gateway default {{project}}/{{region}}/{{gateway_id}}
Copy
$ pulumi import gcp:apigateway/gateway:Gateway default {{region}}/{{gateway_id}}
Copy
$ pulumi import gcp:apigateway/gateway:Gateway default {{gateway_id}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.