pub struct CreateKeyPairFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateKeyPair
.
Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the specified PEM or PPK format. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key or an unencrypted PPK formatted private key for use with PuTTY. If a key with the specified name already exists, Amazon EC2 returns an error.
The key pair returned to you is available only in the Amazon Web Services Region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any Region using ImportKeyPair
.
You can have up to 5,000 key pairs per Amazon Web Services Region.
For more information, see Amazon EC2 key pairs in the Amazon Elastic Compute Cloud User Guide.
Implementations§
source§impl CreateKeyPairFluentBuilder
impl CreateKeyPairFluentBuilder
sourcepub fn as_input(&self) -> &CreateKeyPairInputBuilder
pub fn as_input(&self) -> &CreateKeyPairInputBuilder
Access the CreateKeyPair as a reference.
sourcepub async fn send(
self
) -> Result<CreateKeyPairOutput, SdkError<CreateKeyPairError, HttpResponse>>
pub async fn send( self ) -> Result<CreateKeyPairOutput, SdkError<CreateKeyPairError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<CreateKeyPairOutput, CreateKeyPairError, Self>
pub fn customize( self ) -> CustomizableOperation<CreateKeyPairOutput, CreateKeyPairError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn key_name(self, input: impl Into<String>) -> Self
pub fn key_name(self, input: impl Into<String>) -> Self
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
sourcepub fn set_key_name(self, input: Option<String>) -> Self
pub fn set_key_name(self, input: Option<String>) -> Self
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
sourcepub fn get_key_name(&self) -> &Option<String>
pub fn get_key_name(&self) -> &Option<String>
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn get_dry_run(&self) -> &Option<bool>
pub fn get_dry_run(&self) -> &Option<bool>
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn key_type(self, input: KeyType) -> Self
pub fn key_type(self, input: KeyType) -> Self
The type of key pair. Note that ED25519 keys are not supported for Windows instances.
Default: rsa
sourcepub fn set_key_type(self, input: Option<KeyType>) -> Self
pub fn set_key_type(self, input: Option<KeyType>) -> Self
The type of key pair. Note that ED25519 keys are not supported for Windows instances.
Default: rsa
sourcepub fn get_key_type(&self) -> &Option<KeyType>
pub fn get_key_type(&self) -> &Option<KeyType>
The type of key pair. Note that ED25519 keys are not supported for Windows instances.
Default: rsa
sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to TagSpecifications
.
To override the contents of this collection use set_tag_specifications
.
The tags to apply to the new key pair.
sourcepub fn set_tag_specifications(
self,
input: Option<Vec<TagSpecification>>
) -> Self
pub fn set_tag_specifications( self, input: Option<Vec<TagSpecification>> ) -> Self
The tags to apply to the new key pair.
sourcepub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
pub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
The tags to apply to the new key pair.
sourcepub fn key_format(self, input: KeyFormat) -> Self
pub fn key_format(self, input: KeyFormat) -> Self
The format of the key pair.
Default: pem
sourcepub fn set_key_format(self, input: Option<KeyFormat>) -> Self
pub fn set_key_format(self, input: Option<KeyFormat>) -> Self
The format of the key pair.
Default: pem
sourcepub fn get_key_format(&self) -> &Option<KeyFormat>
pub fn get_key_format(&self) -> &Option<KeyFormat>
The format of the key pair.
Default: pem
Trait Implementations§
source§impl Clone for CreateKeyPairFluentBuilder
impl Clone for CreateKeyPairFluentBuilder
source§fn clone(&self) -> CreateKeyPairFluentBuilder
fn clone(&self) -> CreateKeyPairFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more