AWS Native is in preview. AWS Classic is fully supported.
aws-native.apigateway.RestApi
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
The AWS::ApiGateway::RestApi
resource creates a REST API. For more information, see restapi:create in the Amazon API Gateway REST API Reference.
On January 1, 2016, the Swagger Specification was donated to the OpenAPI initiative, becoming the foundation of the OpenAPI Specification.
Example Usage
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var description = config.Require("description");
var version = config.Require("version");
var type = config.Require("type");
var property = config.Require("property");
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = apiName,
});
var documentationPart = new AwsNative.ApiGateway.DocumentationPart("documentationPart", new()
{
Location = new AwsNative.ApiGateway.Inputs.DocumentationPartLocationArgs
{
Type = System.Enum.Parse<AwsNative.ApiGateway.DocumentationPartLocationType>(type),
},
RestApiId = restApi.Id,
Properties = property,
});
var documentationVersion = new AwsNative.ApiGateway.DocumentationVersion("documentationVersion", new()
{
Description = description,
DocumentationVersionValue = version,
RestApiId = restApi.Id,
}, new CustomResourceOptions
{
DependsOn =
{
documentationPart,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
description := cfg.Require("description")
version := cfg.Require("version")
_type := cfg.Require("type")
property := cfg.Require("property")
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
documentationPart, err := apigateway.NewDocumentationPart(ctx, "documentationPart", &apigateway.DocumentationPartArgs{
Location: &apigateway.DocumentationPartLocationArgs{
Type: apigateway.DocumentationPartLocationType(_type),
},
RestApiId: restApi.ID(),
Properties: pulumi.String(property),
})
if err != nil {
return err
}
_, err = apigateway.NewDocumentationVersion(ctx, "documentationVersion", &apigateway.DocumentationVersionArgs{
Description: pulumi.String(description),
DocumentationVersion: pulumi.String(version),
RestApiId: restApi.ID(),
}, pulumi.DependsOn([]pulumi.Resource{
documentationPart,
}))
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
description = config.require("description")
version = config.require("version")
type = config.require("type")
property = config.require("property")
rest_api = aws_native.apigateway.RestApi("restApi", name=api_name)
documentation_part = aws_native.apigateway.DocumentationPart("documentationPart",
location=aws_native.apigateway.DocumentationPartLocationArgs(
type=aws_native.apigateway.DocumentationPartLocationType(type),
),
rest_api_id=rest_api.id,
properties=property)
documentation_version = aws_native.apigateway.DocumentationVersion("documentationVersion",
description=description,
documentation_version=version,
rest_api_id=rest_api.id,
opts = pulumi.ResourceOptions(depends_on=[documentation_part]))
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const description = config.require("description");
const version = config.require("version");
const type = config.require("type");
const property = config.require("property");
const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
const documentationPart = new aws_native.apigateway.DocumentationPart("documentationPart", {
location: {
type: aws_native.apigateway.DocumentationPartLocationType[type],
},
restApiId: restApi.id,
properties: property,
});
const documentationVersion = new aws_native.apigateway.DocumentationVersion("documentationVersion", {
description: description,
documentationVersion: version,
restApiId: restApi.id,
}, {
dependsOn: [documentationPart],
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var description = config.Require("description");
var version = config.Require("version");
var type = config.Require("type");
var property = config.Require("property");
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = apiName,
});
var documentationPart = new AwsNative.ApiGateway.DocumentationPart("documentationPart", new()
{
Location = new AwsNative.ApiGateway.Inputs.DocumentationPartLocationArgs
{
Type = System.Enum.Parse<AwsNative.ApiGateway.DocumentationPartLocationType>(type),
},
RestApiId = restApi.Id,
Properties = property,
});
var documentationVersion = new AwsNative.ApiGateway.DocumentationVersion("documentationVersion", new()
{
Description = description,
DocumentationVersionValue = version,
RestApiId = restApi.Id,
}, new CustomResourceOptions
{
DependsOn =
{
documentationPart,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
description := cfg.Require("description")
version := cfg.Require("version")
_type := cfg.Require("type")
property := cfg.Require("property")
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
documentationPart, err := apigateway.NewDocumentationPart(ctx, "documentationPart", &apigateway.DocumentationPartArgs{
Location: &apigateway.DocumentationPartLocationArgs{
Type: apigateway.DocumentationPartLocationType(_type),
},
RestApiId: restApi.ID(),
Properties: pulumi.String(property),
})
if err != nil {
return err
}
_, err = apigateway.NewDocumentationVersion(ctx, "documentationVersion", &apigateway.DocumentationVersionArgs{
Description: pulumi.String(description),
DocumentationVersion: pulumi.String(version),
RestApiId: restApi.ID(),
}, pulumi.DependsOn([]pulumi.Resource{
documentationPart,
}))
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
description = config.require("description")
version = config.require("version")
type = config.require("type")
property = config.require("property")
rest_api = aws_native.apigateway.RestApi("restApi", name=api_name)
documentation_part = aws_native.apigateway.DocumentationPart("documentationPart",
location=aws_native.apigateway.DocumentationPartLocationArgs(
type=aws_native.apigateway.DocumentationPartLocationType(type),
),
rest_api_id=rest_api.id,
properties=property)
documentation_version = aws_native.apigateway.DocumentationVersion("documentationVersion",
description=description,
documentation_version=version,
rest_api_id=rest_api.id,
opts = pulumi.ResourceOptions(depends_on=[documentation_part]))
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const description = config.require("description");
const version = config.require("version");
const type = config.require("type");
const property = config.require("property");
const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
const documentationPart = new aws_native.apigateway.DocumentationPart("documentationPart", {
location: {
type: aws_native.apigateway.DocumentationPartLocationType[type],
},
restApiId: restApi.id,
properties: property,
});
const documentationVersion = new aws_native.apigateway.DocumentationVersion("documentationVersion", {
description: description,
documentationVersion: version,
restApiId: restApi.id,
}, {
dependsOn: [documentationPart],
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = "myRestApi",
});
var gatewayResponse = new AwsNative.ApiGateway.GatewayResponse("gatewayResponse", new()
{
ResponseParameters =
{
{ "gatewayresponse.header.Access-Control-Allow-Origin", "'*'" },
{ "gatewayresponse.header.Access-Control-Allow-Headers", "'*'" },
},
ResponseType = "MISSING_AUTHENTICATION_TOKEN",
RestApiId = restApi.Id,
StatusCode = "404",
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String("myRestApi"),
})
if err != nil {
return err
}
_, err = apigateway.NewGatewayResponse(ctx, "gatewayResponse", &apigateway.GatewayResponseArgs{
ResponseParameters: pulumi.StringMap{
"gatewayresponse.header.Access-Control-Allow-Origin": pulumi.String("'*'"),
"gatewayresponse.header.Access-Control-Allow-Headers": pulumi.String("'*'"),
},
ResponseType: pulumi.String("MISSING_AUTHENTICATION_TOKEN"),
RestApiId: restApi.ID(),
StatusCode: pulumi.String("404"),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
rest_api = aws_native.apigateway.RestApi("restApi", name="myRestApi")
gateway_response = aws_native.apigateway.GatewayResponse("gatewayResponse",
response_parameters={
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
},
response_type="MISSING_AUTHENTICATION_TOKEN",
rest_api_id=rest_api.id,
status_code="404")
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const restApi = new aws_native.apigateway.RestApi("restApi", {name: "myRestApi"});
const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
responseParameters: {
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
},
responseType: "MISSING_AUTHENTICATION_TOKEN",
restApiId: restApi.id,
statusCode: "404",
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = "myRestApi",
});
var gatewayResponse = new AwsNative.ApiGateway.GatewayResponse("gatewayResponse", new()
{
ResponseParameters =
{
{ "gatewayresponse.header.Access-Control-Allow-Origin", "'*'" },
{ "gatewayresponse.header.Access-Control-Allow-Headers", "'*'" },
},
ResponseType = "MISSING_AUTHENTICATION_TOKEN",
RestApiId = restApi.Id,
StatusCode = "404",
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String("myRestApi"),
})
if err != nil {
return err
}
_, err = apigateway.NewGatewayResponse(ctx, "gatewayResponse", &apigateway.GatewayResponseArgs{
ResponseParameters: pulumi.StringMap{
"gatewayresponse.header.Access-Control-Allow-Origin": pulumi.String("'*'"),
"gatewayresponse.header.Access-Control-Allow-Headers": pulumi.String("'*'"),
},
ResponseType: pulumi.String("MISSING_AUTHENTICATION_TOKEN"),
RestApiId: restApi.ID(),
StatusCode: pulumi.String("404"),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
rest_api = aws_native.apigateway.RestApi("restApi", name="myRestApi")
gateway_response = aws_native.apigateway.GatewayResponse("gatewayResponse",
response_parameters={
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
},
response_type="MISSING_AUTHENTICATION_TOKEN",
rest_api_id=rest_api.id,
status_code="404")
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const restApi = new aws_native.apigateway.RestApi("restApi", {name: "myRestApi"});
const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
responseParameters: {
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
},
responseType: "MISSING_AUTHENTICATION_TOKEN",
restApiId: restApi.id,
statusCode: "404",
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var responseParameter1 = config.Require("responseParameter1");
var responseParameter2 = config.Require("responseParameter2");
var responseType = config.Require("responseType");
var statusCode = config.Require("statusCode");
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = apiName,
});
var gatewayResponse = new AwsNative.ApiGateway.GatewayResponse("gatewayResponse", new()
{
ResponseParameters =
{
{ "gatewayresponse.header.k1", responseParameter1 },
{ "gatewayresponse.header.k2", responseParameter2 },
},
ResponseType = responseType,
RestApiId = restApi.Id,
StatusCode = statusCode,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
responseParameter1 := cfg.Require("responseParameter1")
responseParameter2 := cfg.Require("responseParameter2")
responseType := cfg.Require("responseType")
statusCode := cfg.Require("statusCode")
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
_, err = apigateway.NewGatewayResponse(ctx, "gatewayResponse", &apigateway.GatewayResponseArgs{
ResponseParameters: pulumi.StringMap{
"gatewayresponse.header.k1": pulumi.String(responseParameter1),
"gatewayresponse.header.k2": pulumi.String(responseParameter2),
},
ResponseType: pulumi.String(responseType),
RestApiId: restApi.ID(),
StatusCode: pulumi.String(statusCode),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
response_parameter1 = config.require("responseParameter1")
response_parameter2 = config.require("responseParameter2")
response_type = config.require("responseType")
status_code = config.require("statusCode")
rest_api = aws_native.apigateway.RestApi("restApi", name=api_name)
gateway_response = aws_native.apigateway.GatewayResponse("gatewayResponse",
response_parameters={
"gatewayresponse.header.k1": response_parameter1,
"gatewayresponse.header.k2": response_parameter2,
},
response_type=response_type,
rest_api_id=rest_api.id,
status_code=status_code)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const responseParameter1 = config.require("responseParameter1");
const responseParameter2 = config.require("responseParameter2");
const responseType = config.require("responseType");
const statusCode = config.require("statusCode");
const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
responseParameters: {
"gatewayresponse.header.k1": responseParameter1,
"gatewayresponse.header.k2": responseParameter2,
},
responseType: responseType,
restApiId: restApi.id,
statusCode: statusCode,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var responseParameter1 = config.Require("responseParameter1");
var responseParameter2 = config.Require("responseParameter2");
var responseType = config.Require("responseType");
var statusCode = config.Require("statusCode");
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = apiName,
});
var gatewayResponse = new AwsNative.ApiGateway.GatewayResponse("gatewayResponse", new()
{
ResponseParameters =
{
{ "gatewayresponse.header.k1", responseParameter1 },
{ "gatewayresponse.header.k2", responseParameter2 },
},
ResponseType = responseType,
RestApiId = restApi.Id,
StatusCode = statusCode,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
responseParameter1 := cfg.Require("responseParameter1")
responseParameter2 := cfg.Require("responseParameter2")
responseType := cfg.Require("responseType")
statusCode := cfg.Require("statusCode")
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
_, err = apigateway.NewGatewayResponse(ctx, "gatewayResponse", &apigateway.GatewayResponseArgs{
ResponseParameters: pulumi.StringMap{
"gatewayresponse.header.k1": pulumi.String(responseParameter1),
"gatewayresponse.header.k2": pulumi.String(responseParameter2),
},
ResponseType: pulumi.String(responseType),
RestApiId: restApi.ID(),
StatusCode: pulumi.String(statusCode),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
response_parameter1 = config.require("responseParameter1")
response_parameter2 = config.require("responseParameter2")
response_type = config.require("responseType")
status_code = config.require("statusCode")
rest_api = aws_native.apigateway.RestApi("restApi", name=api_name)
gateway_response = aws_native.apigateway.GatewayResponse("gatewayResponse",
response_parameters={
"gatewayresponse.header.k1": response_parameter1,
"gatewayresponse.header.k2": response_parameter2,
},
response_type=response_type,
rest_api_id=rest_api.id,
status_code=status_code)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const responseParameter1 = config.require("responseParameter1");
const responseParameter2 = config.require("responseParameter2");
const responseType = config.require("responseType");
const statusCode = config.require("statusCode");
const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
responseParameters: {
"gatewayresponse.header.k1": responseParameter1,
"gatewayresponse.header.k2": responseParameter2,
},
responseType: responseType,
restApiId: restApi.id,
statusCode: statusCode,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var contentHandling = config.Require("contentHandling");
var operationName = config.Get("operationName") ?? "testoperationName";
var restApiName = config.Get("restApiName") ?? "testrestApiName";
var validatorName = config.Get("validatorName") ?? "testvalidatorName";
var validateRequestBody = config.Get("validateRequestBody") ?? "testvalidateRequestBody";
var validateRequestParameters = config.Get("validateRequestParameters") ?? true;
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = restApiName,
});
var requestValidator = new AwsNative.ApiGateway.RequestValidator("requestValidator", new()
{
Name = validatorName,
RestApiId = restApi.Id,
ValidateRequestBody = validateRequestBody,
ValidateRequestParameters = validateRequestParameters,
});
var method = new AwsNative.ApiGateway.Method("method", new()
{
HttpMethod = "POST",
ResourceId = restApi.RootResourceId,
RestApiId = restApi.Id,
AuthorizationType = "NONE",
Integration = new AwsNative.ApiGateway.Inputs.MethodIntegrationArgs
{
Type = AwsNative.ApiGateway.MethodIntegrationType.Mock,
ContentHandling = System.Enum.Parse<AwsNative.ApiGateway.MethodIntegrationContentHandling>(contentHandling),
IntegrationResponses = new[]
{
new AwsNative.ApiGateway.Inputs.MethodIntegrationResponseArgs
{
ContentHandling = System.Enum.Parse<AwsNative.ApiGateway.MethodIntegrationResponseContentHandling>(contentHandling),
StatusCode = "400",
},
},
},
RequestValidatorId = requestValidator.Id,
OperationName = operationName,
});
return new Dictionary<string, object?>
{
["rootResourceId"] = restApi.RootResourceId,
};
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
contentHandling := cfg.Require("contentHandling")
operationName := "testoperationName"
if param := cfg.Get("operationName"); param != "" {
operationName = param
}
restApiName := "testrestApiName"
if param := cfg.Get("restApiName"); param != "" {
restApiName = param
}
validatorName := "testvalidatorName"
if param := cfg.Get("validatorName"); param != "" {
validatorName = param
}
validateRequestBody := "testvalidateRequestBody"
if param := cfg.Get("validateRequestBody"); param != "" {
validateRequestBody = param
}
validateRequestParameters := true
if param := cfg.Get("validateRequestParameters"); param != "" {
validateRequestParameters = param
}
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(restApiName),
})
if err != nil {
return err
}
requestValidator, err := apigateway.NewRequestValidator(ctx, "requestValidator", &apigateway.RequestValidatorArgs{
Name: pulumi.String(validatorName),
RestApiId: restApi.ID(),
ValidateRequestBody: pulumi.String(validateRequestBody),
ValidateRequestParameters: pulumi.String(validateRequestParameters),
})
if err != nil {
return err
}
_, err = apigateway.NewMethod(ctx, "method", &apigateway.MethodArgs{
HttpMethod: pulumi.String("POST"),
ResourceId: restApi.RootResourceId,
RestApiId: restApi.ID(),
AuthorizationType: pulumi.String("NONE"),
Integration: &apigateway.MethodIntegrationArgs{
Type: apigateway.MethodIntegrationTypeMock,
ContentHandling: apigateway.MethodIntegrationContentHandling(contentHandling),
IntegrationResponses: apigateway.MethodIntegrationResponseArray{
&apigateway.MethodIntegrationResponseArgs{
ContentHandling: apigateway.MethodIntegrationResponseContentHandling(contentHandling),
StatusCode: pulumi.String("400"),
},
},
},
RequestValidatorId: requestValidator.ID(),
OperationName: pulumi.String(operationName),
})
if err != nil {
return err
}
ctx.Export("rootResourceId", restApi.RootResourceId)
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
content_handling = config.require("contentHandling")
operation_name = config.get("operationName")
if operation_name is None:
operation_name = "testoperationName"
rest_api_name = config.get("restApiName")
if rest_api_name is None:
rest_api_name = "testrestApiName"
validator_name = config.get("validatorName")
if validator_name is None:
validator_name = "testvalidatorName"
validate_request_body = config.get("validateRequestBody")
if validate_request_body is None:
validate_request_body = "testvalidateRequestBody"
validate_request_parameters = config.get("validateRequestParameters")
if validate_request_parameters is None:
validate_request_parameters = True
rest_api = aws_native.apigateway.RestApi("restApi", name=rest_api_name)
request_validator = aws_native.apigateway.RequestValidator("requestValidator",
name=validator_name,
rest_api_id=rest_api.id,
validate_request_body=validate_request_body,
validate_request_parameters=validate_request_parameters)
method = aws_native.apigateway.Method("method",
http_method="POST",
resource_id=rest_api.root_resource_id,
rest_api_id=rest_api.id,
authorization_type="NONE",
integration=aws_native.apigateway.MethodIntegrationArgs(
type=aws_native.apigateway.MethodIntegrationType.MOCK,
content_handling=aws_native.apigateway.MethodIntegrationContentHandling(content_handling),
integration_responses=[aws_native.apigateway.MethodIntegrationResponseArgs(
content_handling=aws_native.apigateway.MethodIntegrationResponseContentHandling(content_handling),
status_code="400",
)],
),
request_validator_id=request_validator.id,
operation_name=operation_name)
pulumi.export("rootResourceId", rest_api.root_resource_id)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const contentHandling = config.require("contentHandling");
const operationName = config.get("operationName") || "testoperationName";
const restApiName = config.get("restApiName") || "testrestApiName";
const validatorName = config.get("validatorName") || "testvalidatorName";
const validateRequestBody = config.get("validateRequestBody") || "testvalidateRequestBody";
const validateRequestParameters = config.get("validateRequestParameters") || true;
const restApi = new aws_native.apigateway.RestApi("restApi", {name: restApiName});
const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
name: validatorName,
restApiId: restApi.id,
validateRequestBody: validateRequestBody,
validateRequestParameters: validateRequestParameters,
});
const method = new aws_native.apigateway.Method("method", {
httpMethod: "POST",
resourceId: restApi.rootResourceId,
restApiId: restApi.id,
authorizationType: "NONE",
integration: {
type: aws_native.apigateway.MethodIntegrationType.Mock,
contentHandling: aws_native.apigateway.MethodIntegrationContentHandling[contentHandling],
integrationResponses: [{
contentHandling: aws_native.apigateway.MethodIntegrationResponseContentHandling[contentHandling],
statusCode: "400",
}],
},
requestValidatorId: requestValidator.id,
operationName: operationName,
});
export const rootResourceId = restApi.rootResourceId;
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var contentHandling = config.Require("contentHandling");
var operationName = config.Get("operationName") ?? "testoperationName";
var restApiName = config.Get("restApiName") ?? "testrestApiName";
var validatorName = config.Get("validatorName") ?? "testvalidatorName";
var validateRequestBody = config.Get("validateRequestBody") ?? "testvalidateRequestBody";
var validateRequestParameters = config.Get("validateRequestParameters") ?? true;
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = restApiName,
});
var requestValidator = new AwsNative.ApiGateway.RequestValidator("requestValidator", new()
{
Name = validatorName,
RestApiId = restApi.Id,
ValidateRequestBody = validateRequestBody,
ValidateRequestParameters = validateRequestParameters,
});
var method = new AwsNative.ApiGateway.Method("method", new()
{
HttpMethod = "POST",
ResourceId = restApi.RootResourceId,
RestApiId = restApi.Id,
AuthorizationType = "NONE",
Integration = new AwsNative.ApiGateway.Inputs.MethodIntegrationArgs
{
Type = AwsNative.ApiGateway.MethodIntegrationType.Mock,
ContentHandling = System.Enum.Parse<AwsNative.ApiGateway.MethodIntegrationContentHandling>(contentHandling),
IntegrationResponses = new[]
{
new AwsNative.ApiGateway.Inputs.MethodIntegrationResponseArgs
{
ContentHandling = System.Enum.Parse<AwsNative.ApiGateway.MethodIntegrationResponseContentHandling>(contentHandling),
StatusCode = "400",
},
},
},
RequestValidatorId = requestValidator.Id,
OperationName = operationName,
});
return new Dictionary<string, object?>
{
["rootResourceId"] = restApi.RootResourceId,
};
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
contentHandling := cfg.Require("contentHandling")
operationName := "testoperationName"
if param := cfg.Get("operationName"); param != "" {
operationName = param
}
restApiName := "testrestApiName"
if param := cfg.Get("restApiName"); param != "" {
restApiName = param
}
validatorName := "testvalidatorName"
if param := cfg.Get("validatorName"); param != "" {
validatorName = param
}
validateRequestBody := "testvalidateRequestBody"
if param := cfg.Get("validateRequestBody"); param != "" {
validateRequestBody = param
}
validateRequestParameters := true
if param := cfg.Get("validateRequestParameters"); param != "" {
validateRequestParameters = param
}
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(restApiName),
})
if err != nil {
return err
}
requestValidator, err := apigateway.NewRequestValidator(ctx, "requestValidator", &apigateway.RequestValidatorArgs{
Name: pulumi.String(validatorName),
RestApiId: restApi.ID(),
ValidateRequestBody: pulumi.String(validateRequestBody),
ValidateRequestParameters: pulumi.String(validateRequestParameters),
})
if err != nil {
return err
}
_, err = apigateway.NewMethod(ctx, "method", &apigateway.MethodArgs{
HttpMethod: pulumi.String("POST"),
ResourceId: restApi.RootResourceId,
RestApiId: restApi.ID(),
AuthorizationType: pulumi.String("NONE"),
Integration: &apigateway.MethodIntegrationArgs{
Type: apigateway.MethodIntegrationTypeMock,
ContentHandling: apigateway.MethodIntegrationContentHandling(contentHandling),
IntegrationResponses: apigateway.MethodIntegrationResponseArray{
&apigateway.MethodIntegrationResponseArgs{
ContentHandling: apigateway.MethodIntegrationResponseContentHandling(contentHandling),
StatusCode: pulumi.String("400"),
},
},
},
RequestValidatorId: requestValidator.ID(),
OperationName: pulumi.String(operationName),
})
if err != nil {
return err
}
ctx.Export("rootResourceId", restApi.RootResourceId)
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
content_handling = config.require("contentHandling")
operation_name = config.get("operationName")
if operation_name is None:
operation_name = "testoperationName"
rest_api_name = config.get("restApiName")
if rest_api_name is None:
rest_api_name = "testrestApiName"
validator_name = config.get("validatorName")
if validator_name is None:
validator_name = "testvalidatorName"
validate_request_body = config.get("validateRequestBody")
if validate_request_body is None:
validate_request_body = "testvalidateRequestBody"
validate_request_parameters = config.get("validateRequestParameters")
if validate_request_parameters is None:
validate_request_parameters = True
rest_api = aws_native.apigateway.RestApi("restApi", name=rest_api_name)
request_validator = aws_native.apigateway.RequestValidator("requestValidator",
name=validator_name,
rest_api_id=rest_api.id,
validate_request_body=validate_request_body,
validate_request_parameters=validate_request_parameters)
method = aws_native.apigateway.Method("method",
http_method="POST",
resource_id=rest_api.root_resource_id,
rest_api_id=rest_api.id,
authorization_type="NONE",
integration=aws_native.apigateway.MethodIntegrationArgs(
type=aws_native.apigateway.MethodIntegrationType.MOCK,
content_handling=aws_native.apigateway.MethodIntegrationContentHandling(content_handling),
integration_responses=[aws_native.apigateway.MethodIntegrationResponseArgs(
content_handling=aws_native.apigateway.MethodIntegrationResponseContentHandling(content_handling),
status_code="400",
)],
),
request_validator_id=request_validator.id,
operation_name=operation_name)
pulumi.export("rootResourceId", rest_api.root_resource_id)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const contentHandling = config.require("contentHandling");
const operationName = config.get("operationName") || "testoperationName";
const restApiName = config.get("restApiName") || "testrestApiName";
const validatorName = config.get("validatorName") || "testvalidatorName";
const validateRequestBody = config.get("validateRequestBody") || "testvalidateRequestBody";
const validateRequestParameters = config.get("validateRequestParameters") || true;
const restApi = new aws_native.apigateway.RestApi("restApi", {name: restApiName});
const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
name: validatorName,
restApiId: restApi.id,
validateRequestBody: validateRequestBody,
validateRequestParameters: validateRequestParameters,
});
const method = new aws_native.apigateway.Method("method", {
httpMethod: "POST",
resourceId: restApi.rootResourceId,
restApiId: restApi.id,
authorizationType: "NONE",
integration: {
type: aws_native.apigateway.MethodIntegrationType.Mock,
contentHandling: aws_native.apigateway.MethodIntegrationContentHandling[contentHandling],
integrationResponses: [{
contentHandling: aws_native.apigateway.MethodIntegrationResponseContentHandling[contentHandling],
statusCode: "400",
}],
},
requestValidatorId: requestValidator.id,
operationName: operationName,
});
export const rootResourceId = restApi.rootResourceId;
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var validatorName = config.Require("validatorName");
var validateRequestBody = config.Require("validateRequestBody");
var validateRequestParameters = config.Require("validateRequestParameters");
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = apiName,
});
var requestValidator = new AwsNative.ApiGateway.RequestValidator("requestValidator", new()
{
Name = validatorName,
RestApiId = restApi.Id,
ValidateRequestBody = validateRequestBody,
ValidateRequestParameters = validateRequestParameters,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
validatorName := cfg.Require("validatorName")
validateRequestBody := cfg.Require("validateRequestBody")
validateRequestParameters := cfg.Require("validateRequestParameters")
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
_, err = apigateway.NewRequestValidator(ctx, "requestValidator", &apigateway.RequestValidatorArgs{
Name: pulumi.String(validatorName),
RestApiId: restApi.ID(),
ValidateRequestBody: pulumi.String(validateRequestBody),
ValidateRequestParameters: pulumi.String(validateRequestParameters),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
validator_name = config.require("validatorName")
validate_request_body = config.require("validateRequestBody")
validate_request_parameters = config.require("validateRequestParameters")
rest_api = aws_native.apigateway.RestApi("restApi", name=api_name)
request_validator = aws_native.apigateway.RequestValidator("requestValidator",
name=validator_name,
rest_api_id=rest_api.id,
validate_request_body=validate_request_body,
validate_request_parameters=validate_request_parameters)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const validatorName = config.require("validatorName");
const validateRequestBody = config.require("validateRequestBody");
const validateRequestParameters = config.require("validateRequestParameters");
const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
name: validatorName,
restApiId: restApi.id,
validateRequestBody: validateRequestBody,
validateRequestParameters: validateRequestParameters,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var validatorName = config.Require("validatorName");
var validateRequestBody = config.Require("validateRequestBody");
var validateRequestParameters = config.Require("validateRequestParameters");
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Name = apiName,
});
var requestValidator = new AwsNative.ApiGateway.RequestValidator("requestValidator", new()
{
Name = validatorName,
RestApiId = restApi.Id,
ValidateRequestBody = validateRequestBody,
ValidateRequestParameters = validateRequestParameters,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
validatorName := cfg.Require("validatorName")
validateRequestBody := cfg.Require("validateRequestBody")
validateRequestParameters := cfg.Require("validateRequestParameters")
restApi, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
_, err = apigateway.NewRequestValidator(ctx, "requestValidator", &apigateway.RequestValidatorArgs{
Name: pulumi.String(validatorName),
RestApiId: restApi.ID(),
ValidateRequestBody: pulumi.String(validateRequestBody),
ValidateRequestParameters: pulumi.String(validateRequestParameters),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
validator_name = config.require("validatorName")
validate_request_body = config.require("validateRequestBody")
validate_request_parameters = config.require("validateRequestParameters")
rest_api = aws_native.apigateway.RestApi("restApi", name=api_name)
request_validator = aws_native.apigateway.RequestValidator("requestValidator",
name=validator_name,
rest_api_id=rest_api.id,
validate_request_body=validate_request_body,
validate_request_parameters=validate_request_parameters)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const validatorName = config.require("validatorName");
const validateRequestBody = config.require("validateRequestBody");
const validateRequestParameters = config.require("validateRequestParameters");
const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
name: validatorName,
restApiId: restApi.id,
validateRequestBody: validateRequestBody,
validateRequestParameters: validateRequestParameters,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var type = config.Require("type");
var myRestApi = new AwsNative.ApiGateway.RestApi("myRestApi", new()
{
EndpointConfiguration = new AwsNative.ApiGateway.Inputs.RestApiEndpointConfigurationArgs
{
Types = new[]
{
type,
},
},
Name = apiName,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
_type := cfg.Require("type")
_, err := apigateway.NewRestApi(ctx, "myRestApi", &apigateway.RestApiArgs{
EndpointConfiguration: &apigateway.RestApiEndpointConfigurationArgs{
Types: pulumi.StringArray{
pulumi.String(_type),
},
},
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
type = config.require("type")
my_rest_api = aws_native.apigateway.RestApi("myRestApi",
endpoint_configuration=aws_native.apigateway.RestApiEndpointConfigurationArgs(
types=[type],
),
name=api_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const type = config.require("type");
const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
endpointConfiguration: {
types: [type],
},
name: apiName,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiName = config.Require("apiName");
var type = config.Require("type");
var myRestApi = new AwsNative.ApiGateway.RestApi("myRestApi", new()
{
EndpointConfiguration = new AwsNative.ApiGateway.Inputs.RestApiEndpointConfigurationArgs
{
Types = new[]
{
type,
},
},
Name = apiName,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiName := cfg.Require("apiName")
_type := cfg.Require("type")
_, err := apigateway.NewRestApi(ctx, "myRestApi", &apigateway.RestApiArgs{
EndpointConfiguration: &apigateway.RestApiEndpointConfigurationArgs{
Types: pulumi.StringArray{
pulumi.String(_type),
},
},
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_name = config.require("apiName")
type = config.require("type")
my_rest_api = aws_native.apigateway.RestApi("myRestApi",
endpoint_configuration=aws_native.apigateway.RestApiEndpointConfigurationArgs(
types=[type],
),
name=api_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiName = config.require("apiName");
const type = config.require("type");
const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
endpointConfiguration: {
types: [type],
},
name: apiName,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Body = new Dictionary<string, object?>
{
["swagger"] = 2,
["info"] = new Dictionary<string, object?>
{
["version"] = "0.0.1",
["title"] = "test",
},
["basePath"] = "/pete",
["schemes"] = new[]
{
"https",
},
["definitions"] = new Dictionary<string, object?>
{
["empty"] = new Dictionary<string, object?>
{
["type"] = "object",
},
},
},
Name = "myApi",
Parameters =
{
{ "endpointConfigurationTypes", "REGIONAL" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Body: pulumi.Any(map[string]interface{}{
"swagger": 2,
"info": map[string]interface{}{
"version": "0.0.1",
"title": "test",
},
"basePath": "/pete",
"schemes": []string{
"https",
},
"definitions": map[string]interface{}{
"empty": map[string]interface{}{
"type": "object",
},
},
}),
Name: pulumi.String("myApi"),
Parameters: pulumi.StringMap{
"endpointConfigurationTypes": pulumi.String("REGIONAL"),
},
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
rest_api = aws_native.apigateway.RestApi("restApi",
body={
"swagger": 2,
"info": {
"version": "0.0.1",
"title": "test",
},
"basePath": "/pete",
"schemes": ["https"],
"definitions": {
"empty": {
"type": "object",
},
},
},
name="myApi",
parameters={
"endpointConfigurationTypes": "REGIONAL",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const restApi = new aws_native.apigateway.RestApi("restApi", {
body: {
swagger: 2,
info: {
version: "0.0.1",
title: "test",
},
basePath: "/pete",
schemes: ["https"],
definitions: {
empty: {
type: "object",
},
},
},
name: "myApi",
parameters: {
endpointConfigurationTypes: "REGIONAL",
},
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var restApi = new AwsNative.ApiGateway.RestApi("restApi", new()
{
Body = new Dictionary<string, object?>
{
["swagger"] = 2,
["info"] = new Dictionary<string, object?>
{
["version"] = "0.0.1",
["title"] = "test",
},
["basePath"] = "/pete",
["schemes"] = new[]
{
"https",
},
["definitions"] = new Dictionary<string, object?>
{
["empty"] = new Dictionary<string, object?>
{
["type"] = "object",
},
},
},
Name = "myApi",
Parameters =
{
{ "endpointConfigurationTypes", "REGIONAL" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apigateway.NewRestApi(ctx, "restApi", &apigateway.RestApiArgs{
Body: pulumi.Any(map[string]interface{}{
"swagger": 2,
"info": map[string]interface{}{
"version": "0.0.1",
"title": "test",
},
"basePath": "/pete",
"schemes": []string{
"https",
},
"definitions": map[string]interface{}{
"empty": map[string]interface{}{
"type": "object",
},
},
}),
Name: pulumi.String("myApi"),
Parameters: pulumi.StringMap{
"endpointConfigurationTypes": pulumi.String("REGIONAL"),
},
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
rest_api = aws_native.apigateway.RestApi("restApi",
body={
"swagger": 2,
"info": {
"version": "0.0.1",
"title": "test",
},
"basePath": "/pete",
"schemes": ["https"],
"definitions": {
"empty": {
"type": "object",
},
},
},
name="myApi",
parameters={
"endpointConfigurationTypes": "REGIONAL",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const restApi = new aws_native.apigateway.RestApi("restApi", {
body: {
swagger: 2,
info: {
version: "0.0.1",
title: "test",
},
basePath: "/pete",
schemes: ["https"],
definitions: {
empty: {
type: "object",
},
},
},
name: "myApi",
parameters: {
endpointConfigurationTypes: "REGIONAL",
},
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiKeySourceType = config.Require("apiKeySourceType");
var apiName = config.Require("apiName");
var binaryMediaType1 = config.Require("binaryMediaType1");
var binaryMediaType2 = config.Require("binaryMediaType2");
var minimumCompressionSize = config.Require("minimumCompressionSize");
var myRestApi = new AwsNative.ApiGateway.RestApi("myRestApi", new()
{
ApiKeySourceType = apiKeySourceType,
BinaryMediaTypes = new[]
{
binaryMediaType1,
binaryMediaType2,
},
MinimumCompressionSize = minimumCompressionSize,
Name = apiName,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiKeySourceType := cfg.Require("apiKeySourceType")
apiName := cfg.Require("apiName")
binaryMediaType1 := cfg.Require("binaryMediaType1")
binaryMediaType2 := cfg.Require("binaryMediaType2")
minimumCompressionSize := cfg.Require("minimumCompressionSize")
_, err := apigateway.NewRestApi(ctx, "myRestApi", &apigateway.RestApiArgs{
ApiKeySourceType: pulumi.String(apiKeySourceType),
BinaryMediaTypes: pulumi.StringArray{
pulumi.String(binaryMediaType1),
pulumi.String(binaryMediaType2),
},
MinimumCompressionSize: pulumi.String(minimumCompressionSize),
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_key_source_type = config.require("apiKeySourceType")
api_name = config.require("apiName")
binary_media_type1 = config.require("binaryMediaType1")
binary_media_type2 = config.require("binaryMediaType2")
minimum_compression_size = config.require("minimumCompressionSize")
my_rest_api = aws_native.apigateway.RestApi("myRestApi",
api_key_source_type=api_key_source_type,
binary_media_types=[
binary_media_type1,
binary_media_type2,
],
minimum_compression_size=minimum_compression_size,
name=api_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiKeySourceType = config.require("apiKeySourceType");
const apiName = config.require("apiName");
const binaryMediaType1 = config.require("binaryMediaType1");
const binaryMediaType2 = config.require("binaryMediaType2");
const minimumCompressionSize = config.require("minimumCompressionSize");
const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
apiKeySourceType: apiKeySourceType,
binaryMediaTypes: [
binaryMediaType1,
binaryMediaType2,
],
minimumCompressionSize: minimumCompressionSize,
name: apiName,
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var apiKeySourceType = config.Require("apiKeySourceType");
var apiName = config.Require("apiName");
var binaryMediaType1 = config.Require("binaryMediaType1");
var binaryMediaType2 = config.Require("binaryMediaType2");
var minimumCompressionSize = config.Require("minimumCompressionSize");
var myRestApi = new AwsNative.ApiGateway.RestApi("myRestApi", new()
{
ApiKeySourceType = apiKeySourceType,
BinaryMediaTypes = new[]
{
binaryMediaType1,
binaryMediaType2,
},
MinimumCompressionSize = minimumCompressionSize,
Name = apiName,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
apiKeySourceType := cfg.Require("apiKeySourceType")
apiName := cfg.Require("apiName")
binaryMediaType1 := cfg.Require("binaryMediaType1")
binaryMediaType2 := cfg.Require("binaryMediaType2")
minimumCompressionSize := cfg.Require("minimumCompressionSize")
_, err := apigateway.NewRestApi(ctx, "myRestApi", &apigateway.RestApiArgs{
ApiKeySourceType: pulumi.String(apiKeySourceType),
BinaryMediaTypes: pulumi.StringArray{
pulumi.String(binaryMediaType1),
pulumi.String(binaryMediaType2),
},
MinimumCompressionSize: pulumi.String(minimumCompressionSize),
Name: pulumi.String(apiName),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
api_key_source_type = config.require("apiKeySourceType")
api_name = config.require("apiName")
binary_media_type1 = config.require("binaryMediaType1")
binary_media_type2 = config.require("binaryMediaType2")
minimum_compression_size = config.require("minimumCompressionSize")
my_rest_api = aws_native.apigateway.RestApi("myRestApi",
api_key_source_type=api_key_source_type,
binary_media_types=[
binary_media_type1,
binary_media_type2,
],
minimum_compression_size=minimum_compression_size,
name=api_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const apiKeySourceType = config.require("apiKeySourceType");
const apiName = config.require("apiName");
const binaryMediaType1 = config.require("binaryMediaType1");
const binaryMediaType2 = config.require("binaryMediaType2");
const minimumCompressionSize = config.require("minimumCompressionSize");
const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
apiKeySourceType: apiKeySourceType,
binaryMediaTypes: [
binaryMediaType1,
binaryMediaType2,
],
minimumCompressionSize: minimumCompressionSize,
name: apiName,
});
Coming soon!
Create RestApi Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RestApi(name: string, args?: RestApiArgs, opts?: CustomResourceOptions);
@overload
def RestApi(resource_name: str,
args: Optional[RestApiArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def RestApi(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_key_source_type: Optional[str] = None,
binary_media_types: Optional[Sequence[str]] = None,
body: Optional[Any] = None,
body_s3_location: Optional[RestApiS3LocationArgs] = None,
clone_from: Optional[str] = None,
description: Optional[str] = None,
disable_execute_api_endpoint: Optional[bool] = None,
endpoint_configuration: Optional[RestApiEndpointConfigurationArgs] = None,
fail_on_warnings: Optional[bool] = None,
minimum_compression_size: Optional[int] = None,
mode: Optional[str] = None,
name: Optional[str] = None,
parameters: Optional[Mapping[str, str]] = None,
policy: Optional[Any] = None,
tags: Optional[Sequence[_root_inputs.TagArgs]] = None)
func NewRestApi(ctx *Context, name string, args *RestApiArgs, opts ...ResourceOption) (*RestApi, error)
public RestApi(string name, RestApiArgs? args = null, CustomResourceOptions? opts = null)
public RestApi(String name, RestApiArgs args)
public RestApi(String name, RestApiArgs args, CustomResourceOptions options)
type: aws-native:apigateway:RestApi
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RestApi Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The RestApi resource accepts the following input properties:
- Api
Key stringSource Type - The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer. - Binary
Media List<string>Types - The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- Body object
An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- Body
S3Location Pulumi.Aws Native. Api Gateway. Inputs. Rest Api S3Location - The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- Clone
From string - The ID of the RestApi that you want to clone from.
- Description string
- The description of the RestApi.
- Disable
Execute boolApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint - Endpoint
Configuration Pulumi.Aws Native. Api Gateway. Inputs. Rest Api Endpoint Configuration - A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the
Parameters
property. - Fail
On boolWarnings - A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
. - Minimum
Compression intSize - A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- Mode string
- This property applies only when you use OpenAPI to define your REST API. The
Mode
determines how API Gateway handles resource updates. Valid values areoverwrite
ormerge
. Foroverwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged. Formerge
, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default isoverwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-levelRestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - Name string
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- Parameters Dictionary<string, string>
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
. - Policy object
A policy document that contains the permissions for the
RestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- List<Pulumi.
Aws Native. Inputs. Tag> - The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
- Api
Key stringSource Type - The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer. - Binary
Media []stringTypes - The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- Body interface{}
An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- Body
S3Location RestApi S3Location Args - The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- Clone
From string - The ID of the RestApi that you want to clone from.
- Description string
- The description of the RestApi.
- Disable
Execute boolApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint - Endpoint
Configuration RestApi Endpoint Configuration Args - A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the
Parameters
property. - Fail
On boolWarnings - A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
. - Minimum
Compression intSize - A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- Mode string
- This property applies only when you use OpenAPI to define your REST API. The
Mode
determines how API Gateway handles resource updates. Valid values areoverwrite
ormerge
. Foroverwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged. Formerge
, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default isoverwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-levelRestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - Name string
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- Parameters map[string]string
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
. - Policy interface{}
A policy document that contains the permissions for the
RestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- Tag
Args - The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
- api
Key StringSource Type - The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer. - binary
Media List<String>Types - The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- body Object
An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- body
S3Location RestApi S3Location - The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- clone
From String - The ID of the RestApi that you want to clone from.
- description String
- The description of the RestApi.
- disable
Execute BooleanApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint - endpoint
Configuration RestApi Endpoint Configuration - A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the
Parameters
property. - fail
On BooleanWarnings - A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
. - minimum
Compression IntegerSize - A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- mode String
- This property applies only when you use OpenAPI to define your REST API. The
Mode
determines how API Gateway handles resource updates. Valid values areoverwrite
ormerge
. Foroverwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged. Formerge
, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default isoverwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-levelRestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - name String
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- parameters Map<String,String>
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
. - policy Object
A policy document that contains the permissions for the
RestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- List<Tag>
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
- api
Key stringSource Type - The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer. - binary
Media string[]Types - The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- body any
An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- body
S3Location RestApi S3Location - The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- clone
From string - The ID of the RestApi that you want to clone from.
- description string
- The description of the RestApi.
- disable
Execute booleanApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint - endpoint
Configuration RestApi Endpoint Configuration - A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the
Parameters
property. - fail
On booleanWarnings - A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
. - minimum
Compression numberSize - A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- mode string
- This property applies only when you use OpenAPI to define your REST API. The
Mode
determines how API Gateway handles resource updates. Valid values areoverwrite
ormerge
. Foroverwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged. Formerge
, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default isoverwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-levelRestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - name string
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- parameters {[key: string]: string}
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
. - policy any
A policy document that contains the permissions for the
RestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- Tag[]
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
- api_
key_ strsource_ type - The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer. - binary_
media_ Sequence[str]types - The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- body Any
An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- body_
s3_ Restlocation Api S3Location Args - The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- clone_
from str - The ID of the RestApi that you want to clone from.
- description str
- The description of the RestApi.
- disable_
execute_ boolapi_ endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint - endpoint_
configuration RestApi Endpoint Configuration Args - A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the
Parameters
property. - fail_
on_ boolwarnings - A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
. - minimum_
compression_ intsize - A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- mode str
- This property applies only when you use OpenAPI to define your REST API. The
Mode
determines how API Gateway handles resource updates. Valid values areoverwrite
ormerge
. Foroverwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged. Formerge
, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default isoverwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-levelRestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - name str
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- parameters Mapping[str, str]
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
. - policy Any
A policy document that contains the permissions for the
RestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- Sequence[Tag
Args] - The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
- api
Key StringSource Type - The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer. - binary
Media List<String>Types - The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- body Any
An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- body
S3Location Property Map - The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- clone
From String - The ID of the RestApi that you want to clone from.
- description String
- The description of the RestApi.
- disable
Execute BooleanApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint - endpoint
Configuration Property Map - A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the
Parameters
property. - fail
On BooleanWarnings - A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
. - minimum
Compression NumberSize - A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- mode String
- This property applies only when you use OpenAPI to define your REST API. The
Mode
determines how API Gateway handles resource updates. Valid values areoverwrite
ormerge
. Foroverwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged. Formerge
, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default isoverwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-levelRestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - name String
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- parameters Map<String>
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
. - policy Any
A policy document that contains the permissions for the
RestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.Search the CloudFormation User Guide for
AWS::ApiGateway::RestApi
for more information about the expected schema for this property.- List<Property Map>
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
Outputs
All input properties are implicitly available as output properties. Additionally, the RestApi resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Rest
Api stringId - The string identifier of the associated RestApi.
- Root
Resource stringId - The root resource ID for a
RestApi
resource, such asa0bc123d4e
.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rest
Api stringId - The string identifier of the associated RestApi.
- Root
Resource stringId - The root resource ID for a
RestApi
resource, such asa0bc123d4e
.
- id String
- The provider-assigned unique ID for this managed resource.
- rest
Api StringId - The string identifier of the associated RestApi.
- root
Resource StringId - The root resource ID for a
RestApi
resource, such asa0bc123d4e
.
- id string
- The provider-assigned unique ID for this managed resource.
- rest
Api stringId - The string identifier of the associated RestApi.
- root
Resource stringId - The root resource ID for a
RestApi
resource, such asa0bc123d4e
.
- id str
- The provider-assigned unique ID for this managed resource.
- rest_
api_ strid - The string identifier of the associated RestApi.
- root_
resource_ strid - The root resource ID for a
RestApi
resource, such asa0bc123d4e
.
- id String
- The provider-assigned unique ID for this managed resource.
- rest
Api StringId - The string identifier of the associated RestApi.
- root
Resource StringId - The root resource ID for a
RestApi
resource, such asa0bc123d4e
.
Supporting Types
RestApiEndpointConfiguration, RestApiEndpointConfigurationArgs
- Types List<string>
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
. - Vpc
Endpoint List<string>Ids - A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for
PRIVATE
endpoint type.
- Types []string
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
. - Vpc
Endpoint []stringIds - A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for
PRIVATE
endpoint type.
- types List<String>
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
. - vpc
Endpoint List<String>Ids - A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for
PRIVATE
endpoint type.
- types string[]
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
. - vpc
Endpoint string[]Ids - A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for
PRIVATE
endpoint type.
- types Sequence[str]
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
. - vpc_
endpoint_ Sequence[str]ids - A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for
PRIVATE
endpoint type.
- types List<String>
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
. - vpc
Endpoint List<String>Ids - A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for
PRIVATE
endpoint type.
RestApiS3Location, RestApiS3LocationArgs
- Bucket string
- The name of the S3 bucket where the OpenAPI file is stored.
- ETag string
- The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag validation of your OpenAPI file.
- Key string
- The file name of the OpenAPI file (Amazon S3 object name).
- Version string
- For versioning-enabled buckets, a specific version of the OpenAPI file.
- Bucket string
- The name of the S3 bucket where the OpenAPI file is stored.
- ETag string
- The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag validation of your OpenAPI file.
- Key string
- The file name of the OpenAPI file (Amazon S3 object name).
- Version string
- For versioning-enabled buckets, a specific version of the OpenAPI file.
- bucket String
- The name of the S3 bucket where the OpenAPI file is stored.
- e
Tag String - The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag validation of your OpenAPI file.
- key String
- The file name of the OpenAPI file (Amazon S3 object name).
- version String
- For versioning-enabled buckets, a specific version of the OpenAPI file.
- bucket string
- The name of the S3 bucket where the OpenAPI file is stored.
- e
Tag string - The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag validation of your OpenAPI file.
- key string
- The file name of the OpenAPI file (Amazon S3 object name).
- version string
- For versioning-enabled buckets, a specific version of the OpenAPI file.
- bucket str
- The name of the S3 bucket where the OpenAPI file is stored.
- e_
tag str - The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag validation of your OpenAPI file.
- key str
- The file name of the OpenAPI file (Amazon S3 object name).
- version str
- For versioning-enabled buckets, a specific version of the OpenAPI file.
- bucket String
- The name of the S3 bucket where the OpenAPI file is stored.
- e
Tag String - The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag validation of your OpenAPI file.
- key String
- The file name of the OpenAPI file (Amazon S3 object name).
- version String
- For versioning-enabled buckets, a specific version of the OpenAPI file.
Tag, TagArgs
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
AWS Native is in preview. AWS Classic is fully supported.