You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::ACM::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS Certificate Manager. To construct a client, you need to configure a :region and :credentials.

acm = Aws::ACM::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::ACM::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::ACM::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#add_tags_to_certificate(options = {}) ⇒ Struct

Adds one or more tags to an ACM certificate. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. You specify the certificate on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair.

You can apply a tag to just one certificate if you want to identify a specific characteristic of that certificate, or you can apply the same tag to multiple certificates if you want to filter for a common relationship among those certificates. Similarly, you can apply the same tag to multiple resources if you want to specify a relationship among those resources. For example, you can add the same tag to an ACM certificate and an Elastic Load Balancing load balancer to indicate that they are both used by the same website. For more information, see Tagging ACM certificates.

To remove one or more tags, use the RemoveTagsFromCertificate action. To view all of the tags that have been applied to the certificate, use the ListTagsForCertificate action.

Examples:

Request syntax with placeholder values


resp = client.add_tags_to_certificate({
  certificate_arn: "Arn", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains the ARN of the ACM certificate to which the tag is to be applied. This must be of the form:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

  • :tags (required, Array<Types::Tag>)

    The key-value pair that defines the tag. The tag value is optional.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_certificate(options = {}) ⇒ Struct

Deletes a certificate and its associated private key. If this action succeeds, the certificate no longer appears in the list that can be displayed by calling the ListCertificates action or be retrieved by calling the GetCertificate action. The certificate will not be available for use by AWS services integrated with ACM.

You cannot delete an ACM certificate that is being used by another AWS service. To delete a certificate that is in use, the certificate association must first be removed.

Examples:

Request syntax with placeholder values


resp = client.delete_certificate({
  certificate_arn: "Arn", # required
})

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains the ARN of the ACM certificate to be deleted. This must be of the form:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_certificate(options = {}) ⇒ Types::DescribeCertificateResponse

Returns detailed metadata about the specified ACM certificate.

Examples:

Request syntax with placeholder values


resp = client.describe_certificate({
  certificate_arn: "Arn", # required
})

Response structure


resp.certificate.certificate_arn #=> String
resp.certificate.domain_name #=> String
resp.certificate.subject_alternative_names #=> Array
resp.certificate.subject_alternative_names[0] #=> String
resp.certificate.domain_validation_options #=> Array
resp.certificate.domain_validation_options[0].domain_name #=> String
resp.certificate.domain_validation_options[0].validation_emails #=> Array
resp.certificate.domain_validation_options[0].validation_emails[0] #=> String
resp.certificate.domain_validation_options[0].validation_domain #=> String
resp.certificate.domain_validation_options[0].validation_status #=> String, one of "PENDING_VALIDATION", "SUCCESS", "FAILED"
resp.certificate.domain_validation_options[0].resource_record.name #=> String
resp.certificate.domain_validation_options[0].resource_record.type #=> String, one of "CNAME"
resp.certificate.domain_validation_options[0].resource_record.value #=> String
resp.certificate.domain_validation_options[0].validation_method #=> String, one of "EMAIL", "DNS"
resp.certificate.serial #=> String
resp.certificate.subject #=> String
resp.certificate.issuer #=> String
resp.certificate.created_at #=> Time
resp.certificate.issued_at #=> Time
resp.certificate.imported_at #=> Time
resp.certificate.status #=> String, one of "PENDING_VALIDATION", "ISSUED", "INACTIVE", "EXPIRED", "VALIDATION_TIMED_OUT", "REVOKED", "FAILED"
resp.certificate.revoked_at #=> Time
resp.certificate.revocation_reason #=> String, one of "UNSPECIFIED", "KEY_COMPROMISE", "CA_COMPROMISE", "AFFILIATION_CHANGED", "SUPERCEDED", "CESSATION_OF_OPERATION", "CERTIFICATE_HOLD", "REMOVE_FROM_CRL", "PRIVILEGE_WITHDRAWN", "A_A_COMPROMISE"
resp.certificate.not_before #=> Time
resp.certificate.not_after #=> Time
resp.certificate.key_algorithm #=> String, one of "RSA_2048", "RSA_1024", "RSA_4096", "EC_prime256v1", "EC_secp384r1", "EC_secp521r1"
resp.certificate.signature_algorithm #=> String
resp.certificate.in_use_by #=> Array
resp.certificate.in_use_by[0] #=> String
resp.certificate.failure_reason #=> String, one of "NO_AVAILABLE_CONTACTS", "ADDITIONAL_VERIFICATION_REQUIRED", "DOMAIN_NOT_ALLOWED", "INVALID_PUBLIC_DOMAIN", "DOMAIN_VALIDATION_DENIED", "CAA_ERROR", "PCA_LIMIT_EXCEEDED", "PCA_INVALID_ARN", "PCA_INVALID_STATE", "PCA_REQUEST_FAILED", "PCA_NAME_CONSTRAINTS_VALIDATION", "PCA_RESOURCE_NOT_FOUND", "PCA_INVALID_ARGS", "PCA_INVALID_DURATION", "PCA_ACCESS_DENIED", "SLR_NOT_FOUND", "OTHER"
resp.certificate.type #=> String, one of "IMPORTED", "AMAZON_ISSUED", "PRIVATE"
resp.certificate.renewal_summary.renewal_status #=> String, one of "PENDING_AUTO_RENEWAL", "PENDING_VALIDATION", "SUCCESS", "FAILED"
resp.certificate.renewal_summary.domain_validation_options #=> Array
resp.certificate.renewal_summary.domain_validation_options[0].domain_name #=> String
resp.certificate.renewal_summary.domain_validation_options[0].validation_emails #=> Array
resp.certificate.renewal_summary.domain_validation_options[0].validation_emails[0] #=> String
resp.certificate.renewal_summary.domain_validation_options[0].validation_domain #=> String
resp.certificate.renewal_summary.domain_validation_options[0].validation_status #=> String, one of "PENDING_VALIDATION", "SUCCESS", "FAILED"
resp.certificate.renewal_summary.domain_validation_options[0].resource_record.name #=> String
resp.certificate.renewal_summary.domain_validation_options[0].resource_record.type #=> String, one of "CNAME"
resp.certificate.renewal_summary.domain_validation_options[0].resource_record.value #=> String
resp.certificate.renewal_summary.domain_validation_options[0].validation_method #=> String, one of "EMAIL", "DNS"
resp.certificate.renewal_summary.renewal_status_reason #=> String, one of "NO_AVAILABLE_CONTACTS", "ADDITIONAL_VERIFICATION_REQUIRED", "DOMAIN_NOT_ALLOWED", "INVALID_PUBLIC_DOMAIN", "DOMAIN_VALIDATION_DENIED", "CAA_ERROR", "PCA_LIMIT_EXCEEDED", "PCA_INVALID_ARN", "PCA_INVALID_STATE", "PCA_REQUEST_FAILED", "PCA_NAME_CONSTRAINTS_VALIDATION", "PCA_RESOURCE_NOT_FOUND", "PCA_INVALID_ARGS", "PCA_INVALID_DURATION", "PCA_ACCESS_DENIED", "SLR_NOT_FOUND", "OTHER"
resp.certificate.renewal_summary.updated_at #=> Time
resp.certificate.key_usages #=> Array
resp.certificate.key_usages[0].name #=> String, one of "DIGITAL_SIGNATURE", "NON_REPUDIATION", "KEY_ENCIPHERMENT", "DATA_ENCIPHERMENT", "KEY_AGREEMENT", "CERTIFICATE_SIGNING", "CRL_SIGNING", "ENCIPHER_ONLY", "DECIPHER_ONLY", "ANY", "CUSTOM"
resp.certificate.extended_key_usages #=> Array
resp.certificate.extended_key_usages[0].name #=> String, one of "TLS_WEB_SERVER_AUTHENTICATION", "TLS_WEB_CLIENT_AUTHENTICATION", "CODE_SIGNING", "EMAIL_PROTECTION", "TIME_STAMPING", "OCSP_SIGNING", "IPSEC_END_SYSTEM", "IPSEC_TUNNEL", "IPSEC_USER", "ANY", "NONE", "CUSTOM"
resp.certificate.extended_key_usages[0].oid #=> String
resp.certificate.certificate_authority_arn #=> String
resp.certificate.renewal_eligibility #=> String, one of "ELIGIBLE", "INELIGIBLE"
resp.certificate.options.certificate_transparency_logging_preference #=> String, one of "ENABLED", "DISABLED"

Options Hash (options):

  • :certificate_arn (required, String)

    The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have the following form:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Returns:

See Also:

#export_certificate(options = {}) ⇒ Types::ExportCertificateResponse

Exports a private certificate issued by a private certificate authority (CA) for use anywhere. The exported file contains the certificate, the certificate chain, and the encrypted private 2048-bit RSA key associated with the public key that is embedded in the certificate. For security, you must assign a passphrase for the private key when exporting it.

For information about exporting and formatting a certificate using the ACM console or CLI, see Export a Private Certificate.

Examples:

Request syntax with placeholder values


resp = client.export_certificate({
  certificate_arn: "Arn", # required
  passphrase: "data", # required
})

Response structure


resp.certificate #=> String
resp.certificate_chain #=> String
resp.private_key #=> String

Options Hash (options):

  • :certificate_arn (required, String)

    An Amazon Resource Name (ARN) of the issued certificate. This must be of the form:

    arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012

  • :passphrase (required, IO, String)

    Passphrase to associate with the encrypted exported private key. If you want to later decrypt the private key, you must have the passphrase. You can use the following OpenSSL command to decrypt a private key:

    openssl rsa -in encrypted_key.pem -out decrypted_key.pem

Returns:

See Also:

#get_certificate(options = {}) ⇒ Types::GetCertificateResponse

Retrieves an Amazon-issued certificate and its certificate chain. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use OpenSSL to decode the certificates and inspect individual fields.

Examples:

Request syntax with placeholder values


resp = client.get_certificate({
  certificate_arn: "Arn", # required
})

Response structure


resp.certificate #=> String
resp.certificate_chain #=> String

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains a certificate ARN in the following format:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Returns:

See Also:

#import_certificate(options = {}) ⇒ Types::ImportCertificateResponse

Imports a certificate into AWS Certificate Manager (ACM) to use with services that are integrated with ACM. Note that integrated services allow only certificate types and keys they support to be associated with their resources. Further, their support differs depending on whether the certificate is imported into IAM or into ACM. For more information, see the documentation for each service. For more information about importing certificates into ACM, see Importing Certificates in the AWS Certificate Manager User Guide.

ACM does not provide managed renewal for certificates that you import.

Note the following guidelines when importing third party certificates:

  • You must enter the private key that matches the certificate you are importing.

  • The private key must be unencrypted. You cannot import a private key that is protected by a password or a passphrase.

  • If the certificate you are importing is not self-signed, you must enter its certificate chain.

  • If a certificate chain is included, the issuer must be the subject of one of the certificates in the chain.

  • The certificate, private key, and certificate chain must be PEM-encoded.

  • The current time must be between the Not Before and Not After certificate fields.

  • The Issuer field must not be empty.

  • The OCSP authority URL, if present, must not exceed 1000 characters.

  • To import a new certificate, omit the CertificateArn argument. Include this argument only when you want to replace a previously imported certifica

  • When you import a certificate by using the CLI, you must specify the certificate, the certificate chain, and the private key by their file names preceded by file://. For example, you can specify a certificate saved in the C:\temp folder as file://C:\temp\certificate_to_import.pem. If you are making an HTTP or HTTPS Query request, include these arguments as BLOBs.

  • When you import a certificate by using an SDK, you must specify the certificate, the certificate chain, and the private key files in the manner required by the programming language you're using.

  • The cryptographic algorithm of an imported certificate must match the algorithm of the signing CA. For example, if the signing CA key type is RSA, then the certificate key type must also be RSA.

This operation returns the Amazon Resource Name (ARN) of the imported certificate.

Examples:

Request syntax with placeholder values


resp = client.import_certificate({
  certificate_arn: "Arn",
  certificate: "data", # required
  private_key: "data", # required
  certificate_chain: "data",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.certificate_arn #=> String

Options Hash (options):

  • :certificate_arn (String)

    The Amazon Resource Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.

  • :certificate (required, IO, String)

    The certificate to import.

  • :private_key (required, IO, String)

    The private key that matches the public key in the certificate.

  • :certificate_chain (IO, String)

    The PEM encoded certificate chain.

  • :tags (Array<Types::Tag>)

    One or more resource tags to associate with the imported certificate.

    Note: You cannot apply tags when reimporting a certificate.

Returns:

See Also:

#list_certificates(options = {}) ⇒ Types::ListCertificatesResponse

Retrieves a list of certificate ARNs and domain names. You can request that only certificates that match a specific status be listed. You can also filter by specific attributes of the certificate. Default filtering returns only RSA_2048 certificates. For more information, see Filters.

Examples:

Request syntax with placeholder values


resp = client.list_certificates({
  certificate_statuses: ["PENDING_VALIDATION"], # accepts PENDING_VALIDATION, ISSUED, INACTIVE, EXPIRED, VALIDATION_TIMED_OUT, REVOKED, FAILED
  includes: {
    extended_key_usage: ["TLS_WEB_SERVER_AUTHENTICATION"], # accepts TLS_WEB_SERVER_AUTHENTICATION, TLS_WEB_CLIENT_AUTHENTICATION, CODE_SIGNING, EMAIL_PROTECTION, TIME_STAMPING, OCSP_SIGNING, IPSEC_END_SYSTEM, IPSEC_TUNNEL, IPSEC_USER, ANY, NONE, CUSTOM
    key_usage: ["DIGITAL_SIGNATURE"], # accepts DIGITAL_SIGNATURE, NON_REPUDIATION, KEY_ENCIPHERMENT, DATA_ENCIPHERMENT, KEY_AGREEMENT, CERTIFICATE_SIGNING, CRL_SIGNING, ENCIPHER_ONLY, DECIPHER_ONLY, ANY, CUSTOM
    key_types: ["RSA_2048"], # accepts RSA_2048, RSA_1024, RSA_4096, EC_prime256v1, EC_secp384r1, EC_secp521r1
  },
  next_token: "NextToken",
  max_items: 1,
})

Response structure


resp.next_token #=> String
resp.certificate_summary_list #=> Array
resp.certificate_summary_list[0].certificate_arn #=> String
resp.certificate_summary_list[0].domain_name #=> String

Options Hash (options):

  • :certificate_statuses (Array<String>)

    Filter the certificate list by status value.

  • :includes (Types::Filters)

    Filter the certificate list. For more information, see the Filters structure.

  • :next_token (String)

    Use this parameter only when paginating results and only in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the response you just received.

  • :max_items (Integer)

    Use this parameter when paginating results to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items.

Returns:

See Also:

#list_tags_for_certificate(options = {}) ⇒ Types::ListTagsForCertificateResponse

Lists the tags that have been applied to the ACM certificate. Use the certificate's Amazon Resource Name (ARN) to specify the certificate. To add a tag to an ACM certificate, use the AddTagsToCertificate action. To delete a tag, use the RemoveTagsFromCertificate action.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_certificate({
  certificate_arn: "Arn", # required
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains the ARN of the ACM certificate for which you want to list the tags. This must have the following form:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Returns:

See Also:

#remove_tags_from_certificate(options = {}) ⇒ Struct

Remove one or more tags from an ACM certificate. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this function, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value.

To add tags to a certificate, use the AddTagsToCertificate action. To view all of the tags that have been applied to a specific ACM certificate, use the ListTagsForCertificate action.

Examples:

Request syntax with placeholder values


resp = client.remove_tags_from_certificate({
  certificate_arn: "Arn", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains the ARN of the ACM Certificate with one or more tags that you want to remove. This must be of the form:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

  • :tags (required, Array<Types::Tag>)

    The key-value pair that defines the tag to remove.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#renew_certificate(options = {}) ⇒ Struct

Renews an eligable ACM certificate. At this time, only exported private certificates can be renewed with this operation. In order to renew your ACM PCA certificates with ACM, you must first grant the ACM service principal permission to do so. For more information, see Testing Managed Renewal in the ACM User Guide.

Examples:

Request syntax with placeholder values


resp = client.renew_certificate({
  certificate_arn: "Arn", # required
})

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains the ARN of the ACM certificate to be renewed. This must be of the form:

    arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

    For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#request_certificate(options = {}) ⇒ Types::RequestCertificateResponse

Requests an ACM certificate for use with other AWS services. To request an ACM certificate, you must specify a fully qualified domain name (FQDN) in the DomainName parameter. You can also specify additional FQDNs in the SubjectAlternativeNames parameter.

If you are requesting a private certificate, domain validation is not required. If you are requesting a public certificate, each domain name that you specify must be validated to verify that you own or control the domain. You can use DNS validation or email validation. We recommend that you use DNS validation. ACM issues public certificates after receiving approval from the domain owner.

Examples:

Request syntax with placeholder values


resp = client.request_certificate({
  domain_name: "DomainNameString", # required
  validation_method: "EMAIL", # accepts EMAIL, DNS
  subject_alternative_names: ["DomainNameString"],
  idempotency_token: "IdempotencyToken",
  domain_validation_options: [
    {
      domain_name: "DomainNameString", # required
      validation_domain: "DomainNameString", # required
    },
  ],
  options: {
    certificate_transparency_logging_preference: "ENABLED", # accepts ENABLED, DISABLED
  },
  certificate_authority_arn: "Arn",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.certificate_arn #=> String

Options Hash (options):

  • :domain_name (required, String)

    Fully qualified domain name (FQDN), such as www.example.com, that you want to secure with an ACM certificate. Use an asterisk (*) to create a wildcard certificate that protects several sites in the same domain. For example, *.example.com protects www.example.com, site.example.com, and images.example.com.

    The first domain name you enter cannot exceed 64 octets, including periods. Each subsequent Subject Alternative Name (SAN), however, can be up to 253 octets in length.

  • :validation_method (String)

    The method you want to use if you are requesting a public certificate to validate that you own or control domain. You can validate with DNS or validate with email. We recommend that you use DNS validation.

  • :subject_alternative_names (Array<String>)

    Additional FQDNs to be included in the Subject Alternative Name extension of the ACM certificate. For example, add the name www.example.net to a certificate for which the DomainName field is www.example.com if users can reach your site by using either name. The maximum number of domain names that you can add to an ACM certificate is 100. However, the initial quota is 10 domain names. If you need more than 10 names, you must request a quota increase. For more information, see Quotas.

    The maximum length of a SAN DNS name is 253 octets. The name is made up of multiple labels separated by periods. No label can be longer than 63 octets. Consider the following examples:

    • (63 octets).(63 octets).(63 octets).(61 octets) is legal because the total length is 253 octets (63+1+63+1+63+1+61) and no label exceeds 63 octets.

    • (64 octets).(63 octets).(63 octets).(61 octets) is not legal because the total length exceeds 253 octets (64+1+63+1+63+1+61) and the first label exceeds 63 octets.

    • (63 octets).(63 octets).(63 octets).(62 octets) is not legal because the total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets.

  • :idempotency_token (String)

    Customer chosen string that can be used to distinguish between calls to RequestCertificate. Idempotency tokens time out after one hour. Therefore, if you call RequestCertificate multiple times with the same idempotency token within one hour, ACM recognizes that you are requesting only one certificate and will issue only one. If you change the idempotency token for each call, ACM recognizes that you are requesting multiple certificates.

  • :domain_validation_options (Array<Types::DomainValidationOption>)

    The domain name that you want ACM to use to send you emails so that you can validate domain ownership.

  • :options (Types::CertificateOptions)

    Currently, you can use this parameter to specify whether to add the certificate to a certificate transparency log. Certificate transparency makes it possible to detect SSL/TLS certificates that have been mistakenly or maliciously issued. Certificates that have not been logged typically produce an error message in a browser. For more information, see Opting Out of Certificate Transparency Logging.

  • :certificate_authority_arn (String)

    The Amazon Resource Name (ARN) of the private certificate authority (CA) that will be used to issue the certificate. If you do not provide an ARN and you are trying to request a private certificate, ACM will attempt to issue a public certificate. For more information about private CAs, see the AWS Certificate Manager Private Certificate Authority (PCA) user guide. The ARN must have the following form:

    arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012

  • :tags (Array<Types::Tag>)

    One or more resource tags to associate with the certificate.

Returns:

See Also:

#resend_validation_email(options = {}) ⇒ Struct

Resends the email that requests domain ownership validation. The domain owner or an authorized representative must approve the ACM certificate before it can be issued. The certificate can be approved by clicking a link in the mail to navigate to the Amazon certificate approval website and then clicking I Approve. However, the validation email can be blocked by spam filters. Therefore, if you do not receive the original mail, you can request that the mail be resent within 72 hours of requesting the ACM certificate. If more than 72 hours have elapsed since your original request or since your last attempt to resend validation mail, you must request a new certificate. For more information about setting up your contact email addresses, see Configure Email for your Domain.

Examples:

Request syntax with placeholder values


resp = client.resend_validation_email({
  certificate_arn: "Arn", # required
  domain: "DomainNameString", # required
  validation_domain: "DomainNameString", # required
})

Options Hash (options):

  • :certificate_arn (required, String)

    String that contains the ARN of the requested certificate. The certificate ARN is generated and returned by the RequestCertificate action as soon as the request is made. By default, using this parameter causes email to be sent to all top-level domains you specified in the certificate request. The ARN must be of the form:

    arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012

  • :domain (required, String)

    The fully qualified domain name (FQDN) of the certificate that needs to be validated.

  • :validation_domain (required, String)

    The base validation domain that will act as the suffix of the email addresses that are used to send the emails. This must be the same as the Domain value or a superdomain of the Domain value. For example, if you requested a certificate for site.subdomain.example.com and specify a ValidationDomain of subdomain.example.com, ACM sends email to the domain registrant, technical contact, and administrative contact in WHOIS and the following five addresses:

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_certificate_options(options = {}) ⇒ Struct

Updates a certificate. Currently, you can use this function to specify whether to opt in to or out of recording your certificate in a certificate transparency log. For more information, see Opting Out of Certificate Transparency Logging.

Examples:

Request syntax with placeholder values


resp = client.update_certificate_options({
  certificate_arn: "Arn", # required
  options: { # required
    certificate_transparency_logging_preference: "ENABLED", # accepts ENABLED, DISABLED
  },
})

Options Hash (options):

  • :certificate_arn (required, String)

    ARN of the requested certificate to update. This must be of the form:

    arn:aws:acm:us-east-1:account:certificate/12345678-1234-1234-1234-123456789012

  • :options (required, Types::CertificateOptions)

    Use to update the options for your certificate. Currently, you can specify whether to add your certificate to a transparency log. Certificate transparency makes it possible to detect SSL/TLS certificates that have been mistakenly or maliciously issued. Certificates that have not been logged typically produce an error message in a browser.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:
:certificate_validated#describe_certificate6040

Returns:

  • (Array<Symbol>)

    the list of supported waiters.