---
title: "Discussion on \"Deploy Nginx in EC2 and expose it using load-balancer\" | Hashnode"
description: "Discussion on \"Deploy Nginx in EC2 and expose it using load-balancer\". First let's genrate an ssh key.\nIn your terminal write the following commandssh-keygen -t rsaThen it will ask about the folder where it should be install (./id_rsa).\nNow let's create a key_pair in main.tf file.\nresource \"aws_key_pair\" \"key-tf\" {\nkey_..."
url: "https://hashnode.com/posts/deploy-nginx-in-ec2-and-expose-it-using-load-balancer/64776a25ede8cfae8ef1f037"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Deploy Nginx in EC2 and expose it using load-balancer](https://patelakshit.hashnode.dev/deploy-nginx-in-ec2-and-expose-it-using-load-balancer?utm_source=hashnode&utm_medium=feed)

First let's genrate an ssh key. In your terminal write the following commandssh-keygen -t rsaThen it will ask about the folder where it should be install (./id\_rsa). Now let's create a key\_pair in main.tf file. resource "aws\_key\_pair" "key-tf" { key\_...

May 31, 2023 · 2 min read · patelakshit.hashnode.dev  
Updated Jun 26, 2023  
Read the article

## Written by

[Patel Axit](https://hashnode.com/@axit)

@axit

  
[View profile](https://hashnode.com/@axit)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
