AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.
[ aws . apigatewayv2 ]
See also: AWS API Documentation
export-api
--api-id <value>
[--export-version <value>]
[--include-extensions | --no-include-extensions]
--output-type <value>
--specification <value>
[--stage-name <value>]
<outfile>
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
--api-id
(string)
The API identifier.
--export-version
(string)
The version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is 1.0.
--include-extensions
| --no-include-extensions
(boolean)
Specifies whether to include API Gateway extensions in the exported API definition. API Gateway extensions are included by default.
--output-type
(string)
The output type of the exported definition file. Valid values are JSON and YAML.
Possible values:
YAML
JSON
--specification
(string)
The version of the API specification to use. OAS30, for OpenAPI 3.0, is the only supported value.
Possible values:
OAS30
--stage-name
(string)
The name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported.
outfile
(string)
Filename where the content will be saved
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command's default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
To export an OpenAPI definition of an HTTP API
The following export-api
example exports an OpenAPI 3.0 definition of an API stage named prod
to a YAML file named stage-definition.yaml
. The exported definition file includes API Gateway extensions by default.
aws apigatewayv2 export-api \
--api-id a1b2c3d4 \
--output-type YAML \
--specification OAS30 \
--stage-name prod \
stage-definition.yaml
This command produces no output.
For more information, see Exporting an HTTP API from API Gateway in the Amazon API Gateway Developer Guide.
body -> (blob)
Represents an exported definition of an API in a particular output format, for example, YAML. The API is serialized to the requested specification, for example, OpenAPI 3.0.