Skip to content

Commit 57e183e

Browse files
authored
Enforce that we don't use relative links (#2218)
* Enforce that we don't use relative links * we can actually enforce this across all of docs * Look for `../` as well, limit to 2.0 as our automated guides do use relative links sometimes * link fix * 2 more links * more link fixes * more links * mooore links * final links
1 parent 8e24cfe commit 57e183e

File tree

20 files changed

+38
-32
lines changed

20 files changed

+38
-32
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ references:
5454
name: spellcheck
5555
command: yarn && yarn spellcheck
5656

57+
no_relative_links: &no_relative_links
58+
run:
59+
name: ensure_no_relative_links
60+
command: yarn && yarn relative-link-check
61+
5762
test_docs: &test_docs
5863
run:
5964
name: test
@@ -150,6 +155,7 @@ jobs:
150155
- checkout
151156
- *build_docs
152157
- *spellcheck_docs
158+
- *no_relative_links
153159
- *test_docs
154160
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are
155161
# available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass

docs/2.0/docs/accountfactory/architecture/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Access to CloudTrail is controlled by AWS IAM policies that are assigned to indi
3434
Gruntwork recommends that only those with administrative access to an AWS account have access to view CloudTrail logs, as they contain a record of every single API operation that was performed in the account, which may expose the name or configuration of resources an individual user may otherwise not have access to.
3535
:::
3636

37-
Further, the configuration of CloudTrail trails should be defined as code, with all changes reviewed in a pull request before being applied automatically by [Gruntwork Pipelines](../../pipelines/overview.md).
37+
Further, the configuration of CloudTrail trails should be defined as code, with all changes reviewed in a pull request before being applied automatically by [Gruntwork Pipelines](/2.0/docs/pipelines/concepts/overview).
3838

3939
See [Identity-based policy examples for AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_id-based-policy-examples.html) to learn more about granting access to CloudTrail.
4040

docs/2.0/docs/library/concepts/overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ To learn more, refer to [Modules](/2.0/docs/library/concepts/modules)
2121
**Service modules** are opinionated combinations of "building block" modules described above. They are designed to be used "off the shelf" with no need to assemble a collection of “building block” modules on your own. They typically represent a full use case to solve a business problem on their own. For example, the `vpc` service module deploys a VPC, VPC Flow Logs, and Network ACLs. If you agree with the opinions embedded in a service module, they’re the fastest way to deploy production-grade infrastructure.
2222

2323
To learn more, refer to [Service Modules](/2.0/docs/library/concepts/service-modules)
24-

docs/2.0/docs/library/guides/integrate-tfc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ data source](https://www.terraform.io/docs/providers/terraform/d/remote_state.ht
9595
another workspace. In this manner, you can link multiple workspaces together to
9696
build an end-to-end infrastructure.
9797

98-
In our guide on [using Gruntwork modules](../tutorials/customizing-modules.md), we discuss the wrapper module
98+
In our guide on [using Gruntwork modules](/2.0/docs/library/tutorials/customizing-modules), we discuss the wrapper module
9999
pattern in which multiple Terraform modules are contained in a hierarchy of directories located under
100100
`infrastructure-modules/modules`. Using such a hierarchy, each workspace will use the same `infrastructure-modules` repository, but pointed at different subdirectories within the repository.
101101

docs/2.0/docs/library/tutorials/creating-service-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ touch gw_service_guide/serverless-api/outputs.tf
2828

2929
### Define the service
3030

31-
Next, define the module blocks for the AWS Lambda function and HTTP API Gateway. For the Lambda, we will use the [Lambda function module](../../../../reference/modules/terraform-aws-lambda/lambda/), for the HTTP API Gateway we will use the [HTTP API Gateway module](../../../../reference/modules/terraform-aws-lambda/lambda-http-api-gateway/).
31+
Next, define the module blocks for the AWS Lambda function and HTTP API Gateway. For the Lambda, we will use the [Lambda function module](/reference/modules/terraform-aws-lambda/lambda/), for the HTTP API Gateway we will use the [HTTP API Gateway module](/reference/modules/terraform-aws-lambda/lambda-http-api-gateway/).
3232

3333
To keep the configuration simple for this guide, we define a single route — `ANY /{proxy+}`. This tells the API Gateway to send any requests matching the path `/*` to the Lambda. This is an effective approach if you are using an API framework in the Lambda function code that can handle request routing. We will also set some defaults for the Lambda to not run in a VPC, have a maximum run time of 30 seconds, and 128MB of memory.
3434

docs/2.0/docs/library/tutorials/module-defaults.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Defining module defaults
44

5-
Now that you have an understanding of [what module defaults are](../concepts/module-defaults.md), you can develop your own defaults module.
5+
Now that you have an understanding of [what module defaults are](/2.0/docs/library/concepts/module-defaults), you can develop your own defaults module.
66

77
All of your defaults modules should be placed in a directory named `_module_defaults`. Beyond that, it is up to you as a developer to determine how to structure the code. Gruntwork recommends structuring your module defaults directory by creating directories for each resource category (e.g., storage, networking) then using a name for the Terragrunt file that represents the resource(s) it will create.
88

@@ -37,7 +37,7 @@ locals {
3737

3838
Finally, you can define inputs. This is where the module defaults pattern really starts to demonstrate value by keeping your code DRY.
3939

40-
In the example block below, we’ve set default values for the `vpc_name` and `num_nat_gateways` variables. A quick inspection of the [`vpc-app`](../../../../../reference/modules/terraform-aws-vpc/vpc-app/) module shows us that we’re only missing one additional required variable — `cidr_block`. This means that consumers of our defaults module only need to specify a value for one input variable, a 66% reduction! You could even expand this example to always use the same CIDR block, allowing consumers to override it should they require a different block.
40+
In the example block below, we’ve set default values for the `vpc_name` and `num_nat_gateways` variables. A quick inspection of the [`vpc-app`](/reference/modules/terraform-aws-vpc/vpc-app/) module shows us that we’re only missing one additional required variable — `cidr_block`. This means that consumers of our defaults module only need to specify a value for one input variable, a 66% reduction! You could even expand this example to always use the same CIDR block, allowing consumers to override it should they require a different block.
4141

4242

4343
```hcl title=_module_defaults/networking/vpc-app.hcl
@@ -58,7 +58,7 @@ Now that you know how to develop an defaults module, let’s dive in to how you
5858

5959
### Infrastructure units
6060

61-
An infrastructure unit is the Gruntwork term for the deployment of an infrastructure as code module in a single environment. For example, deploying the [`vpc-app`](../../../../reference/modules/terraform-aws-vpc/vpc-app/) module in your development AWS account is a single infrastructure unit.
61+
An infrastructure unit is the Gruntwork term for the deployment of an infrastructure as code module in a single environment. For example, deploying the [`vpc-app`](/reference/modules/terraform-aws-vpc/vpc-app/) module in your development AWS account is a single infrastructure unit.
6262

6363
In this section, we’ll walk through the approach we employ at Gruntwork for leveraging defaults modules as infrastructure units. When you purchase a DevOps Foundation, the generated repository containing your infrastructure as code is automatically laid out to use this approach.
6464

docs/2.0/docs/overview/concepts/infrastructure-live.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ For more details and the other options, see [Keep your Terragrunt Architecture D
7777
### Module defaults
7878

7979

80-
Now that you have your accounts, environments, categories, resources, and state figured out, you may be wondering how you can increase code re-use across your `live` repository. Gruntwork recommends using the ["module defaults"](../../library/concepts/module-defaults.md) pattern to keep your Terragrunt architecture DRY.
80+
Now that you have your accounts, environments, categories, resources, and state figured out, you may be wondering how you can increase code re-use across your `live` repository. Gruntwork recommends using the ["module defaults"](/2.0/docs/library/concepts/module-defaults) pattern to keep your Terragrunt architecture DRY.

docs/2.0/docs/overview/concepts/labels-tags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ As an example, if Acme Co was running an application named `coolapp` on AWS EC2
3131

3232
### Adding labels
3333

34-
The simplest way to create a label is using a `locals` block and combining the recommended attributes into a single attribute. For example, if you were creating an AWS S3 bucket using a Gruntwork module you could set up the following locals block. If you are using the [module defaults pattern](../../library/concepts/module-defaults.md), placing the name logic in the default module will ensure that all consumers of the module will use the same naming scheme automatically by default.
34+
The simplest way to create a label is using a `locals` block and combining the recommended attributes into a single attribute. For example, if you were creating an AWS S3 bucket using a Gruntwork module you could set up the following locals block. If you are using the [module defaults pattern](/2.0/docs/library/concepts/module-defaults), placing the name logic in the default module will ensure that all consumers of the module will use the same naming scheme automatically by default.
3535

3636
```hcl
3737
terraform {

docs/2.0/docs/overview/iac-foundations/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The IaC Foundations component is focused on:
1111
- **IaC Modules.** No IaC modules are needed for this component.
1212
- **Tooling.** We recommend Terragrunt to effectively use Terraform/OpenTofu at scale.
1313
- **Setup.** We grant you access to a sophisticated git repo template that includes customization options and generates your repo code.
14-
- **Updates.** We publish ongoing updates to IaC foundational patterns and will write [patches](../../patcher/patcher.md) if applicable to adopt those changes.
14+
- **Updates.** We publish ongoing updates to IaC foundational patterns and will write [patches](/2.0/docs/patcher/concepts/patches) if applicable to adopt those changes.
1515

1616
## IaC foundations considerations
1717

docs/2.0/docs/patcher/guides/promotion-workflows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ As of July 2024 Gruntwork officially supports Patcher Promotion Workflows using
55

66
:::info
77
Related Content:
8-
* [Concepts - Patcher Workflows](../concepts/promotion-workflows.md)
9-
* [Architecture - Overview](../architecture/index.md)
8+
* [Concepts - Patcher Workflows](/2.0/docs/patcher/concepts/promotion-workflows)
9+
* [Architecture - Overview](/2.0/docs/patcher/architecture)
1010
:::
1111

1212
## Prerequisites
@@ -27,7 +27,7 @@ Then you would define your environments as `dev-*`, stage as `stage-*` and prod
2727

2828
## Implementation & Setup Example
2929

30-
The Patcher Promotion Workflow process consists of a series of GitHub Actions workflow files. Each environment is modeled as an individual workflow. The process begins with the lowest environment (usually something like `dev`). It scans the entire `dev` environment for all dependencies which may require updates. It then generates one pull request per dependency. That PR updates that dependency in just the `dev` environment.
30+
The Patcher Promotion Workflow process consists of a series of GitHub Actions workflow files. Each environment is modeled as an individual workflow. The process begins with the lowest environment (usually something like `dev`). It scans the entire `dev` environment for all dependencies which may require updates. It then generates one pull request per dependency. That PR updates that dependency in just the `dev` environment.
3131

3232
As each of those pull requests is approved and merged, that approval triggers new pull requests for the subsequent environment (triggered via `repository dispatch` events). This process continues until the last environment at which point no further PRs are opened and all environments have been updated.
3333

@@ -49,7 +49,7 @@ The initial GitHub Actions Workflow file, in this example `update-dev.yml`, cont
4949
* Note this job uses a secret, `PIPELINES_READ_TOKEN`, which needs access to your Gruntwork account to access the Patcher binary. See more on machine user tokens [here](/2.0/docs/pipelines/installation/viamachineusers).
5050
* The `update-env` Job
5151
* This job takes the spec output from the report, puts it into a file, then calls patcher update.
52-
* Patcher update reads the spec file, checks out the code, makes a commit and then pushes a pull request
52+
* Patcher update reads the spec file, checks out the code, makes a commit and then pushes a pull request
5353
* It is critically important for the pull request workflow that the `pull_request_branch` be defined as `$PREFIX$DEPENDENCYID`. We strip out the prefix to identify the dependency ID in the `trigger-next-env` Job.
5454
<!-- spell-checker: disable -->
5555
```yml

0 commit comments

Comments
 (0)