Class RestApi
Provides an API Gateway REST API.
Note: Amazon API Gateway Version 1 resources are used for creating and deploying REST APIs. To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2.
Example Usage
Basic
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var myDemoAPI = new Aws.ApiGateway.RestApi("myDemoAPI", new Aws.ApiGateway.RestApiArgs
{
Description = "This is my API for demonstration purposes",
});
}
}
Regional Endpoint Type
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.ApiGateway.RestApi("example", new Aws.ApiGateway.RestApiArgs
{
EndpointConfiguration = new Aws.ApiGateway.Inputs.RestApiEndpointConfigurationArgs
{
Types = "REGIONAL",
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.ApiGateway
Assembly: Pulumi.Aws.dll
Syntax
public class RestApi : CustomResource
Constructors
View SourceRestApi(String, RestApiArgs, CustomResourceOptions)
Create a RestApi resource with the given unique name, arguments, and options.
Declaration
public RestApi(string name, RestApiArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RestApiArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceApiKeySource
The source of the API key for requests. Valid values are HEADER (default) and AUTHORIZER.
Declaration
public Output<string> ApiKeySource { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Arn
Amazon Resource Name (ARN)
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
BinaryMediaTypes
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
Declaration
public Output<ImmutableArray<string>> BinaryMediaTypes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Body
An OpenAPI specification that defines the set of routes and integrations to create as part of the REST API.
Declaration
public Output<string> Body { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreatedDate
The creation date of the REST API
Declaration
public Output<string> CreatedDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
The description of the REST API
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EndpointConfiguration
Nested argument defining API endpoint configuration including endpoint type. Defined below.
Declaration
public Output<RestApiEndpointConfiguration> EndpointConfiguration { get; }
Property Value
| Type | Description |
|---|---|
| Output<RestApiEndpointConfiguration> |
ExecutionArn
The execution ARN part to be used in lambda_permission's source_arn
when allowing API Gateway to invoke a Lambda function,
e.g. arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j, which can be concatenated with allowed stage, method and resource path.
Declaration
public Output<string> ExecutionArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MinimumCompressionSize
Minimum response size to compress for the REST API. Integer between -1 and 10485760 (10MB). Setting a value greater than -1 will enable compression, -1 disables compression (default).
Declaration
public Output<int?> MinimumCompressionSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Name
The name of the REST API
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Policy
JSON formatted policy document that controls access to the API Gateway.
Declaration
public Output<string> Policy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RootResourceId
The resource ID of the REST API's root
Declaration
public Output<string> RootResourceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
Key-value map of resource tags
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Methods
View SourceGet(String, Input<String>, RestApiState, CustomResourceOptions)
Get an existing RestApi resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static RestApi Get(string name, Input<string> id, RestApiState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| RestApiState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| RestApi |