Skip to content

create_map

create_map(
    map_name: ResourceName,
    configuration: MapConfiguration,
    *,
    config_overrides: Optional[LocationClientConfig] = None,
    pricing_plan: Optional[PricingPlan] = None,
    description: Optional[ResourceDescription] = None,
    tags: Optional[TagMap] = None,
) -> CreateMapResponse

This operation is no longer current and may be deprecated in the future. We recommend upgrading to the Maps API V2 unless you require Grab data.

  • CreateMap is part of a previous Amazon Location Service Maps API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).

  • The Maps API version 2 has a simplified interface that can be used without creating or managing map resources.

  • If you are using an AWS SDK or the AWS CLI, note that the Maps API version 2 is found under geo-maps or geo_maps, not under location.

  • Since Grab is not yet fully supported in Maps API version 2, we recommend you continue using API version 1 when using Grab.

  • Start your version 2 API journey with the Maps V2 API Reference or the Developer Guide.

Creates a map resource in your Amazon Web Services account, which provides map tiles of different styles sourced from global location data providers.

If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the Amazon Web Services service terms for more details.

Parameters:

  • map_name (ResourceName) –

    The name for the map resource.

    Requirements:

    • Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).

    • Must be a unique map resource name.

    • No spaces allowed. For example, ExampleMap.

  • configuration (MapConfiguration) –

    Specifies the MapConfiguration, including the map style, for the map resource that you create. The map style defines the look of maps and the data provider for your map resource.

  • pricing_plan (Optional[PricingPlan], default: None ) –

    No longer used. If included, the only allowed value is RequestBasedUsage.

  • description (Optional[ResourceDescription], default: None ) –

    An optional description for the map resource.

  • tags (Optional[TagMap], default: None ) –

    Applies one or more tags to the map resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.

    Format: "key" : "value"

    Restrictions:

    • Maximum 50 tags per resource

    • Each resource tag must be unique with a maximum of one value.

    • Maximum key length: 128 Unicode characters in UTF-8

    • Maximum value length: 256 Unicode characters in UTF-8

    • Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.

    • Cannot use "aws:" as a prefix for a key.

Raises:

Source code in docs_src/capo_location/_services/location.py
def create_map(
    self,
    map_name: "capo_location.types.resource_name.ResourceName",
    configuration: "capo_location.types.map_configuration.MapConfiguration",
    *,
    config_overrides: Optional[LocationClientConfig] = None,
    pricing_plan: Optional["capo_location.types.pricing_plan.PricingPlan"] = None,
    description: Optional[
        "capo_location.types.resource_description.ResourceDescription"
    ] = None,
    tags: Optional["capo_location.types.tag_map.TagMap"] = None,
) -> "capo_location.types.create_map_response.CreateMapResponse":
    """<important> <p>This operation is no longer current and may be deprecated in the future. We recommend upgrading to the Maps API V2 unless you require <code>Grab</code> data.</p> <ul> <li> <p> <code>CreateMap</code> is part of a previous Amazon Location Service Maps API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p> </li> <li> <p>The Maps API version 2 has a simplified interface that can be used without creating or managing map resources.</p> </li> <li> <p>If you are using an AWS SDK or the AWS CLI, note that the Maps API version 2 is found under <code>geo-maps</code> or <code>geo_maps</code>, not under <code>location</code>.</p> </li> <li> <p>Since <code>Grab</code> is not yet fully supported in Maps API version 2, we recommend you continue using API version 1 when using <code>Grab</code>.</p> </li> <li> <p>Start your version 2 API journey with the <a href="https://docs.aws.amazon.com/location/latest/APIReference/API_Operations_Amazon_Location_Service_Maps_V2.html">Maps V2 API Reference</a> or the <a href="https://docs.aws.amazon.com/location/latest/developerguide/maps.html">Developer Guide</a>.</p> </li> </ul> </important> <p>Creates a map resource in your Amazon Web Services account, which provides map tiles of different styles sourced from global location data providers.</p> <note> <p>If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the <a href="http://aws.amazon.com/service-terms">Amazon Web Services service terms</a> for more details.</p> </note>

    Args:
        map_name: <p>The name for the map resource.</p> <p>Requirements:</p> <ul> <li> <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_). </p> </li> <li> <p>Must be a unique map resource name. </p> </li> <li> <p>No spaces allowed. For example, <code>ExampleMap</code>.</p> </li> </ul>
        configuration: <p>Specifies the <code>MapConfiguration</code>, including the map style, for the map resource that you create. The map style defines the look of maps and the data provider for your map resource.</p>
        pricing_plan: <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
        description: <p>An optional description for the map resource.</p>
        tags: <p>Applies one or more tags to the map resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p> <p>Format: <code>"key" : "value"</code> </p> <p>Restrictions:</p> <ul> <li> <p>Maximum 50 tags per resource</p> </li> <li> <p>Each resource tag must be unique with a maximum of one value.</p> </li> <li> <p>Maximum key length: 128 Unicode characters in UTF-8</p> </li> <li> <p>Maximum value length: 256 Unicode characters in UTF-8</p> </li> <li> <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @. </p> </li> <li> <p>Cannot use "aws:" as a prefix for a key.</p> </li> </ul>

    Raises:
        capo_location.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.</p>
        capo_location.errors.conflict_exception.ConflictException: <p>The request was unsuccessful because of a conflict.</p>
        capo_location.errors.internal_server_exception.InternalServerException: <p>The request has failed to process because of an unknown server error, exception, or failure.</p>
        capo_location.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation was denied because the request would exceed the maximum <a href="https://docs.aws.amazon.com/location/previous/developerguide/location-quotas.html">quota</a> set for Amazon Location Service.</p>
        capo_location.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_location.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service. </p>
        capo_location.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_location.types.create_map_request.CreateMapRequest]",
    ) -> OperationResponse[
        "capo_location.types.create_map_response.CreateMapResponse"
    ]:
        import capo_location._operations.location_service.create_map

        output, http_response = (
            capo_location._operations.location_service.create_map.create_map(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_location.types.create_map_request.CreateMapRequest",
    ) -> dict[str, Any]:
        import capo_location.types.create_map_request

        return capo_location.types.create_map_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_location.types.create_map_response.CreateMapResponse",
    ) -> dict[str, Any]:
        import capo_location.types.create_map_response

        return capo_location.types.create_map_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateMap", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_location.types.create_map_request.CreateMapRequest = {
        "map_name": map_name,
        "configuration": configuration,
    }
    if pricing_plan is not None:
        input_["pricing_plan"] = pricing_plan
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output