You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::CloudHSM::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CloudHSM::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon CloudHSM. To construct a client, you need to configure a :region
and :credentials
.
cloudhsm = Aws::CloudHSM::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']
andENV['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::CloudHSM::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
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::CloudHSM::Client
constructor
Constructs an API client.
API Operations collapse
-
#add_tags_to_resource(options = {}) ⇒ Types::AddTagsToResourceResponse
This is documentation for AWS CloudHSM Classic.
-
#create_hapg(options = {}) ⇒ Types::CreateHapgResponse
This is documentation for AWS CloudHSM Classic.
-
#create_hsm(options = {}) ⇒ Types::CreateHsmResponse
This is documentation for AWS CloudHSM Classic.
-
#create_luna_client(options = {}) ⇒ Types::CreateLunaClientResponse
This is documentation for AWS CloudHSM Classic.
-
#delete_hapg(options = {}) ⇒ Types::DeleteHapgResponse
This is documentation for AWS CloudHSM Classic.
-
#delete_hsm(options = {}) ⇒ Types::DeleteHsmResponse
This is documentation for AWS CloudHSM Classic.
-
#delete_luna_client(options = {}) ⇒ Types::DeleteLunaClientResponse
This is documentation for AWS CloudHSM Classic.
-
#describe_hapg(options = {}) ⇒ Types::DescribeHapgResponse
This is documentation for AWS CloudHSM Classic.
-
#describe_hsm(options = {}) ⇒ Types::DescribeHsmResponse
This is documentation for AWS CloudHSM Classic.
-
#describe_luna_client(options = {}) ⇒ Types::DescribeLunaClientResponse
This is documentation for AWS CloudHSM Classic.
-
#get_config(options = {}) ⇒ Types::GetConfigResponse
This is documentation for AWS CloudHSM Classic.
-
#list_available_zones(options = {}) ⇒ Types::ListAvailableZonesResponse
This is documentation for AWS CloudHSM Classic.
-
#list_hapgs(options = {}) ⇒ Types::ListHapgsResponse
This is documentation for AWS CloudHSM Classic.
-
#list_hsms(options = {}) ⇒ Types::ListHsmsResponse
This is documentation for AWS CloudHSM Classic.
-
#list_luna_clients(options = {}) ⇒ Types::ListLunaClientsResponse
This is documentation for AWS CloudHSM Classic.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
This is documentation for AWS CloudHSM Classic.
-
#modify_hapg(options = {}) ⇒ Types::ModifyHapgResponse
This is documentation for AWS CloudHSM Classic.
-
#modify_hsm(options = {}) ⇒ Types::ModifyHsmResponse
This is documentation for AWS CloudHSM Classic.
-
#modify_luna_client(options = {}) ⇒ Types::ModifyLunaClientResponse
This is documentation for AWS CloudHSM Classic.
-
#remove_tags_from_resource(options = {}) ⇒ Types::RemoveTagsFromResourceResponse
This is documentation for AWS CloudHSM Classic.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
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::CloudHSM::Client
Constructs an API client.
Instance Method Details
#add_tags_to_resource(options = {}) ⇒ Types::AddTagsToResourceResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Adds or overwrites one or more tags for the specified AWS CloudHSM resource.
Each tag consists of a key and a value. Tag keys must be unique to each resource.
#create_hapg(options = {}) ⇒ Types::CreateHapgResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Creates a high-availability partition group. A high-availability partition group is a group of partitions that spans multiple physical HSMs.
#create_hsm(options = {}) ⇒ Types::CreateHsmResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Creates an uninitialized HSM instance.
There is an upfront fee charged for each HSM instance that you create with the CreateHsm
operation. If you accidentally provision an HSM and want to request a refund, delete the instance using the DeleteHsm operation, go to the AWS Support Center, create a new case, and select Account and Billing Support.
It can take up to 20 minutes to create and provision an HSM. You can monitor the status of the HSM with the DescribeHsm operation. The HSM is ready to be initialized when the status changes to RUNNING
.
#create_luna_client(options = {}) ⇒ Types::CreateLunaClientResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Creates an HSM client.
#delete_hapg(options = {}) ⇒ Types::DeleteHapgResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Deletes a high-availability partition group.
#delete_hsm(options = {}) ⇒ Types::DeleteHsmResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Deletes an HSM. After completion, this operation cannot be undone and your key material cannot be recovered.
#delete_luna_client(options = {}) ⇒ Types::DeleteLunaClientResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Deletes a client.
#describe_hapg(options = {}) ⇒ Types::DescribeHapgResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Retrieves information about a high-availability partition group.
#describe_hsm(options = {}) ⇒ Types::DescribeHsmResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Retrieves information about an HSM. You can identify the HSM by its ARN or its serial number.
#describe_luna_client(options = {}) ⇒ Types::DescribeLunaClientResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Retrieves information about an HSM client.
#get_config(options = {}) ⇒ Types::GetConfigResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Gets the configuration files necessary to connect to all high availability partition groups the client is associated with.
#list_available_zones(options = {}) ⇒ Types::ListAvailableZonesResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Lists the Availability Zones that have available AWS CloudHSM capacity.
#list_hapgs(options = {}) ⇒ Types::ListHapgsResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Lists the high-availability partition groups for the account.
This operation supports pagination with the use of the NextToken
member. If more results are available, the NextToken
member of the response contains a token that you pass in the next call to ListHapgs
to retrieve the next set of items.
#list_hsms(options = {}) ⇒ Types::ListHsmsResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Retrieves the identifiers of all of the HSMs provisioned for the current customer.
This operation supports pagination with the use of the NextToken
member. If more results are available, the NextToken
member of the response contains a token that you pass in the next call to ListHsms
to retrieve the next set of items.
#list_luna_clients(options = {}) ⇒ Types::ListLunaClientsResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Lists all of the clients.
This operation supports pagination with the use of the NextToken
member. If more results are available, the NextToken
member of the response contains a token that you pass in the next call to ListLunaClients
to retrieve the next set of items.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Returns a list of all tags for the specified AWS CloudHSM resource.
#modify_hapg(options = {}) ⇒ Types::ModifyHapgResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Modifies an existing high-availability partition group.
#modify_hsm(options = {}) ⇒ Types::ModifyHsmResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Modifies an HSM.
This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is configured for high availability, and consider executing this operation during a maintenance window.
#modify_luna_client(options = {}) ⇒ Types::ModifyLunaClientResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Modifies the certificate used by the client.
This action can potentially start a workflow to install the new certificate on the client's HSMs.
#remove_tags_from_resource(options = {}) ⇒ Types::RemoveTagsFromResourceResponse
This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
Removes one or more tags from the specified AWS CloudHSM resource.
To remove a tag, specify only the tag key to remove (not the value). To overwrite the value for an existing tag, use AddTagsToResource.
#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
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|