Package com.pulumi.aws.apigateway
Class RestApiPut
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.apigateway.RestApiPut
-
public class RestApiPut extends com.pulumi.resources.CustomResourceResource for updating an AWS API Gateway REST API with a new API description. > **NOTE:** When importing an OpenAPI specification using the `body` argument, the `info.title` field updates the `name` of the `aws.apigateway.RestApi`. If the imported `title` differs from the configured `name`, Terraform will report the difference. ## Example Usage ### Basic Usage
## Import Using `pulumi import`, import API Gateway REST API Put using the `restApiId`. For example: ```sh $ pulumi import aws:apigateway/restApiPut:RestApiPut example import-id-12345678 ```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.ArrayList; import java.util.Arrays; 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()); } }
-
-
Constructor Summary
Constructors Constructor Description RestApiPut(java.lang.String name)RestApiPut(java.lang.String name, RestApiPutArgs args)RestApiPut(java.lang.String name, RestApiPutArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>body()com.pulumi.core.Output<java.lang.Boolean>failOnWarnings()static RestApiPutget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RestApiPutState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>parameters()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>restApiId()com.pulumi.core.Output<java.util.Optional<RestApiPutTimeouts>>timeouts()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>triggers()
-
-
-
Constructor Detail
-
RestApiPut
public RestApiPut(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
RestApiPut
public RestApiPut(java.lang.String name, RestApiPutArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
RestApiPut
public RestApiPut(java.lang.String name, RestApiPutArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
body
public com.pulumi.core.Output<java.lang.String> body()
- Returns:
- 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.
-
failOnWarnings
public com.pulumi.core.Output<java.lang.Boolean> failOnWarnings()
- Returns:
- Whether to rollback the API update when a warning is encountered. The default value is `false`.
-
parameters
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> parameters()
- Returns:
- Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, use `ignore = "documentation"`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html).
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
restApiId
public com.pulumi.core.Output<java.lang.String> restApiId()
- Returns:
- Identifier of the associated REST API. The following arguments are optional:
-
timeouts
public com.pulumi.core.Output<java.util.Optional<RestApiPutTimeouts>> timeouts()
-
triggers
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> triggers()
- Returns:
- 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 with `pulumi preview` or `pulumi up`.
-
get
public static RestApiPut get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable RestApiPutState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-