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

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 exampleGroup = new Group("exampleGroup", GroupArgs.builder()
.description("tf-example")
.build());
var exampleApi = new Api("exampleApi", ApiArgs.builder()
.groupId(exampleGroup.id())
.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());
}
}

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
fun ApiArgs(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)

Functions

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

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 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.