Api

class Api : KotlinCustomResource

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"

Properties

Link copied to clipboard
val apiId: Output<String>

The ID of the api of api gateway.

Link copied to clipboard
val authType: Output<String>

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>

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

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

Link copied to clipboard
val groupId: Output<String>

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
val id: Output<String>
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>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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>

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

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

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.

Link copied to clipboard
val urn: Output<String>