Skip to content

renew_domain

renew_domain(
    domain_name: DomainName,
    current_expiry_year: CurrentExpiryYear,
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    duration_in_years: Optional[DurationInYears] = None,
    consent: Optional[Consent] = None,
) -> RenewDomainResponse

This operation renews a domain for the specified number of years. The cost of renewing your domain is billed to your Amazon Web Services account.

We recommend that you renew your domain several weeks before the expiration date. Some TLD registries delete domains before the expiration date if you haven't renewed far enough in advance. For more information about renewing domain registration, see Renewing Registration for a Domain in the Amazon Route 53 Developer Guide.

Parameters:

  • domain_name (DomainName) –

    The name of the domain that you want to renew.

  • duration_in_years (Optional[DurationInYears], default: None ) –

    The number of years that you want to renew the domain for. The maximum number of years depends on the top-level domain. For the range of valid values for your domain, see Domains that You Can Register with Amazon Route 53 in the Amazon Route 53 Developer Guide.

    Default: 1

  • current_expiry_year (CurrentExpiryYear) –

    The year when the registration for the domain is set to expire. This value must match the current expiration date for the domain.

  • consent (Optional[Consent], default: None ) –

    Specifies the maximum price that you agree to pay to renew the domain name. This element is required if the domain has registry premium pricing, and optional if the domain is priced at the standard rate for its TLD. If you include it and the renewal price is more than MaxPrice, the request fails.

Raises:

  • DuplicateRequest –

    The request is already in progress for the domain.

  • InvalidInput –

    The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For AcceptDomainTransferFromAnotherAwsAccount, the password might be invalid.

  • OperationLimitExceeded –

    The number of operations or jobs running exceeded the allowed threshold for the account.

  • TLDRulesViolation –

    The top-level domain does not support this operation.

  • UnsupportedTLD –

    Amazon Route 53 does not support this top-level domain (TLD).

  • UnknownServiceError –

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

Source code in docs_src/capo_route_53_domains/_services/route53_domains.py
def renew_domain(
    self,
    domain_name: "capo_route_53_domains.types.domain_name.DomainName",
    current_expiry_year: "capo_route_53_domains.types.current_expiry_year.CurrentExpiryYear",
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    duration_in_years: Optional[
        "capo_route_53_domains.types.duration_in_years.DurationInYears"
    ] = None,
    consent: Optional["capo_route_53_domains.types.consent.Consent"] = None,
) -> "capo_route_53_domains.types.renew_domain_response.RenewDomainResponse":
    """<p>This operation renews a domain for the specified number of years. The cost of renewing your domain is billed to your Amazon Web Services account.</p> <p>We recommend that you renew your domain several weeks before the expiration date. Some TLD registries delete domains before the expiration date if you haven't renewed far enough in advance. For more information about renewing domain registration, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-renew.html">Renewing Registration for a Domain</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>

    Args:
        domain_name: <p>The name of the domain that you want to renew.</p>
        duration_in_years: <p>The number of years that you want to renew the domain for. The maximum number of years depends on the top-level domain. For the range of valid values for your domain, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html">Domains that You Can Register with Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>Default: 1</p>
        current_expiry_year: <p>The year when the registration for the domain is set to expire. This value must match the current expiration date for the domain.</p>
        consent: <p>Specifies the maximum price that you agree to pay to renew the domain name. This element is required if the domain has registry premium pricing, and optional if the domain is priced at the standard rate for its TLD. If you include it and the renewal price is more than <code>MaxPrice</code>, the request fails.</p>

    Raises:
        capo_route_53_domains.errors.duplicate_request.DuplicateRequest: <p>The request is already in progress for the domain.</p>
        capo_route_53_domains.errors.invalid_input.InvalidInput: <p>The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For <code>AcceptDomainTransferFromAnotherAwsAccount</code>, the password might be invalid.</p>
        capo_route_53_domains.errors.operation_limit_exceeded.OperationLimitExceeded: <p>The number of operations or jobs running exceeded the allowed threshold for the account.</p>
        capo_route_53_domains.errors.tld_rules_violation.TLDRulesViolation: <p>The top-level domain does not support this operation.</p>
        capo_route_53_domains.errors.unsupported_tld.UnsupportedTLD: <p>Amazon Route 53 does not support this top-level domain (TLD).</p>
        capo_route_53_domains.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route_53_domains.types.renew_domain_request.RenewDomainRequest]",
    ) -> OperationResponse[
        "capo_route_53_domains.types.renew_domain_response.RenewDomainResponse"
    ]:
        import capo_route_53_domains._operations.route53_domains_v20140515.renew_domain

        output, http_response = (
            capo_route_53_domains._operations.route53_domains_v20140515.renew_domain.renew_domain(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RenewDomain")
    )
    input_: capo_route_53_domains.types.renew_domain_request.RenewDomainRequest = {
        "domain_name": domain_name,
        "current_expiry_year": current_expiry_year,
    }
    if duration_in_years is not None:
        input_["duration_in_years"] = duration_in_years
    if consent is not None:
        input_["consent"] = consent

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