Skip to content

Commit

Permalink
Standardised documentation for all modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbuckley committed Apr 20, 2023
1 parent f961374 commit 143d85b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
5 changes: 1 addition & 4 deletions modules/aws/ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 1 addition & 5 deletions modules/aws/rds_serverless_cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
8 changes: 3 additions & 5 deletions modules/aws/vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 143d85b

Please sign in to comment.