Skip to content

create_eks_anywhere_subscription async

create_eks_anywhere_subscription(
    name: EksAnywhereSubscriptionName,
    term: EksAnywhereSubscriptionTerm,
    *,
    config_overrides: Optional[AsyncEKSClientConfig] = None,
    license_quantity: Optional[Integer] = None,
    license_type: Optional[EksAnywhereSubscriptionLicenseType] = None,
    auto_renew: Optional[Boolean] = None,
    client_request_token: Optional[String] = None,
    tags: Optional[TagMap] = None,
) -> CreateEksAnywhereSubscriptionResponse

Creates an EKS Anywhere subscription. When a subscription is created, it is a contract agreement for the length of the term specified in the request. Licenses that are used to validate support are provisioned in Amazon Web Services License Manager and the caller account is granted access to EKS Anywhere Curated Packages.

Parameters:

  • name (EksAnywhereSubscriptionName) –

    The unique name for your subscription. It must be unique in your Amazon Web Services account in the Amazon Web Services Region you're creating the subscription in. The name can contain only alphanumeric characters (case-sensitive), hyphens, and underscores. It must start with an alphabetic character and can't be longer than 100 characters.

  • term (EksAnywhereSubscriptionTerm) –

    An object representing the term duration and term unit type of your subscription. This determines the term length of your subscription. Valid values are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month or 36 month subscription. This value cannot be changed after creating the subscription.

  • license_quantity (Optional[Integer], default: None ) –

    The number of licenses to purchase with the subscription. Valid values are between 1 and 100. This value can't be changed after creating the subscription.

  • license_type (Optional[EksAnywhereSubscriptionLicenseType], default: None ) –

    The license type for all licenses in the subscription. Valid value is CLUSTER. With the CLUSTER license type, each license covers support for a single EKS Anywhere cluster.

  • auto_renew (Optional[Boolean], default: None ) –

    A boolean indicating whether the subscription auto renews at the end of the term.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

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

    The metadata for a subscription to assist with categorization and organization. Each tag consists of a key and an optional value. Subscription tags don't propagate to any other resources associated with the subscription.

Raises:

  • ClientException –

    These errors are usually caused by a client action. Actions can include using an action or resource on behalf of an IAM principal that doesn't have permissions to use the action or resource or specifying an identifier that is not valid.

  • InvalidParameterException –

    The specified parameter is invalid. Review the available parameters for the API request.

  • ResourceLimitExceededException –

    You have encountered a service limit on the specified resource.

  • ServerException –

    These errors are usually caused by a server-side issue.

  • ServiceUnavailableException –

    The service is unavailable. Back off and retry the operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_eks/_services/async_eks.py
async def create_eks_anywhere_subscription(
    self,
    name: "capo_eks.types.eks_anywhere_subscription_name.EksAnywhereSubscriptionName",
    term: "capo_eks.types.eks_anywhere_subscription_term.EksAnywhereSubscriptionTerm",
    *,
    config_overrides: Optional[AsyncEKSClientConfig] = None,
    license_quantity: Optional["capo_eks.types.integer.Integer"] = None,
    license_type: Optional[
        "capo_eks.types.eks_anywhere_subscription_license_type.EksAnywhereSubscriptionLicenseType"
    ] = None,
    auto_renew: Optional["capo_eks.types.boolean.Boolean"] = None,
    client_request_token: Optional["capo_eks.types.string.String"] = None,
    tags: Optional["capo_eks.types.tag_map.TagMap"] = None,
) -> "capo_eks.types.create_eks_anywhere_subscription_response.CreateEksAnywhereSubscriptionResponse":
    """<p>Creates an EKS Anywhere subscription. When a subscription is created, it is a contract agreement for the length of the term specified in the request. Licenses that are used to validate support are provisioned in Amazon Web Services License Manager and the caller account is granted access to EKS Anywhere Curated Packages.</p>

    Args:
        name: <p>The unique name for your subscription. It must be unique in your Amazon Web Services account in the Amazon Web Services Region you're creating the subscription in. The name can contain only alphanumeric characters (case-sensitive), hyphens, and underscores. It must start with an alphabetic character and can't be longer than 100 characters.</p>
        term: <p>An object representing the term duration and term unit type of your subscription. This determines the term length of your subscription. Valid values are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month or 36 month subscription. This value cannot be changed after creating the subscription.</p>
        license_quantity: <p>The number of licenses to purchase with the subscription. Valid values are between 1 and 100. This value can't be changed after creating the subscription.</p>
        license_type: <p>The license type for all licenses in the subscription. Valid value is CLUSTER. With the CLUSTER license type, each license covers support for a single EKS Anywhere cluster.</p>
        auto_renew: <p>A boolean indicating whether the subscription auto renews at the end of the term.</p>
        client_request_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        tags: <p>The metadata for a subscription to assist with categorization and organization. Each tag consists of a key and an optional value. Subscription tags don't propagate to any other resources associated with the subscription.</p>

    Raises:
        capo_eks.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. Actions can include using an action or resource on behalf of an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html">IAM principal</a> that doesn't have permissions to use the action or resource or specifying an identifier that is not valid.</p>
        capo_eks.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_eks.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>You have encountered a service limit on the specified resource.</p>
        capo_eks.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_eks.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unavailable. Back off and retry the operation.</p>
        capo_eks.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eks.types.create_eks_anywhere_subscription_request.CreateEksAnywhereSubscriptionRequest]",
    ) -> AsyncOperationResponse[
        "capo_eks.types.create_eks_anywhere_subscription_response.CreateEksAnywhereSubscriptionResponse"
    ]:
        import capo_eks._operations.aws_wesley_frontend.create_eks_anywhere_subscription

        (
            output,
            http_response,
        ) = await capo_eks._operations.aws_wesley_frontend.create_eks_anywhere_subscription.async_create_eks_anywhere_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEksAnywhereSubscription")
    )
    input_: capo_eks.types.create_eks_anywhere_subscription_request.CreateEksAnywhereSubscriptionRequest = {
        "name": name,
        "term": term,
    }
    if license_quantity is not None:
        input_["license_quantity"] = license_quantity
    if license_type is not None:
        input_["license_type"] = license_type
    if auto_renew is not None:
        input_["auto_renew"] = auto_renew
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if tags is not None:
        input_["tags"] = tags

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