SquareOps Technologies Your DevOps Partner for Accelerating cloud journey.
This module is a reusable Terraform module that simplifies the creation and management of an EC2 key pair on AWS. This module creates an EC2 key pair and securely stores the private key in the AWS Systems Manager Parameter Store (SSM). The module also returns the key pair name and the SSM parameter ARN for later use in other resources, making it easy to reference the key pair in other parts of your infrastructure. Using this module can help you save time and effort in managing your key pairs while ensuring security and compliance in your AWS environment.
module "key_pair" {
source = "squareops/keypair/aws"
key_name = "example-key"
environment = "production"
ssm_parameter_path = "production-example-key"
}
Refer this for more examples.
To Retrieve the Private key from SSM:
aws ssm get-parameter --name "<ssm_parameter_path>" --region "<region>" --query Parameter.Value --output text
Additionally, to save the private key to a file:
aws ssm get-parameter --name "<ssm_parameter_path>" --region "<region>" --with-decryption --query Parameter.Value --output text > keypair.pem
The required IAM permissions to create resources from this module can be found here
Name | Version |
---|---|
terraform | >= 1.0 |
aws | >= 4.21 |
tls | >= 3.4 |
Name | Version |
---|---|
aws | >= 4.21 |
Name | Source | Version |
---|---|---|
key_pair | terraform-aws-modules/key-pair/aws | 2.0.3 |
Name | Type |
---|---|
aws_ssm_parameter.ssm_ec2_keypair | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
additional_aws_tags | Additional tags to be applied to AWS resources. | map(string) |
{} |
no |
aws_region | Name of the AWS region where S3 bucket is to be created. | string |
"us-east-1" |
no |
create_private_key | Whether to create the private key or not. | bool |
true |
no |
environment | Specifies the identifier for the environment where the key pair will be used. | string |
"" |
no |
key_pair_name | Specifies the name to be assigned to the key pair that will be generated. | string |
"" |
no |
ssm_parameter_path | Specifies the SSM parameter name that will be used to store the generated key pair. | string |
"/example/ssm" |
no |
tags | Tags to be applied to AWS resources. | map(string) |
{ |
no |
Name | Description |
---|---|
key_pair_name | The name of the key pair generated for the EC2 instance. |
ssm_parameter_arn | The Amazon Resource Name (ARN) of the SSM parameter used to store the EC2 instance key pair. |
To report an issue with a project:
- Check the repository's issue tracker on GitHub
- Search to see if the issue has already been reported
- If you can't find an answer to your question in the documentation or issue tracker, you can ask a question by creating a new issue. Make sure to provide enough context and details .
Apache License, Version 2.0, January 2004 (http://www.apache.org/licenses/).
To support a GitHub project by liking it, you can follow these steps:
-
Visit the repository: Navigate to the GitHub repository
-
Click the "Star" button: On the repository page, you'll see a "Star" button in the upper right corner. Clicking on it will star the repository, indicating your support for the project.
-
Optionally, you can also leave a comment on the repository or open an issue to give feedback or suggest changes.
Starring a repository on GitHub is a simple way to show your support and appreciation for the project. It also helps to increase the visibility of the project and make it more discoverable to others.
We believe that the key to success in the digital age is the ability to deliver value quickly and reliably. That’s why we offer a comprehensive range of DevOps & Cloud services designed to help your organization optimize its systems & Processes for speed and agility.
- We are an AWS Advanced consulting partner which reflects our deep expertise in AWS Cloud and helping 100+ clients over the last 5 years.
- Expertise in Kubernetes and overall container solution helps companies expedite their journey by 10X.
- Infrastructure Automation is a key component to the success of our Clients and our Expertise helps deliver the same in the shortest time.
- DevSecOps as a service to implement security within the overall DevOps process and helping companies deploy securely and at speed.
- Platform engineering which supports scalable,Cost efficient infrastructure that supports rapid development, testing, and deployment.
- 24*7 SRE service to help you Monitor the state of your infrastructure and eradicate any issue within the SLA.
We provide support on all of our projects, no matter how small or large they may be.
To find more information about our company, visit squareops.com, follow us on Linkedin, or fill out a job application. If you have any questions or would like assistance with your cloud strategy and implementation, please don't hesitate to contact us.