Skip to content

create_license_configuration async

create_license_configuration(
    name: String,
    license_counting_type: LicenseCountingType,
    *,
    config_overrides: Optional[AsyncLicenseManagerClientConfig] = None,
    description: Optional[String] = None,
    license_count: Optional[BoxLong] = None,
    license_count_hard_limit: Optional[BoxBoolean] = None,
    license_rules: Optional[StringList] = None,
    tags: Optional[TagList] = None,
    disassociate_when_not_found: Optional[BoxBoolean] = None,
    product_information_list: Optional[ProductInformationList] = None,
    license_expiry: Optional[BoxLong] = None,
) -> CreateLicenseConfigurationResponse

Creates a license configuration.

A license configuration is an abstraction of a customer license agreement that can be consumed and enforced by License Manager. Components include specifications for the license type (licensing by instance, socket, CPU, or vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated Host, or all of these), license affinity to host (how long a license must be associated with a host), and the number of licenses purchased and used.

Parameters:

  • name (String) –

    Name of the license configuration.

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

    Description of the license configuration.

  • license_counting_type (LicenseCountingType) –

    Dimension used to track the license inventory.

  • license_count (Optional[BoxLong], default: None ) –

    Number of licenses managed by the license configuration.

  • license_count_hard_limit (Optional[BoxBoolean], default: None ) –

    Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.

  • license_rules (Optional[StringList], default: None ) –

    License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.

    • Cores dimension: allowedTenancy | licenseAffinityToHost | maximumCores | minimumCores

    • Instances dimension: allowedTenancy | maximumVcpus | minimumVcpus

    • Sockets dimension: allowedTenancy | licenseAffinityToHost | maximumSockets | minimumSockets

    • vCPUs dimension: allowedTenancy | honorVcpuOptimization | maximumVcpus | minimumVcpus

    The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for allowedTenancy are EC2-Default, EC2-DedicatedHost, and EC2-DedicatedInstance. The possible values for honorVcpuOptimization are True and False.

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

    Tags to add to the license configuration.

  • disassociate_when_not_found (Optional[BoxBoolean], default: None ) –

    When true, disassociates a resource when software is uninstalled.

  • product_information_list (Optional[ProductInformationList], default: None ) –

    Product information.

  • license_expiry (Optional[BoxLong], default: None ) –

    License configuration expiry.

Raises:

Source code in docs_src/capo_license_manager/_services/async_license_manager.py
async def create_license_configuration(
    self,
    name: "capo_license_manager.types.string.String",
    license_counting_type: "capo_license_manager.types.license_counting_type.LicenseCountingType",
    *,
    config_overrides: Optional[AsyncLicenseManagerClientConfig] = None,
    description: Optional["capo_license_manager.types.string.String"] = None,
    license_count: Optional["capo_license_manager.types.box_long.BoxLong"] = None,
    license_count_hard_limit: Optional[
        "capo_license_manager.types.box_boolean.BoxBoolean"
    ] = None,
    license_rules: Optional[
        "capo_license_manager.types.string_list.StringList"
    ] = None,
    tags: Optional["capo_license_manager.types.tag_list.TagList"] = None,
    disassociate_when_not_found: Optional[
        "capo_license_manager.types.box_boolean.BoxBoolean"
    ] = None,
    product_information_list: Optional[
        "capo_license_manager.types.product_information_list.ProductInformationList"
    ] = None,
    license_expiry: Optional["capo_license_manager.types.box_long.BoxLong"] = None,
) -> "capo_license_manager.types.create_license_configuration_response.CreateLicenseConfigurationResponse":
    """<p>Creates a license configuration.</p> <p>A license configuration is an abstraction of a customer license agreement that can be consumed and enforced by License Manager. Components include specifications for the license type (licensing by instance, socket, CPU, or vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated Host, or all of these), license affinity to host (how long a license must be associated with a host), and the number of licenses purchased and used.</p>

    Args:
        name: <p>Name of the license configuration.</p>
        description: <p>Description of the license configuration.</p>
        license_counting_type: <p>Dimension used to track the license inventory.</p>
        license_count: <p>Number of licenses managed by the license configuration.</p>
        license_count_hard_limit: <p>Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.</p>
        license_rules: <p>License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.</p> <ul> <li> <p> <code>Cores</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumCores</code> | <code>minimumCores</code> </p> </li> <li> <p> <code>Instances</code> dimension: <code>allowedTenancy</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code> </p> </li> <li> <p> <code>Sockets</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumSockets</code> | <code>minimumSockets</code> </p> </li> <li> <p> <code>vCPUs</code> dimension: <code>allowedTenancy</code> | <code>honorVcpuOptimization</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code> </p> </li> </ul> <p>The unit for <code>licenseAffinityToHost</code> is days and the range is 1 to 180. The possible values for <code>allowedTenancy</code> are <code>EC2-Default</code>, <code>EC2-DedicatedHost</code>, and <code>EC2-DedicatedInstance</code>. The possible values for <code>honorVcpuOptimization</code> are <code>True</code> and <code>False</code>.</p>
        tags: <p>Tags to add to the license configuration.</p>
        disassociate_when_not_found: <p>When true, disassociates a resource when software is uninstalled.</p>
        product_information_list: <p>Product information.</p>
        license_expiry: <p>License configuration expiry.</p>

    Raises:
        capo_license_manager.errors.access_denied_exception.AccessDeniedException: <p>Access to resource denied.</p>
        capo_license_manager.errors.authorization_exception.AuthorizationException: <p>The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy associated with this account.</p>
        capo_license_manager.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameter values are not valid.</p>
        capo_license_manager.errors.rate_limit_exceeded_exception.RateLimitExceededException: <p>Too many requests have been submitted. Try again after a brief wait.</p>
        capo_license_manager.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>Your resource limits have been exceeded.</p>
        capo_license_manager.errors.server_internal_exception.ServerInternalException: <p>The server experienced an internal error. Try again.</p>
        capo_license_manager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_license_manager.types.create_license_configuration_request.CreateLicenseConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_license_manager.types.create_license_configuration_response.CreateLicenseConfigurationResponse"
    ]:
        import capo_license_manager._operations.aws_license_manager.create_license_configuration

        (
            output,
            http_response,
        ) = await capo_license_manager._operations.aws_license_manager.create_license_configuration.async_create_license_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateLicenseConfiguration")
    )
    input_: capo_license_manager.types.create_license_configuration_request.CreateLicenseConfigurationRequest = {
        "name": name,
        "license_counting_type": license_counting_type,
    }
    if description is not None:
        input_["description"] = description
    if license_count is not None:
        input_["license_count"] = license_count
    if license_count_hard_limit is not None:
        input_["license_count_hard_limit"] = license_count_hard_limit
    if license_rules is not None:
        input_["license_rules"] = license_rules
    if tags is not None:
        input_["tags"] = tags
    if disassociate_when_not_found is not None:
        input_["disassociate_when_not_found"] = disassociate_when_not_found
    if product_information_list is not None:
        input_["product_information_list"] = product_information_list
    if license_expiry is not None:
        input_["license_expiry"] = license_expiry

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output