Response Args
data class ResponseArgs(val responseParameters: Output<Map<String, String>>? = null, val responseTemplates: Output<Map<String, String>>? = null, val responseType: Output<String>? = null, val restApiId: Output<String>? = null, val statusCode: Output<String>? = null) : ConvertibleToJava<ResponseArgs>
Provides an API Gateway Gateway Response for a REST API Gateway.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.RestApi;
import com.pulumi.aws.apigateway.Response;
import com.pulumi.aws.apigateway.ResponseArgs;
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 main = new RestApi("main");
var test = new Response("test", ResponseArgs.builder()
.restApiId(main.id())
.statusCode("401")
.responseType("UNAUTHORIZED")
.responseTemplates(Map.of("application/json", "{\"message\":$context.error.messageString}"))
.responseParameters(Map.of("gatewayresponse.header.Authorization", "'Basic'"))
.build());
}
}
Content copied to clipboard
Import
aws_api_gateway_gateway_response
can be imported using REST-API-ID/RESPONSE-TYPE
, e.g.,
$ pulumi import aws:apigateway/response:Response example 12345abcde/UNAUTHORIZED
Content copied to clipboard
Constructors
Properties
Link copied to clipboard
Map of parameters (paths, query strings and headers) of the Gateway Response.
Link copied to clipboard
Map of templates used to transform the response body.
Link copied to clipboard
Response type of the associated GatewayResponse.
Link copied to clipboard
HTTP status code of the Gateway Response.