--- title: "Create Key Pair" slug: "create-key-pair" updated: 2025-08-14T15:29:37Z published: 2025-08-14T15:29:37Z canonical: "documentation.decisions.com/create-key-pair" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Create Key Pair | Step Details | | --- | | **Introduced in Version** | 3.0.0 | | **Last Modified in Version** | 7.0.0 | | **Location** | Integration > Amazon AWS > EC2 | The **Create Key Pair** step is used to create an ED25519 or 2948 bit RSA key pair with a specified name for an EC2 instance. ### Prerequisites - This step requires the [Amazon AWS Module](https://documentation.decisions.com/docs/aws) to be [installed](https://documentation.decisions.com/docs/installing-modules-decisions) before it will be available in the toolbox, and an active [AWS account](https://signin.aws.amazon.com/signin?redirect_uri=https%3A%2F%2Fconsole.aws.amazon.com%2Fconsole%2Fhome%3FhashArgs%3D%2523%26isauthcode%3Dtrue%26nc2%3Dh_ct%26src%3Dheader-signin%26state%3DhashArgsFromTB_eu-north-1_c1412528899e4833&client_id=arn%3Aaws%3Asignin%3A%3A%3Aconsole%2Fcanvas&forceMobileApp=0&code_challenge=HQku5BPrRUboP5p1wGr4Ai_nBIQNSqsR2eHJNCBfxhQ&code_challenge_method=SHA-256). The [Amazon WebServices Settings](https://documentation.decisions.com/docs/setting-up-amazon-webservices-integration) must also be configured. - A [dependency](https://documentation.decisions.com/docs/project-dependencies) must be created after installing the module in order for the the steps to be properly used. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Key Name | Name of the Key Pair to create. | String | | Region | The Amazon AWS region the instance will be associated with. | Int32 | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Substring1_Output | The part of the string that was extracted. | String | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-08-12_14h24_20.png) --- ## Common Errors ### AWS Was Not Able To Validate the Provided Access Credentials. If the access credentials established in system settings are invalid, the step will cause an error. To correct this, ensure the Access Key Id and Secret Access Key are both correct and active. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Substring 1[Substring] in flow [Display Steps]: Exception invoking method Substring on class StringSteps ---> DecisionsFramework.LoggedException: Exception invoking method Substring on class StringSteps ---> System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length') at System.String.Substring(Int32 startIndex, Int32 length) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData) at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` ### The Keypair Already Exists If a Key Pair has already been created with the inputted key name, the step will cause an error. To correct this, change the Key Name to be unique. #### Exception Message: ```csharp DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Create Key Pair 1[CreateKeyPair] in flow [Step Library Flow]: Exception invoking method CreateKeyPair on class AmazonEC2Core ---> DecisionsFramework.LoggedException: Exception invoking method CreateKeyPair on class AmazonEC2Core ---> Amazon.EC2.AmazonEC2Exception: The keypair already exists ---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown. at Amazon.Runtime.HttpWebRequestMessage.ProcessHttpResponseMessage(HttpResponseMessage responseMessage) at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken) at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext) at Amazon.EC2.Internal.AmazonEC2ResponseHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) --- End of inner exception stack trace --- ``` --- Related Information Related Articles: [EC2](https://documentation.decisions.com/docs/aws-ec2-step-glossary) [AWS](https://documentation.decisions.com/docs/aws)