From 143d85b0d1b7724f62afb9a600dfd24d9bd57f93 Mon Sep 17 00:00:00 2001 From: Chris Buckley Date: Thu, 20 Apr 2023 17:02:20 +0100 Subject: [PATCH] Standardised documentation for all modules --- README.md | 22 +++++++++++++++++++- modules/aws/ec2/README.md | 5 +---- modules/aws/rds_serverless_cluster/README.md | 6 +----- modules/aws/vpc/README.md | 8 +++---- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e00012f..49f43af 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # terraform-modules -The repo for AnswerDigital Terraform modules + +The repo for Answer Digital shared Terraform modules. + +## Using these modules + +You can use these modules in your own terraform projects as follows: + +```hcl +module "ec2_setup" { + source = "github.com/answerdigital/terraform-modules//modules/aws/ec2?ref=v2" +} +``` + +Notice the double `//` between the repository URL and the path to the module. +For further information please see the [terraform documentation](https://developer.hashicorp.com/terraform/language/modules/sources#modules-in-package-sub-directories). + +Versions are shared across all modules. You can choose a specific tag (e.g. `?ref=v2.0.0`) or to get the latest changes within a major version, use `?ref=v2` which will get the latest v2.x.x release. + +## Documentation + +Further documentation can be found in the [wiki](https://github.com/answerdigital/terraform-modules/wiki). diff --git a/modules/aws/ec2/README.md b/modules/aws/ec2/README.md index 21d87e3..5917409 100644 --- a/modules/aws/ec2/README.md +++ b/modules/aws/ec2/README.md @@ -55,10 +55,7 @@ This Terraform module will produce an EC2 instance which can be accessed via ssh # Example Usage -Below is an example of how you would call the `ec2_instance` module in your -terraform code. Note that when calling it directly from the GitHub repository you can specify a -version by appending the below source reference with `?ref=v2` for the latest v2.x.x release -(for further information please see [here](https://developer.hashicorp.com/terraform/language/modules/sources#modules-in-package-sub-directories)). +Below is an example of how you would call the `ec2` module in your terraform code. Here we also give an example of a bash script used to install docker on `Amazon linux`, then create a .env file on the instance and finally run a chosen docker image with the .env file. diff --git a/modules/aws/rds_serverless_cluster/README.md b/modules/aws/rds_serverless_cluster/README.md index d6158ec..e6c7bfa 100644 --- a/modules/aws/rds_serverless_cluster/README.md +++ b/modules/aws/rds_serverless_cluster/README.md @@ -69,11 +69,7 @@ These secrets are also set as outputs of the module and can be referenced throug # Example Usage -Below is an example of how you would call the `rds_serverless_cluster` module in your -terraform code. Note that when calling it directly from the GitHub repository you can specify a -version by appending the below source reference with `?ref=v2` for the latest v2.x.x release -(for further information please see -[here](https://developer.hashicorp.com/terraform/language/modules/sources#modules-in-package-sub-directories)). +Below is an example of how you would call the `rds_serverless_cluster` module in your terraform code. ```hcl module "rds_cluster_setup" { diff --git a/modules/aws/vpc/README.md b/modules/aws/vpc/README.md index 4b7fe84..ddae45a 100644 --- a/modules/aws/vpc/README.md +++ b/modules/aws/vpc/README.md @@ -72,14 +72,12 @@ traffic, this is good from an auditing perspective, however you will be charged # Example Usage -Below are examples of how you would call the `vpc_subnet` module in your terraform code. +Below are examples of how you would call the `vpc` module in your terraform code. + In this example we show two ways the module can be used; the first uses the module to create a public and private subnet on each Availability Zone in your defined region, the second uses the module to create 1 public subnet in the AZ `eu-west-1` and 2 private subnets in `eu-west-1` -and `eu-west-3` respectively. Note that when calling the module directly from the GitHub -repository you can specify a version by appending the below source reference with -`?ref=v2` for the latest v2.x.x release (for further information please see -[here](https://developer.hashicorp.com/terraform/language/modules/sources#modules-in-package-sub-directories)) +and `eu-west-3` respectively. ```hcl module "vpc_subnet" {