ApiArgs

data class ApiArgs(val authType: Output<String>? = null, val constantParameters: Output<List<ApiConstantParameterArgs>>? = null, val description: Output<String>? = null, val fcServiceConfig: Output<ApiFcServiceConfigArgs>? = null, val forceNonceCheck: Output<Boolean>? = null, val groupId: Output<String>? = null, val httpServiceConfig: Output<ApiHttpServiceConfigArgs>? = null, val httpVpcServiceConfig: Output<ApiHttpVpcServiceConfigArgs>? = null, val mockServiceConfig: Output<ApiMockServiceConfigArgs>? = null, val name: Output<String>? = null, val requestConfig: Output<ApiRequestConfigArgs>? = null, val requestParameters: Output<List<ApiRequestParameterArgs>>? = null, val serviceType: Output<String>? = null, val stageNames: Output<List<String>>? = null, val systemParameters: Output<List<ApiSystemParameterArgs>>? = null) : ConvertibleToJava<ApiArgs>

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.apigateway.Group("example", {
name: "tf-example",
description: "tf-example",
basePath: "/",
});
const exampleApi = new alicloud.apigateway.Api("example", {
groupId: example.id,
name: "tf-example",
description: "tf-example",
authType: "APP",
forceNonceCheck: false,
requestConfig: {
protocol: "HTTP",
method: "GET",
path: "/example/path",
mode: "MAPPING",
},
serviceType: "HTTP",
httpServiceConfig: {
address: "http://apigateway-backend.alicloudapi.com:8080",
method: "GET",
path: "/web/cloudapi",
timeout: 12,
aoneName: "cloudapi-openapi",
},
requestParameters: [{
name: "example",
type: "STRING",
required: "OPTIONAL",
"in": "QUERY",
inService: "QUERY",
nameService: "exampleservice",
}],
stageNames: [
"RELEASE",
"TEST",
],
});
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.apigateway.Group("example",
name="tf-example",
description="tf-example",
base_path="/")
example_api = alicloud.apigateway.Api("example",
group_id=example.id,
name="tf-example",
description="tf-example",
auth_type="APP",
force_nonce_check=False,
request_config={
"protocol": "HTTP",
"method": "GET",
"path": "/example/path",
"mode": "MAPPING",
},
service_type="HTTP",
http_service_config={
"address": "http://apigateway-backend.alicloudapi.com:8080",
"method": "GET",
"path": "/web/cloudapi",
"timeout": 12,
"aone_name": "cloudapi-openapi",
},
request_parameters=[{
"name": "example",
"type": "STRING",
"required": "OPTIONAL",
"in_": "QUERY",
"in_service": "QUERY",
"name_service": "exampleservice",
}],
stage_names=[
"RELEASE",
"TEST",
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = new AliCloud.ApiGateway.Group("example", new()
{
Name = "tf-example",
Description = "tf-example",
BasePath = "/",
});
var exampleApi = new AliCloud.ApiGateway.Api("example", new()
{
GroupId = example.Id,
Name = "tf-example",
Description = "tf-example",
AuthType = "APP",
ForceNonceCheck = false,
RequestConfig = new AliCloud.ApiGateway.Inputs.ApiRequestConfigArgs
{
Protocol = "HTTP",
Method = "GET",
Path = "/example/path",
Mode = "MAPPING",
},
ServiceType = "HTTP",
HttpServiceConfig = new AliCloud.ApiGateway.Inputs.ApiHttpServiceConfigArgs
{
Address = "http://apigateway-backend.alicloudapi.com:8080",
Method = "GET",
Path = "/web/cloudapi",
Timeout = 12,
AoneName = "cloudapi-openapi",
},
RequestParameters = new[]
{
new AliCloud.ApiGateway.Inputs.ApiRequestParameterArgs
{
Name = "example",
Type = "STRING",
Required = "OPTIONAL",
In = "QUERY",
InService = "QUERY",
NameService = "exampleservice",
},
},
StageNames = new[]
{
"RELEASE",
"TEST",
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := apigateway.NewGroup(ctx, "example", &apigateway.GroupArgs{
Name: pulumi.String("tf-example"),
Description: pulumi.String("tf-example"),
BasePath: pulumi.String("/"),
})
if err != nil {
return err
}
_, err = apigateway.NewApi(ctx, "example", &apigateway.ApiArgs{
GroupId: example.ID(),
Name: pulumi.String("tf-example"),
Description: pulumi.String("tf-example"),
AuthType: pulumi.String("APP"),
ForceNonceCheck: pulumi.Bool(false),
RequestConfig: &apigateway.ApiRequestConfigArgs{
Protocol: pulumi.String("HTTP"),
Method: pulumi.String("GET"),
Path: pulumi.String("/example/path"),
Mode: pulumi.String("MAPPING"),
},
ServiceType: pulumi.String("HTTP"),
HttpServiceConfig: &apigateway.ApiHttpServiceConfigArgs{
Address: pulumi.String("http://apigateway-backend.alicloudapi.com:8080"),
Method: pulumi.String("GET"),
Path: pulumi.String("/web/cloudapi"),
Timeout: pulumi.Int(12),
AoneName: pulumi.String("cloudapi-openapi"),
},
RequestParameters: apigateway.ApiRequestParameterArray{
&apigateway.ApiRequestParameterArgs{
Name: pulumi.String("example"),
Type: pulumi.String("STRING"),
Required: pulumi.String("OPTIONAL"),
In: pulumi.String("QUERY"),
InService: pulumi.String("QUERY"),
NameService: pulumi.String("exampleservice"),
},
},
StageNames: pulumi.StringArray{
pulumi.String("RELEASE"),
pulumi.String("TEST"),
},
})
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.alicloud.apigateway.Group;
import com.pulumi.alicloud.apigateway.GroupArgs;
import com.pulumi.alicloud.apigateway.Api;
import com.pulumi.alicloud.apigateway.ApiArgs;
import com.pulumi.alicloud.apigateway.inputs.ApiRequestConfigArgs;
import com.pulumi.alicloud.apigateway.inputs.ApiHttpServiceConfigArgs;
import com.pulumi.alicloud.apigateway.inputs.ApiRequestParameterArgs;
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 example = new Group("example", GroupArgs.builder()
.name("tf-example")
.description("tf-example")
.basePath("/")
.build());
var exampleApi = new Api("exampleApi", ApiArgs.builder()
.groupId(example.id())
.name("tf-example")
.description("tf-example")
.authType("APP")
.forceNonceCheck(false)
.requestConfig(ApiRequestConfigArgs.builder()
.protocol("HTTP")
.method("GET")
.path("/example/path")
.mode("MAPPING")
.build())
.serviceType("HTTP")
.httpServiceConfig(ApiHttpServiceConfigArgs.builder()
.address("http://apigateway-backend.alicloudapi.com:8080")
.method("GET")
.path("/web/cloudapi")
.timeout(12)
.aoneName("cloudapi-openapi")
.build())
.requestParameters(ApiRequestParameterArgs.builder()
.name("example")
.type("STRING")
.required("OPTIONAL")
.in("QUERY")
.inService("QUERY")
.nameService("exampleservice")
.build())
.stageNames(
"RELEASE",
"TEST")
.build());
}
}
resources:
example:
type: alicloud:apigateway:Group
properties:
name: tf-example
description: tf-example
basePath: /
exampleApi:
type: alicloud:apigateway:Api
name: example
properties:
groupId: ${example.id}
name: tf-example
description: tf-example
authType: APP
forceNonceCheck: false
requestConfig:
protocol: HTTP
method: GET
path: /example/path
mode: MAPPING
serviceType: HTTP
httpServiceConfig:
address: http://apigateway-backend.alicloudapi.com:8080
method: GET
path: /web/cloudapi
timeout: 12
aoneName: cloudapi-openapi
requestParameters:
- name: example
type: STRING
required: OPTIONAL
in: QUERY
inService: QUERY
nameService: exampleservice
stageNames:
- RELEASE
- TEST

Import

Api gateway api can be imported using the id.Format to <API Group Id>:<API Id> e.g.

$ pulumi import alicloud:apigateway/api:Api example "ab2351f2ce904edaa8d92a0510832b91:e4f728fca5a94148b023b99a3e5d0b62"

Constructors

Link copied to clipboard
constructor(authType: Output<String>? = null, constantParameters: Output<List<ApiConstantParameterArgs>>? = null, description: Output<String>? = null, fcServiceConfig: Output<ApiFcServiceConfigArgs>? = null, forceNonceCheck: Output<Boolean>? = null, groupId: Output<String>? = null, httpServiceConfig: Output<ApiHttpServiceConfigArgs>? = null, httpVpcServiceConfig: Output<ApiHttpVpcServiceConfigArgs>? = null, mockServiceConfig: Output<ApiMockServiceConfigArgs>? = null, name: Output<String>? = null, requestConfig: Output<ApiRequestConfigArgs>? = null, requestParameters: Output<List<ApiRequestParameterArgs>>? = null, serviceType: Output<String>? = null, stageNames: Output<List<String>>? = null, systemParameters: Output<List<ApiSystemParameterArgs>>? = null)

Properties

Link copied to clipboard
val authType: Output<String>? = null

The authorization Type including APP and ANONYMOUS. Defaults to null.

Link copied to clipboard

constant_parameters defines the constant parameters of the api. See constant_parameters below.

Link copied to clipboard
val description: Output<String>? = null

The description of the api. Defaults to null.

Link copied to clipboard

fc_service_config defines the config when service_type selected 'FunctionCompute'. See fc_service_config below.

Link copied to clipboard
val forceNonceCheck: Output<Boolean>? = null

Whether to prevent API replay attack. Default value: false.

Link copied to clipboard
val groupId: Output<String>? = null

The api gateway that the api belongs to. Defaults to null.

Link copied to clipboard

http_service_config defines the config when service_type selected 'HTTP'. See http_service_config below.

Link copied to clipboard

http_vpc_service_config defines the config when service_type selected 'HTTP-VPC'. See http_vpc_service_config below.

Link copied to clipboard

http_service_config defines the config when service_type selected 'MOCK'. See mock_service_config below.

Link copied to clipboard
val name: Output<String>? = null

The name of the api gateway api. Defaults to null.

Link copied to clipboard
val requestConfig: Output<ApiRequestConfigArgs>? = null

Request_config defines how users can send requests to your API. See request_config below.

Link copied to clipboard

request_parameters defines the request parameters of the api. See request_parameters below.

Link copied to clipboard
val serviceType: Output<String>? = null

The type of backend service. Type including HTTP, VPC, FunctionCompute and MOCK. Defaults to null.

Link copied to clipboard
val stageNames: Output<List<String>>? = null

Stages that the api need to be deployed. Valid value: RELEASE,PRE,TEST.

Link copied to clipboard

system_parameters defines the system parameters of the api. See system_parameters below.

Functions

Link copied to clipboard
open override fun toJava(): ApiArgs