get Rest Api
Use this data source to get the id and root_resource_id of a REST API in API Gateway. To fetch the REST API you must provide a name to match against. As there is no unique name constraint on REST APIs this data source will error if there is more than one match.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.ApigatewayFunctions;
import com.pulumi.aws.apigateway.inputs.GetRestApiArgs;
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) {
final var myRestApi = ApigatewayFunctions.getRestApi(GetRestApiArgs.builder()
.name("my-rest-api")
.build());
}
}
Content copied to clipboard
Return
A collection of values returned by getRestApi.
Parameters
argument
A collection of arguments for invoking getRestApi.
Return
A collection of values returned by getRestApi.
Parameters
name
Name of the REST API to look up. If no REST API is found with this name, an error will be returned. If multiple REST APIs are found with this name, an error will be returned.
tags
Key-value map of resource tags.
See also
Return
A collection of values returned by getRestApi.
Parameters
argument
Builder for com.pulumi.aws.apigateway.kotlin.inputs.GetRestApiPlainArgs.