Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.aws.apigatewayv2.ApiArgs Maven / Gradle / Ivy
Go to download
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.apigatewayv2;
import com.pulumi.aws.apigatewayv2.inputs.ApiCorsConfigurationArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
public final class ApiArgs extends com.pulumi.resources.ResourceArgs {
public static final ApiArgs Empty = new ApiArgs();
/**
* An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
* Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
* Applicable for WebSocket APIs.
*
*/
@Import(name="apiKeySelectionExpression")
private @Nullable Output apiKeySelectionExpression;
/**
* @return An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
* Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
* Applicable for WebSocket APIs.
*
*/
public Optional> apiKeySelectionExpression() {
return Optional.ofNullable(this.apiKeySelectionExpression);
}
/**
* An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
*
*/
@Import(name="body")
private @Nullable Output body;
/**
* @return An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
*
*/
public Optional> body() {
return Optional.ofNullable(this.body);
}
/**
* Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
*
*/
@Import(name="corsConfiguration")
private @Nullable Output corsConfiguration;
/**
* @return Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
*
*/
public Optional> corsConfiguration() {
return Optional.ofNullable(this.corsConfiguration);
}
/**
* Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
*
*/
@Import(name="credentialsArn")
private @Nullable Output credentialsArn;
/**
* @return Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
*
*/
public Optional> credentialsArn() {
return Optional.ofNullable(this.credentialsArn);
}
/**
* Description of the API. Must be less than or equal to 1024 characters in length.
*
*/
@Import(name="description")
private @Nullable Output description;
/**
* @return Description of the API. Must be less than or equal to 1024 characters in length.
*
*/
public Optional> description() {
return Optional.ofNullable(this.description);
}
/**
* Whether clients can invoke the API by using the default `execute-api` endpoint.
* By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
* To require that clients use a custom domain name to invoke the API, disable the default endpoint.
*
*/
@Import(name="disableExecuteApiEndpoint")
private @Nullable Output disableExecuteApiEndpoint;
/**
* @return Whether clients can invoke the API by using the default `execute-api` endpoint.
* By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
* To require that clients use a custom domain name to invoke the API, disable the default endpoint.
*
*/
public Optional> disableExecuteApiEndpoint() {
return Optional.ofNullable(this.disableExecuteApiEndpoint);
}
/**
* Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
*
*/
@Import(name="failOnWarnings")
private @Nullable Output failOnWarnings;
/**
* @return Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
*
*/
public Optional> failOnWarnings() {
return Optional.ofNullable(this.failOnWarnings);
}
/**
* Name of the API. Must be less than or equal to 128 characters in length.
*
*/
@Import(name="name")
private @Nullable Output name;
/**
* @return Name of the API. Must be less than or equal to 128 characters in length.
*
*/
public Optional> name() {
return Optional.ofNullable(this.name);
}
/**
* API protocol. Valid values: `HTTP`, `WEBSOCKET`.
*
*/
@Import(name="protocolType", required=true)
private Output protocolType;
/**
* @return API protocol. Valid values: `HTTP`, `WEBSOCKET`.
*
*/
public Output protocolType() {
return this.protocolType;
}
/**
* Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
*
*/
@Import(name="routeKey")
private @Nullable Output routeKey;
/**
* @return Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
*
*/
public Optional> routeKey() {
return Optional.ofNullable(this.routeKey);
}
/**
* The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
* Defaults to `$request.method $request.path`.
*
*/
@Import(name="routeSelectionExpression")
private @Nullable Output routeSelectionExpression;
/**
* @return The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
* Defaults to `$request.method $request.path`.
*
*/
public Optional> routeSelectionExpression() {
return Optional.ofNullable(this.routeSelectionExpression);
}
/**
* Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
*/
@Import(name="tags")
private @Nullable Output> tags;
/**
* @return Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
*/
public Optional>> tags() {
return Optional.ofNullable(this.tags);
}
/**
* Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
* For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
* The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
*
*/
@Import(name="target")
private @Nullable Output target;
/**
* @return Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
* For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
* The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
*
*/
public Optional> target() {
return Optional.ofNullable(this.target);
}
/**
* Version identifier for the API. Must be between 1 and 64 characters in length.
*
*/
@Import(name="version")
private @Nullable Output version;
/**
* @return Version identifier for the API. Must be between 1 and 64 characters in length.
*
*/
public Optional> version() {
return Optional.ofNullable(this.version);
}
private ApiArgs() {}
private ApiArgs(ApiArgs $) {
this.apiKeySelectionExpression = $.apiKeySelectionExpression;
this.body = $.body;
this.corsConfiguration = $.corsConfiguration;
this.credentialsArn = $.credentialsArn;
this.description = $.description;
this.disableExecuteApiEndpoint = $.disableExecuteApiEndpoint;
this.failOnWarnings = $.failOnWarnings;
this.name = $.name;
this.protocolType = $.protocolType;
this.routeKey = $.routeKey;
this.routeSelectionExpression = $.routeSelectionExpression;
this.tags = $.tags;
this.target = $.target;
this.version = $.version;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(ApiArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private ApiArgs $;
public Builder() {
$ = new ApiArgs();
}
public Builder(ApiArgs defaults) {
$ = new ApiArgs(Objects.requireNonNull(defaults));
}
/**
* @param apiKeySelectionExpression An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
* Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
* Applicable for WebSocket APIs.
*
* @return builder
*
*/
public Builder apiKeySelectionExpression(@Nullable Output apiKeySelectionExpression) {
$.apiKeySelectionExpression = apiKeySelectionExpression;
return this;
}
/**
* @param apiKeySelectionExpression An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
* Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
* Applicable for WebSocket APIs.
*
* @return builder
*
*/
public Builder apiKeySelectionExpression(String apiKeySelectionExpression) {
return apiKeySelectionExpression(Output.of(apiKeySelectionExpression));
}
/**
* @param body An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
*
* @return builder
*
*/
public Builder body(@Nullable Output body) {
$.body = body;
return this;
}
/**
* @param body An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
*
* @return builder
*
*/
public Builder body(String body) {
return body(Output.of(body));
}
/**
* @param corsConfiguration Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder corsConfiguration(@Nullable Output corsConfiguration) {
$.corsConfiguration = corsConfiguration;
return this;
}
/**
* @param corsConfiguration Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder corsConfiguration(ApiCorsConfigurationArgs corsConfiguration) {
return corsConfiguration(Output.of(corsConfiguration));
}
/**
* @param credentialsArn Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder credentialsArn(@Nullable Output credentialsArn) {
$.credentialsArn = credentialsArn;
return this;
}
/**
* @param credentialsArn Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder credentialsArn(String credentialsArn) {
return credentialsArn(Output.of(credentialsArn));
}
/**
* @param description Description of the API. Must be less than or equal to 1024 characters in length.
*
* @return builder
*
*/
public Builder description(@Nullable Output description) {
$.description = description;
return this;
}
/**
* @param description Description of the API. Must be less than or equal to 1024 characters in length.
*
* @return builder
*
*/
public Builder description(String description) {
return description(Output.of(description));
}
/**
* @param disableExecuteApiEndpoint Whether clients can invoke the API by using the default `execute-api` endpoint.
* By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
* To require that clients use a custom domain name to invoke the API, disable the default endpoint.
*
* @return builder
*
*/
public Builder disableExecuteApiEndpoint(@Nullable Output disableExecuteApiEndpoint) {
$.disableExecuteApiEndpoint = disableExecuteApiEndpoint;
return this;
}
/**
* @param disableExecuteApiEndpoint Whether clients can invoke the API by using the default `execute-api` endpoint.
* By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
* To require that clients use a custom domain name to invoke the API, disable the default endpoint.
*
* @return builder
*
*/
public Builder disableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) {
return disableExecuteApiEndpoint(Output.of(disableExecuteApiEndpoint));
}
/**
* @param failOnWarnings Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder failOnWarnings(@Nullable Output failOnWarnings) {
$.failOnWarnings = failOnWarnings;
return this;
}
/**
* @param failOnWarnings Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder failOnWarnings(Boolean failOnWarnings) {
return failOnWarnings(Output.of(failOnWarnings));
}
/**
* @param name Name of the API. Must be less than or equal to 128 characters in length.
*
* @return builder
*
*/
public Builder name(@Nullable Output name) {
$.name = name;
return this;
}
/**
* @param name Name of the API. Must be less than or equal to 128 characters in length.
*
* @return builder
*
*/
public Builder name(String name) {
return name(Output.of(name));
}
/**
* @param protocolType API protocol. Valid values: `HTTP`, `WEBSOCKET`.
*
* @return builder
*
*/
public Builder protocolType(Output protocolType) {
$.protocolType = protocolType;
return this;
}
/**
* @param protocolType API protocol. Valid values: `HTTP`, `WEBSOCKET`.
*
* @return builder
*
*/
public Builder protocolType(String protocolType) {
return protocolType(Output.of(protocolType));
}
/**
* @param routeKey Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder routeKey(@Nullable Output routeKey) {
$.routeKey = routeKey;
return this;
}
/**
* @param routeKey Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder routeKey(String routeKey) {
return routeKey(Output.of(routeKey));
}
/**
* @param routeSelectionExpression The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
* Defaults to `$request.method $request.path`.
*
* @return builder
*
*/
public Builder routeSelectionExpression(@Nullable Output routeSelectionExpression) {
$.routeSelectionExpression = routeSelectionExpression;
return this;
}
/**
* @param routeSelectionExpression The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
* Defaults to `$request.method $request.path`.
*
* @return builder
*
*/
public Builder routeSelectionExpression(String routeSelectionExpression) {
return routeSelectionExpression(Output.of(routeSelectionExpression));
}
/**
* @param tags Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
* @return builder
*
*/
public Builder tags(@Nullable Output> tags) {
$.tags = tags;
return this;
}
/**
* @param tags Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
* @return builder
*
*/
public Builder tags(Map tags) {
return tags(Output.of(tags));
}
/**
* @param target Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
* For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
* The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder target(@Nullable Output target) {
$.target = target;
return this;
}
/**
* @param target Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
* For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
* The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
*
* @return builder
*
*/
public Builder target(String target) {
return target(Output.of(target));
}
/**
* @param version Version identifier for the API. Must be between 1 and 64 characters in length.
*
* @return builder
*
*/
public Builder version(@Nullable Output version) {
$.version = version;
return this;
}
/**
* @param version Version identifier for the API. Must be between 1 and 64 characters in length.
*
* @return builder
*
*/
public Builder version(String version) {
return version(Output.of(version));
}
public ApiArgs build() {
if ($.protocolType == null) {
throw new MissingRequiredPropertyException("ApiArgs", "protocolType");
}
return $;
}
}
}