Skip to content

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
uridium committed Aug 9, 2023
1 parent 6741bf8 commit 41674a7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,30 @@ module "ec2-connect-endpoint" {

For more information click [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-eic-Endpoint.html)

### Examples

* [Simple: VPC, SG, EC2, EC2 Connect Endpoint](https://github.com/uridium/terraform-aws-ec2-connect-endpoint/tree/master/examples/simple)
* [Advanced: VPC Peering, SG, EC2, EC2 Connect Endpoint](https://github.com/uridium/terraform-aws-ec2-connect-endpoint/tree/master/examples/multi-region-vpc-peering)

## Development

This module uses [pre-commit](https://pre-commit.com/) hook to identify simple issues before pushing code to the remote repository, and to generate documentation.

To install it, simply run:
Install `pre-commit`:

```bash
pip install pre-commit
```

Install the git hook scripts:

```bash
pre-commit install
```

Now `pre-commit` will run automatically on every `git commit`. You can also run it manually:
Now `pre-commit` will run automatically on every `git commit`.

It's usually a good idea to run the hooks against all of the files when adding new hooks (usually `pre-commit` will only run on the changed files during git hooks):

```bash
pre-commit run -av
Expand Down
8 changes: 4 additions & 4 deletions examples/multi-region-vpc-peering/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Terraform AWS EC2 Instance Connect Endpoint use case

This is a more advanced example, which shows not only how to use EC2 Instance Connect Endpoint, but also sets up a multi-region (US-EU) VPC peering:
This is a more advanced example, which shows not only how to use EC2 Instance Connect Endpoint, but also how to set up a multi-region VPC peering:

* [vpc module](https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest)
* [security-group module](https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws/latest)
Expand All @@ -15,7 +15,7 @@ terraform init
terraform apply
```

As the outputs you can, among others, get an aws cli commands to connect to your EC2 instances, for example:
As the outputs, you get among others an aws cli commands to connect to your EC2 instances, for example:

```bash
...
Expand Down Expand Up @@ -47,8 +47,8 @@ vpc_eu_instances = {
}
```
EC2 instances are set up in both VPCs, in public and private subnets. They have no public IP addresses, and none of them can connect to the internet (there's no NAT gateway).
EC2 instances are set up in both VPCs, in public and private subnets. They have no public IP addresses, and none of them can connect to services outside your VPC (there's no NAT gateway).
To test out _EC2 Instance Connect Endpoint_ service, simply log in to any of those instances using a cmd command from the output.
To test out _VPC Peering_, simply ping instances in the EU VPC from the US VPC, and the other way around.
To test out _VPC Peering_, simply ping instances in one VPC from another.
4 changes: 2 additions & 2 deletions examples/simple/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Simple Terraform AWS EC2 Instance Connect Endpoint use case

This example uses also other resources necessary to connect to a EC2 instance without a public IP address:
This example uses also other resources necessary to connect to an EC2 instance without a public IP address:

* [vpc module](https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest)
* [security-group module](https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws/latest)
Expand All @@ -14,7 +14,7 @@ terraform init
terraform apply
```

As the output you get an aws cli command to connect to your EC2 instance:
As the output, you get an aws cli command to connect to your EC2 instance, for example:

```bash
cmd = "aws --region us-east-1 ec2-instance-connect ssh --instance-id i-0123456789"
Expand Down

0 comments on commit 41674a7

Please sign in to comment.