Amazon Web Services (AWS) - Create API Gateway using the AWS CLI

by
Jeremy Canfield |
Updated: April 15 2024
| Amazon Web Services (AWS) articles
This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.
The aws apigateway create-rest-api command can be used to create the API Gateway API. By default, the endpoint will be EDGE.
aws apigateway create-rest-api --name my-api
By default, the endpoint will be EDGE. The --endpoint-configuration option can be used to set the REST API endpoint type to private.
aws apigateway create-rest-api --name my-private-api --endpoint-configuration='{"types":["PRIVATE"]}'
Something like this should be returned.
{
"apiKeySource": "HEADER",
"name": "my-rest-api",
"createdDate": 1704766329,
"endpointConfiguration": {
"types": [
"PRIVATE"
]
},
"id": "o03n2c8eha"
}
At this point, if you were to look at the API Gateway in the AWS console, you would see the API Gateway has no methods, such as GET or POST or PUT so the next thing you almost always do next is to update API Gateway with Methods.
Did you find this article helpful?
If so, consider buying me a coffee over at