aws.apigateway.RestApiPut
Explore with Pulumi AI
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.apigateway.RestApiPut("example", {
body: JSON.stringify({
swagger: "2.0",
info: {
title: "Example API",
version: "v1",
},
schemes: ["https"],
paths: {
"/example": {
get: {
responses: {
"200": {
description: "OK",
},
},
"x-amazon-apigateway-integration": {
httpMethod: "GET",
type: "HTTP",
responses: {
"default": {
statusCode: 200,
},
},
uri: "https://api.example.com/",
},
},
},
},
}),
failOnWarnings: true,
restApiId: exampleAwsApiGatewayRestApi.id,
});
import pulumi
import json
import pulumi_aws as aws
example = aws.apigateway.RestApiPut("example",
body=json.dumps({
"swagger": "2.0",
"info": {
"title": "Example API",
"version": "v1",
},
"schemes": ["https"],
"paths": {
"/example": {
"get": {
"responses": {
"200": {
"description": "OK",
},
},
"x-amazon-apigateway-integration": {
"httpMethod": "GET",
"type": "HTTP",
"responses": {
"default": {
"statusCode": 200,
},
},
"uri": "https://api.example.com/",
},
},
},
},
}),
fail_on_warnings=True,
rest_api_id=example_aws_api_gateway_rest_api["id"])
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"swagger": "2.0",
"info": map[string]interface{}{
"title": "Example API",
"version": "v1",
},
"schemes": []string{
"https",
},
"paths": map[string]interface{}{
"/example": map[string]interface{}{
"get": map[string]interface{}{
"responses": map[string]interface{}{
"200": map[string]interface{}{
"description": "OK",
},
},
"x-amazon-apigateway-integration": map[string]interface{}{
"httpMethod": "GET",
"type": "HTTP",
"responses": map[string]interface{}{
"default": map[string]interface{}{
"statusCode": 200,
},
},
"uri": "https://api.example.com/",
},
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = apigateway.NewRestApiPut(ctx, "example", &apigateway.RestApiPutArgs{
Body: pulumi.String(json0),
FailOnWarnings: pulumi.Bool(true),
RestApiId: pulumi.Any(exampleAwsApiGatewayRestApi.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.ApiGateway.RestApiPut("example", new()
{
Body = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["swagger"] = "2.0",
["info"] = new Dictionary<string, object?>
{
["title"] = "Example API",
["version"] = "v1",
},
["schemes"] = new[]
{
"https",
},
["paths"] = new Dictionary<string, object?>
{
["/example"] = new Dictionary<string, object?>
{
["get"] = new Dictionary<string, object?>
{
["responses"] = new Dictionary<string, object?>
{
["200"] = new Dictionary<string, object?>
{
["description"] = "OK",
},
},
["x-amazon-apigateway-integration"] = new Dictionary<string, object?>
{
["httpMethod"] = "GET",
["type"] = "HTTP",
["responses"] = new Dictionary<string, object?>
{
["default"] = new Dictionary<string, object?>
{
["statusCode"] = 200,
},
},
["uri"] = "https://api.example.com/",
},
},
},
},
}),
FailOnWarnings = true,
RestApiId = exampleAwsApiGatewayRestApi.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.RestApiPut;
import com.pulumi.aws.apigateway.RestApiPutArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new RestApiPut("example", RestApiPutArgs.builder()
.body(serializeJson(
jsonObject(
jsonProperty("swagger", "2.0"),
jsonProperty("info", jsonObject(
jsonProperty("title", "Example API"),
jsonProperty("version", "v1")
)),
jsonProperty("schemes", jsonArray("https")),
jsonProperty("paths", jsonObject(
jsonProperty("/example", jsonObject(
jsonProperty("get", jsonObject(
jsonProperty("responses", jsonObject(
jsonProperty("200", jsonObject(
jsonProperty("description", "OK")
))
)),
jsonProperty("x-amazon-apigateway-integration", jsonObject(
jsonProperty("httpMethod", "GET"),
jsonProperty("type", "HTTP"),
jsonProperty("responses", jsonObject(
jsonProperty("default", jsonObject(
jsonProperty("statusCode", 200)
))
)),
jsonProperty("uri", "https://api.example.com/")
))
))
))
))
)))
.failOnWarnings(true)
.restApiId(exampleAwsApiGatewayRestApi.id())
.build());
}
}
resources:
example:
type: aws:apigateway:RestApiPut
properties:
body:
fn::toJSON:
swagger: '2.0'
info:
title: Example API
version: v1
schemes:
- https
paths:
/example:
get:
responses:
'200':
description: OK
x-amazon-apigateway-integration:
httpMethod: GET
type: HTTP
responses:
default:
statusCode: 200
uri: https://api.example.com/
failOnWarnings: true
restApiId: ${exampleAwsApiGatewayRestApi.id}
Create RestApiPut Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RestApiPut(name: string, args: RestApiPutArgs, opts?: CustomResourceOptions);
@overload
def RestApiPut(resource_name: str,
args: RestApiPutArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RestApiPut(resource_name: str,
opts: Optional[ResourceOptions] = None,
body: Optional[str] = None,
rest_api_id: Optional[str] = None,
fail_on_warnings: Optional[bool] = None,
parameters: Optional[Mapping[str, str]] = None,
timeouts: Optional[RestApiPutTimeoutsArgs] = None,
triggers: Optional[Mapping[str, str]] = None)
func NewRestApiPut(ctx *Context, name string, args RestApiPutArgs, opts ...ResourceOption) (*RestApiPut, error)
public RestApiPut(string name, RestApiPutArgs args, CustomResourceOptions? opts = null)
public RestApiPut(String name, RestApiPutArgs args)
public RestApiPut(String name, RestApiPutArgs args, CustomResourceOptions options)
type: aws:apigateway:RestApiPut
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 RestApiPutArgs
- 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 RestApiPutArgs
- 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 RestApiPutArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RestApiPutArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RestApiPutArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var restApiPutResource = new Aws.ApiGateway.RestApiPut("restApiPutResource", new()
{
Body = "string",
RestApiId = "string",
FailOnWarnings = false,
Parameters =
{
{ "string", "string" },
},
Timeouts = new Aws.ApiGateway.Inputs.RestApiPutTimeoutsArgs
{
Create = "string",
},
Triggers =
{
{ "string", "string" },
},
});
example, err := apigateway.NewRestApiPut(ctx, "restApiPutResource", &apigateway.RestApiPutArgs{
Body: pulumi.String("string"),
RestApiId: pulumi.String("string"),
FailOnWarnings: pulumi.Bool(false),
Parameters: pulumi.StringMap{
"string": pulumi.String("string"),
},
Timeouts: &apigateway.RestApiPutTimeoutsArgs{
Create: pulumi.String("string"),
},
Triggers: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var restApiPutResource = new RestApiPut("restApiPutResource", RestApiPutArgs.builder()
.body("string")
.restApiId("string")
.failOnWarnings(false)
.parameters(Map.of("string", "string"))
.timeouts(RestApiPutTimeoutsArgs.builder()
.create("string")
.build())
.triggers(Map.of("string", "string"))
.build());
rest_api_put_resource = aws.apigateway.RestApiPut("restApiPutResource",
body="string",
rest_api_id="string",
fail_on_warnings=False,
parameters={
"string": "string",
},
timeouts={
"create": "string",
},
triggers={
"string": "string",
})
const restApiPutResource = new aws.apigateway.RestApiPut("restApiPutResource", {
body: "string",
restApiId: "string",
failOnWarnings: false,
parameters: {
string: "string",
},
timeouts: {
create: "string",
},
triggers: {
string: "string",
},
});
type: aws:apigateway:RestApiPut
properties:
body: string
failOnWarnings: false
parameters:
string: string
restApiId: string
timeouts:
create: string
triggers:
string: string
RestApiPut Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RestApiPut resource accepts the following input properties:
- Body string
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- Rest
Api stringId Identifier of the associated REST API.
The following arguments are optional:
- Fail
On boolWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - Parameters Dictionary<string, string>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Timeouts
Rest
Api Put Timeouts - Triggers Dictionary<string, string>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- Body string
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- Rest
Api stringId Identifier of the associated REST API.
The following arguments are optional:
- Fail
On boolWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - Parameters map[string]string
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Timeouts
Rest
Api Put Timeouts Args - Triggers map[string]string
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body String
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- rest
Api StringId Identifier of the associated REST API.
The following arguments are optional:
- fail
On BooleanWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters Map<String,String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - timeouts
Rest
Api Put Timeouts - triggers Map<String,String>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body string
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- rest
Api stringId Identifier of the associated REST API.
The following arguments are optional:
- fail
On booleanWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters {[key: string]: string}
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - timeouts
Rest
Api Put Timeouts - triggers {[key: string]: string}
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body str
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- rest_
api_ strid Identifier of the associated REST API.
The following arguments are optional:
- fail_
on_ boolwarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters Mapping[str, str]
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - timeouts
Rest
Api Put Timeouts Args - triggers Mapping[str, str]
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body String
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- rest
Api StringId Identifier of the associated REST API.
The following arguments are optional:
- fail
On BooleanWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters Map<String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - timeouts Property Map
- triggers Map<String>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
Outputs
All input properties are implicitly available as output properties. Additionally, the RestApiPut resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RestApiPut Resource
Get an existing RestApiPut resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RestApiPutState, opts?: CustomResourceOptions): RestApiPut
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
body: Optional[str] = None,
fail_on_warnings: Optional[bool] = None,
parameters: Optional[Mapping[str, str]] = None,
rest_api_id: Optional[str] = None,
timeouts: Optional[RestApiPutTimeoutsArgs] = None,
triggers: Optional[Mapping[str, str]] = None) -> RestApiPut
func GetRestApiPut(ctx *Context, name string, id IDInput, state *RestApiPutState, opts ...ResourceOption) (*RestApiPut, error)
public static RestApiPut Get(string name, Input<string> id, RestApiPutState? state, CustomResourceOptions? opts = null)
public static RestApiPut get(String name, Output<String> id, RestApiPutState state, CustomResourceOptions options)
resources: _: type: aws:apigateway:RestApiPut get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Body string
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- Fail
On boolWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - Parameters Dictionary<string, string>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Rest
Api stringId Identifier of the associated REST API.
The following arguments are optional:
- Timeouts
Rest
Api Put Timeouts - Triggers Dictionary<string, string>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- Body string
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- Fail
On boolWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - Parameters map[string]string
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Rest
Api stringId Identifier of the associated REST API.
The following arguments are optional:
- Timeouts
Rest
Api Put Timeouts Args - Triggers map[string]string
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body String
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- fail
On BooleanWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters Map<String,String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - rest
Api StringId Identifier of the associated REST API.
The following arguments are optional:
- timeouts
Rest
Api Put Timeouts - triggers Map<String,String>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body string
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- fail
On booleanWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters {[key: string]: string}
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - rest
Api stringId Identifier of the associated REST API.
The following arguments are optional:
- timeouts
Rest
Api Put Timeouts - triggers {[key: string]: string}
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body str
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- fail_
on_ boolwarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters Mapping[str, str]
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - rest_
api_ strid Identifier of the associated REST API.
The following arguments are optional:
- timeouts
Rest
Api Put Timeouts Args - triggers Mapping[str, str]
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
- body String
- PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
- fail
On BooleanWarnings - Whether to rollback the API update when a warning is encountered. The default value is
false
. - parameters Map<String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, useignore = "documentation"
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - rest
Api StringId Identifier of the associated REST API.
The following arguments are optional:
- timeouts Property Map
- triggers Map<String>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment. To force a redeployment without changing these keys/values, use the
-replace
option withpulumi preview
orpulumi up
.
Supporting Types
RestApiPutTimeouts, RestApiPutTimeoutsArgs
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Import
Using pulumi import
, import API Gateway REST API Put using the rest_api_id
. For example:
$ pulumi import aws:apigateway/restApiPut:RestApiPut example import-id-12345678
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.