diff --git a/terraform/aws/bastion-aws/README.md b/terraform/aws/bastion-aws/README.md index 325c3c7..09b539a 100644 --- a/terraform/aws/bastion-aws/README.md +++ b/terraform/aws/bastion-aws/README.md @@ -6,13 +6,13 @@ These files provide an example of how to use Terraform to create a "private" EC2 * **data.tf**: This Terraform configuration file provides information to Terraform on which AWS AMIs to use. -* **instances.yml**: This Terraform configuration file specifies the AWS instances to create. +* **instances.tf**: This Terraform configuration file specifies the AWS instances to create. * **networking.tf**: This Terraform configuration creates all the networking components: the VPC (Virtual Private Cloud), subnets, Internet gateway, and the route table. * **output.tf**: This Terraform configuration file supplies information about the instances created by Terraform (public and private IP addresses, as appropriate). -* **provider.tf**: This Terraform configuration files configures the AWS provider to use the "us-west-2" region. You'll need to edit this file if you'd like to use a different AWS region. +* **provider.tf**: This Terraform configuration files configures the AWS provider. * **README.md**: The file you're currently reading. @@ -20,7 +20,7 @@ These files provide an example of how to use Terraform to create a "private" EC2 * **ssh.cfg.example**: This is an example of the configuration stanzas that may be needed to support the use of an SSH bastion host. -* **vars.tf**: This Terraform configuration file specifies variables that Terraform will need in order to create the desired AWS infrastructure. +* **variables.tf**: This Terraform configuration file specifies variables that Terraform will need in order to create the desired AWS infrastructure. ## Instructions @@ -28,7 +28,7 @@ These instructions assume that you have an AWS account, that Terraform is instal 1. Place the files from the `terraform/aws/bastion-aws` directory of this GitHub repository into a directory on your local system. You can clone the entire "learning-tools" repository (using `git clone`) or just download the specific files from the `terraform/aws/bastion-aws` folder. -2. Create a file named `terraform.tfvars` and populate it with the name of the AWS keypair you'd like to use for the instances and the flavor of the instances. Refer to [this URL](https://www.terraform.io/intro/getting-started/variables.html) for specific details on the syntax of this file. You can refer to the contents of `vars.tf` for the names of the variables that need to be defined. +2. Create a file named `terraform.tfvars` and populate it with the name of the AWS keypair you'd like to use for the instances, the AWS region to use, and the type (like "t2.micro") of the instances. Refer to [this URL](https://www.terraform.io/intro/getting-started/variables.html) for specific details on the syntax of this file. You can refer to the contents of `variables.tf` for the names of the variables that need to be defined. 3. Run `terraform plan` to have Terraform examine the current infrastructure and determine what changes are necessary to realize the desired configuration. diff --git a/terraform/aws/new-vpc/README.md b/terraform/aws/new-vpc/README.md new file mode 100644 index 0000000..9d89fe6 --- /dev/null +++ b/terraform/aws/new-vpc/README.md @@ -0,0 +1,37 @@ +# Creating a new VPC and Launching an Instance with Terraform + +These files provide an example of a simple Terraform configuration that creates a new VPC (and all associated items, like subnets, route tables, and an Internet gateway) and launches an instance into the new VPC. + +## Contents + +* **data.tf**: This Terraform configuration file provides information to Terraform on which AWS AMIs to use. + +* **main.tf**: This Terraform configuration file creates a new VPC (with subnet, route table, Internet gateway, and security group) and launches a single instance into the new VPC. + +* **output.tf**: This Terraform configuration file supplies information about the instance launched by Terraform (public IP address, specifically). + +* **provider.tf**: This Terraform configuration files configures the AWS provider. + +* **README.md**: The file you're currently reading. + +* **variables.tf**: This Terraform configuration file specifies variables that Terraform will need in order to create the desired AWS infrastructure. + +## Instructions + +These instructions assume that you have an AWS account, that Terraform is installed and working correctly, and that you've appropriately supplied the necessary AWS credentials to Terraform. + +1. Place the files from the `terraform/aws/new-vpc` directory of this GitHub repository into a directory on your local system. You can clone the entire "learning-tools" repository (using `git clone`) or just download the specific files from the `terraform/aws/new-vpc` folder. + +2. Create a file named `terraform.tfvars` and populate it with the name of the AWS keypair you'd like to use for the instance, the AWS region you'd like Terraform to use, and the type of the instance (such as "t2.micro"). Refer to [this URL](https://www.terraform.io/intro/getting-started/variables.html) for specific details on the syntax of this file. You can refer to the contents of `variables.tf` for the names of the variables that need to be defined. + +3. Run `terraform plan` to have Terraform examine the current infrastructure and determine what changes are necessary to realize the desired configuration. + +4. Run `terraform apply` to have Terraform make the changes necessary to realize the desired configuration. + +5. When Terraform is done running, it will output the public IP address of the instance that was launched. Use this value, as appropriate, to connect to the instance via SSH. + +Enjoy! + +## License + +This content is licensed under the MIT License. diff --git a/terraform/aws/simple-ec2/README.md b/terraform/aws/simple-ec2/README.md new file mode 100644 index 0000000..d3d1dec --- /dev/null +++ b/terraform/aws/simple-ec2/README.md @@ -0,0 +1,37 @@ +# Launching an Instance with Terraform + +These files provide an example of a very simple Terraform configuration that will launch an instance into an existing VPC/subnet (the user's default VPC for the specified region). + +## Contents + +* **data.tf**: This Terraform configuration file provides information to Terraform on which AWS AMIs to use. + +* **main.tf**: This Terraform configuration file launches an instance into the user's default VPC for the specified region. + +* **output.tf**: This Terraform configuration file supplies information about the instance launched by Terraform (public IP address, specifically). + +* **provider.tf**: This Terraform configuration files configures the AWS provider. + +* **README.md**: The file you're currently reading. + +* **variables.tf**: This Terraform configuration file specifies variables that Terraform will need in order to create the desired AWS infrastructure. + +## Instructions + +These instructions assume that you have an AWS account, that Terraform is installed and working correctly, and that you've appropriately supplied the necessary AWS credentials to Terraform. + +1. Place the files from the `terraform/aws/simple-ec2` directory of this GitHub repository into a directory on your local system. You can clone the entire "learning-tools" repository (using `git clone`) or just download the specific files from the `terraform/aws/simple-ec2` folder. + +2. Create a file named `terraform.tfvars` and populate it with the name of the AWS keypair you'd like to use for the instance, the AWS region you'd like Terraform to use, the security group with which the instance should be associated, and the type of the instance (such as "t2.micro"). Refer to [this URL](https://www.terraform.io/intro/getting-started/variables.html) for specific details on the syntax of this file. You can refer to the contents of `variables.tf` for the names of the variables that need to be defined. + +3. Run `terraform plan` to have Terraform examine the current infrastructure and determine what changes are necessary to realize the desired configuration. + +4. Run `terraform apply` to have Terraform make the changes necessary to realize the desired configuration. + +5. When Terraform is done running, it will output the public IP address of the instance that was launched. Use this value, as appropriate, to connect to the instance via SSH. + +Enjoy! + +## License + +This content is licensed under the MIT License. diff --git a/terraform/aws/simple-module/README.md b/terraform/aws/simple-module/README.md new file mode 100644 index 0000000..e2861c3 --- /dev/null +++ b/terraform/aws/simple-module/README.md @@ -0,0 +1,33 @@ +# Building a Simple Terraform Module + +These files provide an example of how to use Terraform _modules_ for repeatable infrastructure. In this case, the module automates the creation of a new VPC and associated infrastructure (subnet, route table, and Internet gateway). + +## Contents + +* **main.tf**: This Terraform configuration calls the `VPC` module to create two new VPCs. + +* **modules**: This directory contains a Terraform module (which is itself a collection of Terraform configurations) to create a new VPC. + +* **provider.tf**: This Terraform configuration files configures the AWS provider. + +* **README.md**: The file you're currently reading. + +* **variables.tf**: This Terraform configuration file specifies variables that Terraform will need in order to create the desired AWS infrastructure. + +## Instructions + +These instructions assume that you have an AWS account, that Terraform is installed and working correctly, and that you've appropriately supplied the necessary AWS credentials to Terraform. + +1. Place the files from the `terraform/aws/simple-module` directory of this GitHub repository into a directory on your local system. You can clone the entire "learning-tools" repository (using `git clone`) or just download the specific files from the `terraform/aws/simple-module` folder. + +2. Create a file named `terraform.tfvars` and populate it with the name of the AWS region to use. Refer to [this URL](https://www.terraform.io/intro/getting-started/variables.html) for specific details on the syntax of this file. You can refer to the contents of `variables.tf` for the names of the variables that need to be defined. + +3. Run `terraform plan` to have Terraform examine the current infrastructure and determine what changes are necessary to realize the desired configuration. + +4. Run `terraform apply` to have Terraform make the changes necessary to realize the desired configuration. + +Enjoy! + +## License + +This content is licensed under the MIT License.