Struct aws_sdk_cloudhsm::Client
source · pub struct Client { /* private fields */ }Expand description
Client for Amazon CloudHSM
Client for invoking operations on Amazon CloudHSM. Each operation on Amazon CloudHSM is a method on this
this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.
Constructing a Client
A Config is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env() instead, which returns a ConfigLoader that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_cloudhsm::Client::new(&config);Occasionally, SDKs may have additional service-specific that can be set on the Config that
is absent from SdkConfig, or slightly different settings for a specific client may be desired.
The Config struct implements From<&SdkConfig>, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_cloudhsm::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();See the aws-config docs and Config for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
Using the Client
A client has a function for every operation that can be performed by the service.
For example, the AddTagsToResource operation has
a Client::add_tags_to_resource, function which returns a builder for that operation.
The fluent builder ultimately has a send() function that returns an async future that
returns a result, as illustrated below:
let result = client.add_tags_to_resource()
.resource_arn("example")
.send()
.await;The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize module for more
information.
Implementations§
source§impl Client
impl Client
Constructs a fluent builder for the AddTagsToResource operation.
- The fluent builder is configurable:
resource_arn(impl ::std::convert::Into<String>)/set_resource_arn(Option<String>):The Amazon Resource Name (ARN) of the AWS CloudHSM resource to tag.
tag_list(Vec<Tag>)/set_tag_list(Option<Vec<Tag>>):One or more tags.
- On success, responds with
AddTagsToResourceOutputwith field(s):status(Option<String>):The status of the operation.
- On failure, responds with
SdkError<AddTagsToResourceError>
source§impl Client
impl Client
sourcepub fn create_hapg(&self) -> CreateHapgFluentBuilder
pub fn create_hapg(&self) -> CreateHapgFluentBuilder
Constructs a fluent builder for the CreateHapg operation.
- The fluent builder is configurable:
label(impl ::std::convert::Into<String>)/set_label(Option<String>):The label of the new high-availability partition group.
- On success, responds with
CreateHapgOutputwith field(s):hapg_arn(Option<String>):The ARN of the high-availability partition group.
- On failure, responds with
SdkError<CreateHapgError>
source§impl Client
impl Client
sourcepub fn create_hsm(&self) -> CreateHsmFluentBuilder
pub fn create_hsm(&self) -> CreateHsmFluentBuilder
Constructs a fluent builder for the CreateHsm operation.
- The fluent builder is configurable:
subnet_id(impl ::std::convert::Into<String>)/set_subnet_id(Option<String>):The identifier of the subnet in your VPC in which to place the HSM.
ssh_key(impl ::std::convert::Into<String>)/set_ssh_key(Option<String>):The SSH public key to install on the HSM.
eni_ip(impl ::std::convert::Into<String>)/set_eni_ip(Option<String>):The IP address to assign to the HSM’s ENI.
If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.
iam_role_arn(impl ::std::convert::Into<String>)/set_iam_role_arn(Option<String>):The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.
external_id(impl ::std::convert::Into<String>)/set_external_id(Option<String>):The external ID from
IamRoleArn, if present.subscription_type(SubscriptionType)/set_subscription_type(Option<SubscriptionType>):Specifies the type of subscription for the HSM.
-
PRODUCTION - The HSM is being used in a production environment.
-
TRIAL - The HSM is being used in a product trial.
-
client_token(impl ::std::convert::Into<String>)/set_client_token(Option<String>):A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.
syslog_ip(impl ::std::convert::Into<String>)/set_syslog_ip(Option<String>):The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.
- On success, responds with
CreateHsmOutputwith field(s):hsm_arn(Option<String>):The ARN of the HSM.
- On failure, responds with
SdkError<CreateHsmError>
source§impl Client
impl Client
sourcepub fn create_luna_client(&self) -> CreateLunaClientFluentBuilder
pub fn create_luna_client(&self) -> CreateLunaClientFluentBuilder
Constructs a fluent builder for the CreateLunaClient operation.
- The fluent builder is configurable:
label(impl ::std::convert::Into<String>)/set_label(Option<String>):The label for the client.
certificate(impl ::std::convert::Into<String>)/set_certificate(Option<String>):The contents of a Base64-Encoded X.509 v3 certificate to be installed on the HSMs used by this client.
- On success, responds with
CreateLunaClientOutputwith field(s):client_arn(Option<String>):The ARN of the client.
- On failure, responds with
SdkError<CreateLunaClientError>
source§impl Client
impl Client
sourcepub fn delete_hapg(&self) -> DeleteHapgFluentBuilder
pub fn delete_hapg(&self) -> DeleteHapgFluentBuilder
Constructs a fluent builder for the DeleteHapg operation.
- The fluent builder is configurable:
hapg_arn(impl ::std::convert::Into<String>)/set_hapg_arn(Option<String>):The ARN of the high-availability partition group to delete.
- On success, responds with
DeleteHapgOutputwith field(s):status(Option<String>):The status of the action.
- On failure, responds with
SdkError<DeleteHapgError>
source§impl Client
impl Client
sourcepub fn delete_hsm(&self) -> DeleteHsmFluentBuilder
pub fn delete_hsm(&self) -> DeleteHsmFluentBuilder
Constructs a fluent builder for the DeleteHsm operation.
- The fluent builder is configurable:
hsm_arn(impl ::std::convert::Into<String>)/set_hsm_arn(Option<String>):The ARN of the HSM to delete.
- On success, responds with
DeleteHsmOutputwith field(s):status(Option<String>):The status of the operation.
- On failure, responds with
SdkError<DeleteHsmError>
source§impl Client
impl Client
sourcepub fn delete_luna_client(&self) -> DeleteLunaClientFluentBuilder
pub fn delete_luna_client(&self) -> DeleteLunaClientFluentBuilder
Constructs a fluent builder for the DeleteLunaClient operation.
- The fluent builder is configurable:
client_arn(impl ::std::convert::Into<String>)/set_client_arn(Option<String>):The ARN of the client to delete.
- On success, responds with
DeleteLunaClientOutputwith field(s):status(Option<String>):The status of the action.
- On failure, responds with
SdkError<DeleteLunaClientError>
source§impl Client
impl Client
sourcepub fn describe_hapg(&self) -> DescribeHapgFluentBuilder
pub fn describe_hapg(&self) -> DescribeHapgFluentBuilder
Constructs a fluent builder for the DescribeHapg operation.
- The fluent builder is configurable:
hapg_arn(impl ::std::convert::Into<String>)/set_hapg_arn(Option<String>):The ARN of the high-availability partition group to describe.
- On success, responds with
DescribeHapgOutputwith field(s):hapg_arn(Option<String>):The ARN of the high-availability partition group.
hapg_serial(Option<String>):The serial number of the high-availability partition group.
hsms_last_action_failed(Option<Vec<String>>):hsms_pending_deletion(Option<Vec<String>>):hsms_pending_registration(Option<Vec<String>>):label(Option<String>):The label for the high-availability partition group.
last_modified_timestamp(Option<String>):The date and time the high-availability partition group was last modified.
partition_serial_list(Option<Vec<String>>):The list of partition serial numbers that belong to the high-availability partition group.
state(Option<CloudHsmObjectState>):The state of the high-availability partition group.
- On failure, responds with
SdkError<DescribeHapgError>
source§impl Client
impl Client
sourcepub fn describe_hsm(&self) -> DescribeHsmFluentBuilder
pub fn describe_hsm(&self) -> DescribeHsmFluentBuilder
Constructs a fluent builder for the DescribeHsm operation.
- The fluent builder is configurable:
hsm_arn(impl ::std::convert::Into<String>)/set_hsm_arn(Option<String>):The ARN of the HSM. Either the
HsmArnor theSerialNumberparameter must be specified.hsm_serial_number(impl ::std::convert::Into<String>)/set_hsm_serial_number(Option<String>):The serial number of the HSM. Either the
HsmArnor theHsmSerialNumberparameter must be specified.
- On success, responds with
DescribeHsmOutputwith field(s):hsm_arn(Option<String>):The ARN of the HSM.
status(Option<HsmStatus>):The status of the HSM.
status_details(Option<String>):Contains additional information about the status of the HSM.
availability_zone(Option<String>):The Availability Zone that the HSM is in.
eni_id(Option<String>):The identifier of the elastic network interface (ENI) attached to the HSM.
eni_ip(Option<String>):The IP address assigned to the HSM’s ENI.
subscription_type(Option<SubscriptionType>):Specifies the type of subscription for the HSM.
-
PRODUCTION - The HSM is being used in a production environment.
-
TRIAL - The HSM is being used in a product trial.
-
subscription_start_date(Option<String>):The subscription start date.
subscription_end_date(Option<String>):The subscription end date.
vpc_id(Option<String>):The identifier of the VPC that the HSM is in.
subnet_id(Option<String>):The identifier of the subnet that the HSM is in.
iam_role_arn(Option<String>):The ARN of the IAM role assigned to the HSM.
serial_number(Option<String>):The serial number of the HSM.
vendor_name(Option<String>):The name of the HSM vendor.
hsm_type(Option<String>):The HSM model type.
software_version(Option<String>):The HSM software version.
ssh_public_key(Option<String>):The public SSH key.
ssh_key_last_updated(Option<String>):The date and time that the SSH key was last updated.
server_cert_uri(Option<String>):The URI of the certificate server.
server_cert_last_updated(Option<String>):The date and time that the server certificate was last updated.
partitions(Option<Vec<String>>):The list of partitions on the HSM.
- On failure, responds with
SdkError<DescribeHsmError>
source§impl Client
impl Client
sourcepub fn describe_luna_client(&self) -> DescribeLunaClientFluentBuilder
pub fn describe_luna_client(&self) -> DescribeLunaClientFluentBuilder
Constructs a fluent builder for the DescribeLunaClient operation.
- The fluent builder is configurable:
client_arn(impl ::std::convert::Into<String>)/set_client_arn(Option<String>):The ARN of the client.
certificate_fingerprint(impl ::std::convert::Into<String>)/set_certificate_fingerprint(Option<String>):The certificate fingerprint.
- On success, responds with
DescribeLunaClientOutputwith field(s):client_arn(Option<String>):The ARN of the client.
certificate(Option<String>):The certificate installed on the HSMs used by this client.
certificate_fingerprint(Option<String>):The certificate fingerprint.
last_modified_timestamp(Option<String>):The date and time the client was last modified.
label(Option<String>):The label of the client.
- On failure, responds with
SdkError<DescribeLunaClientError>
source§impl Client
impl Client
sourcepub fn get_config(&self) -> GetConfigFluentBuilder
pub fn get_config(&self) -> GetConfigFluentBuilder
Constructs a fluent builder for the GetConfig operation.
- The fluent builder is configurable:
client_arn(impl ::std::convert::Into<String>)/set_client_arn(Option<String>):The ARN of the client.
client_version(ClientVersion)/set_client_version(Option<ClientVersion>):The client version.
hapg_list(Vec<String>)/set_hapg_list(Option<Vec<String>>):A list of ARNs that identify the high-availability partition groups that are associated with the client.
- On success, responds with
GetConfigOutputwith field(s):config_type(Option<String>):The type of credentials.
config_file(Option<String>):The chrystoki.conf configuration file.
config_cred(Option<String>):The certificate file containing the server.pem files of the HSMs.
- On failure, responds with
SdkError<GetConfigError>
source§impl Client
impl Client
sourcepub fn list_available_zones(&self) -> ListAvailableZonesFluentBuilder
pub fn list_available_zones(&self) -> ListAvailableZonesFluentBuilder
Constructs a fluent builder for the ListAvailableZones operation.
- The fluent builder takes no input, just
sendit. - On success, responds with
ListAvailableZonesOutputwith field(s):az_list(Option<Vec<String>>):The list of Availability Zones that have available AWS CloudHSM capacity.
- On failure, responds with
SdkError<ListAvailableZonesError>
source§impl Client
impl Client
sourcepub fn list_hapgs(&self) -> ListHapgsFluentBuilder
pub fn list_hapgs(&self) -> ListHapgsFluentBuilder
Constructs a fluent builder for the ListHapgs operation.
- The fluent builder is configurable:
next_token(impl ::std::convert::Into<String>)/set_next_token(Option<String>):The
NextTokenvalue from a previous call toListHapgs. Pass null if this is the first call.
- On success, responds with
ListHapgsOutputwith field(s):hapg_list(Option<Vec<String>>):The list of high-availability partition groups.
next_token(Option<String>):If not null, more results are available. Pass this value to
ListHapgsto retrieve the next set of items.
- On failure, responds with
SdkError<ListHapgsError>
source§impl Client
impl Client
sourcepub fn list_hsms(&self) -> ListHsmsFluentBuilder
pub fn list_hsms(&self) -> ListHsmsFluentBuilder
Constructs a fluent builder for the ListHsms operation.
- The fluent builder is configurable:
next_token(impl ::std::convert::Into<String>)/set_next_token(Option<String>):The
NextTokenvalue from a previous call toListHsms. Pass null if this is the first call.
- On success, responds with
ListHsmsOutputwith field(s):hsm_list(Option<Vec<String>>):The list of ARNs that identify the HSMs.
next_token(Option<String>):If not null, more results are available. Pass this value to
ListHsmsto retrieve the next set of items.
- On failure, responds with
SdkError<ListHsmsError>
source§impl Client
impl Client
sourcepub fn list_luna_clients(&self) -> ListLunaClientsFluentBuilder
pub fn list_luna_clients(&self) -> ListLunaClientsFluentBuilder
Constructs a fluent builder for the ListLunaClients operation.
- The fluent builder is configurable:
next_token(impl ::std::convert::Into<String>)/set_next_token(Option<String>):The
NextTokenvalue from a previous call toListLunaClients. Pass null if this is the first call.
- On success, responds with
ListLunaClientsOutputwith field(s):client_list(Option<Vec<String>>):The list of clients.
next_token(Option<String>):If not null, more results are available. Pass this to
ListLunaClientsto retrieve the next set of items.
- On failure, responds with
SdkError<ListLunaClientsError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource operation.
- The fluent builder is configurable:
resource_arn(impl ::std::convert::Into<String>)/set_resource_arn(Option<String>):The Amazon Resource Name (ARN) of the AWS CloudHSM resource.
- On success, responds with
ListTagsForResourceOutputwith field(s):tag_list(Option<Vec<Tag>>):One or more tags.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn modify_hapg(&self) -> ModifyHapgFluentBuilder
pub fn modify_hapg(&self) -> ModifyHapgFluentBuilder
Constructs a fluent builder for the ModifyHapg operation.
- The fluent builder is configurable:
hapg_arn(impl ::std::convert::Into<String>)/set_hapg_arn(Option<String>):The ARN of the high-availability partition group to modify.
label(impl ::std::convert::Into<String>)/set_label(Option<String>):The new label for the high-availability partition group.
partition_serial_list(Vec<String>)/set_partition_serial_list(Option<Vec<String>>):The list of partition serial numbers to make members of the high-availability partition group.
- On success, responds with
ModifyHapgOutputwith field(s):hapg_arn(Option<String>):The ARN of the high-availability partition group.
- On failure, responds with
SdkError<ModifyHapgError>
source§impl Client
impl Client
sourcepub fn modify_hsm(&self) -> ModifyHsmFluentBuilder
pub fn modify_hsm(&self) -> ModifyHsmFluentBuilder
Constructs a fluent builder for the ModifyHsm operation.
- The fluent builder is configurable:
hsm_arn(impl ::std::convert::Into<String>)/set_hsm_arn(Option<String>):The ARN of the HSM to modify.
subnet_id(impl ::std::convert::Into<String>)/set_subnet_id(Option<String>):The new identifier of the subnet that the HSM is in. The new subnet must be in the same Availability Zone as the current subnet.
eni_ip(impl ::std::convert::Into<String>)/set_eni_ip(Option<String>):The new IP address for the elastic network interface (ENI) attached to the HSM.
If the HSM is moved to a different subnet, and an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the new subnet.
iam_role_arn(impl ::std::convert::Into<String>)/set_iam_role_arn(Option<String>):The new IAM role ARN.
external_id(impl ::std::convert::Into<String>)/set_external_id(Option<String>):The new external ID.
syslog_ip(impl ::std::convert::Into<String>)/set_syslog_ip(Option<String>):The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.
- On success, responds with
ModifyHsmOutputwith field(s):hsm_arn(Option<String>):The ARN of the HSM.
- On failure, responds with
SdkError<ModifyHsmError>
source§impl Client
impl Client
sourcepub fn modify_luna_client(&self) -> ModifyLunaClientFluentBuilder
pub fn modify_luna_client(&self) -> ModifyLunaClientFluentBuilder
Constructs a fluent builder for the ModifyLunaClient operation.
- The fluent builder is configurable:
client_arn(impl ::std::convert::Into<String>)/set_client_arn(Option<String>):The ARN of the client.
certificate(impl ::std::convert::Into<String>)/set_certificate(Option<String>):The new certificate for the client.
- On success, responds with
ModifyLunaClientOutputwith field(s):client_arn(Option<String>):The ARN of the client.
- On failure, responds with
SdkError<ModifyLunaClientError>
source§impl Client
impl Client
Constructs a fluent builder for the RemoveTagsFromResource operation.
- The fluent builder is configurable:
resource_arn(impl ::std::convert::Into<String>)/set_resource_arn(Option<String>):The Amazon Resource Name (ARN) of the AWS CloudHSM resource.
tag_key_list(Vec<String>)/set_tag_key_list(Option<Vec<String>>):The tag key or keys to remove.
Specify only the tag key to remove (not the value). To overwrite the value for an existing tag, use
AddTagsToResource.
- On success, responds with
RemoveTagsFromResourceOutputwith field(s):status(Option<String>):The status of the operation.
- On failure, responds with
SdkError<RemoveTagsFromResourceError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config.
Panics
- This method will panic if the
confis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
confis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
Panics
- This method will panic if the
sdk_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it.