ApiMappingOptions

class aws_cdk.aws_apigateway.ApiMappingOptions(*, base_path=None)

Bases: object

Options for creating an api mapping.

Parameters:

base_path (Optional[str]) – The api path name that callers of the API must provide in the URL after the domain name (e.g. example.com/base-path). If you specify this property, it can’t be an empty string. If this is undefined, a mapping will be added for the empty path. Any request that does not match a mapping will get sent to the API that has been mapped to the empty path. Default: - map requests from the domain root (e.g. example.com).

ExampleMetadata:

infused

Example:

# acm_certificate_for_example_com: Any
# rest_api: apigateway.RestApi
# second_rest_api: apigateway.RestApi


domain = apigateway.DomainName(self, "custom-domain",
    domain_name="example.com",
    certificate=acm_certificate_for_example_com,
    mapping=rest_api
)

domain.add_api_mapping(second_rest_api.deployment_stage,
    base_path="orders/v2/api"
)

Attributes

base_path

The api path name that callers of the API must provide in the URL after the domain name (e.g. example.com/base-path). If you specify this property, it can’t be an empty string.

If this is undefined, a mapping will be added for the empty path. Any request that does not match a mapping will get sent to the API that has been mapped to the empty path.

Default:
  • map requests from the domain root (e.g. example.com).