Skip to content

Commit

Permalink
Merge pull request #2 from byu-oit/feature-output-resources
Browse files Browse the repository at this point in the history
Feature output resources
  • Loading branch information
joshgubler authored Dec 14, 2019
2 parents b386392 + 55a24a0 commit f329337
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In a clean directory, create a `main.tf` file that looks like:

```hcl
module "bastion" {
source = "[email protected]:byu-oit/terraform-aws-bastion.git?ref=v1.0.1"
source = "[email protected]:byu-oit/terraform-aws-bastion.git?ref=v1.0.2"
env = "prd"
vpc_vpn_to_campus = true
netid = "mynetid"
Expand Down Expand Up @@ -65,7 +65,7 @@ The bastion is really intended to be ephemeral (spin it up, use it, tear it down
| Name | Description | Default Value |
| --- | --- | --- |
| env | Environment of the AWS Account (for finding the shared VPC and tagging the bastion) (e.g. dev, prd)| |
| vpc_vpn_to_campus | Retrieve VPC info for the VPC that has VPN access to campus | false |
| vpc_vpn_to_campus | Set to true if the bastion needs to be in the VPC that has VPN access to campus | false |
| netid | Your Net ID (for naming the bastion) | |
| public_key | Public SSH Key (e.g. \"ssh-rsa AA....Qw== comment\"). | |
| ingress_cidrs | IP Address Ranges that should have access to the bastion. | ["128.187.0.0/16"] |
Expand All @@ -74,8 +74,11 @@ The bastion is really intended to be ephemeral (spin it up, use it, tear it down
| Name | Description |
| --- | --- |
| connect | SSH connection details for the bastion |
| ec2_instance | The bastion EC2 Instance |
| security_group | The security group that controls access to the bastion |
| key_pair | The SSH keypair assigned to the bastion |

## Resources
* An EC2 Instance (the bastion) in a public subnet
* A Security Group allowing SSH on port 22 from campus
* A keypair using the public key input variable (granting access to the EC2 instance)
* A keypair using the public key input variable (granting access to the EC2 instance)
2 changes: 1 addition & 1 deletion examples/module/example.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "bastion" {
source = "[email protected]:byu-oit/terraform-aws-bastion.git?ref=v1.0.1"
source = "[email protected]:byu-oit/terraform-aws-bastion.git?ref=v1.0.2"
env = "prd"
vpc_vpn_to_campus = true
netid = "mynetid"
Expand Down
12 changes: 12 additions & 0 deletions output.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
output "connect" {
value = "ssh ec2-user@${aws_instance.bastion.public_ip}"
}

output "ec2_instance" {
value = aws_instance.bastion
}

output "security_group" {
value = aws_security_group.sg
}

output "key_pair" {
value = aws_key_pair.key
}
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variable "env" {

variable "vpc_vpn_to_campus" {
type = bool
description = "Retrieve VPC info for the VPC that has VPN access to campus."
description = "Set to true if the bastion needs to be in the VPC that has VPN access to campus."
}

variable "netid" {
Expand Down

0 comments on commit f329337

Please sign in to comment.