Skip to content

Commit 0df5552

Browse files
authored
Merge pull request #316 from hashicorp/repo-sync
Repo sync
2 parents f4357e4 + 94aeefa commit 0df5552

File tree

378 files changed

+921
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+921
-228
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/content/terraform-plugin-sdk @hashicorp/terraform-devex @hashicorp/terraform-education
1111
/content/terraform-plugin-testing @hashicorp/terraform-devex @hashicorp/terraform-education
1212
/content/terraform-docs-agents @hashicorp/team-hcpt-agent-engineering
13+
/content/terraform-migrate @hashicorp/team-docs-packer-and-terraform
1314
/content/terraform-cdk @hashicorp/cdktf
1415

1516
/content/terraform @hashicorp/terraform-education @hashicorp/terraform-core @hashicorp/team-docs-packer-and-terraform

__fixtures__/productConfig.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ export const PRODUCT_CONFIG = {
241241
versionedDocs: true,
242242
websiteDir: 'website',
243243
},
244+
'terraform-migrate': {
245+
assetDir: 'img',
246+
basePaths: ['migrate'],
247+
contentDir: 'docs',
248+
dataDir: 'data',
249+
productSlug: 'terraform',
250+
semverCoerce: semver.coerce,
251+
versionedDocs: true,
252+
websiteDir: 'website',
253+
},
244254
'terraform-cdk': {
245255
/**
246256
* ✅ Initial migration attempt: SEEMS TO WORK

app/api/content/[productSlug]/redirects/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export async function GET(request: Request, { params }: { params: GetParams }) {
3939
'redirects.jsonc',
4040
]
4141

42-
const readFileResult = await findFileWithMetadata(filePath, versionMetadata)
42+
const readFileResult = await findFileWithMetadata(filePath, versionMetadata, {
43+
loadFromContentDir: process.env.NODE_ENV === 'development',
44+
})
4345
if (!readFileResult.ok) {
4446
return new Response('Not found', { status: 404 })
4547
}

app/utils/file.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import grayMatter from 'gray-matter'
77
import { parse as jsoncParse } from 'jsonc-parser'
8+
import { readFile } from 'fs/promises'
89

910
import { Err, Ok, Result } from './result'
1011
import type { ProductVersionMetadata } from './contentVersions'
@@ -27,13 +28,22 @@ const headers = process.env.VERCEL_URL
2728
export const findFileWithMetadata = async (
2829
filePath: string[],
2930
versionMetaData: ProductVersionMetadata,
31+
options: {
32+
loadFromContentDir?: boolean
33+
} = { loadFromContentDir: false },
3034
) => {
3135
const newFilePath = ifNeededAddReleaseStageToPath(
3236
filePath,
3337
versionMetaData.releaseStage,
3438
)
3539

3640
try {
41+
if (options.loadFromContentDir) {
42+
const filePathString = joinFilePath(newFilePath)
43+
const fileContent = await readFile(filePathString, 'utf-8')
44+
return Ok(fileContent)
45+
}
46+
3747
const res = await fetch(`${SELF_URL}/${newFilePath.join('/')}`, {
3848
cache: 'no-cache',
3949
headers,
@@ -47,7 +57,9 @@ export const findFileWithMetadata = async (
4757

4858
return Ok(text)
4959
} catch {
50-
return Err(`Failed to read file at path: ${newFilePath.join('/')}`)
60+
return Err(
61+
`Failed to read file at path: ${newFilePath.join('/')}, with options: ${JSON.stringify(options, null, 2)}`,
62+
)
5163
}
5264
}
5365

app/utils/productConfig.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,17 @@ export const PRODUCT_CONFIG = {
247247
versionedDocs: true,
248248
websiteDir: 'website',
249249
},
250+
'terraform-migrate': {
251+
assetDir: '',
252+
basePaths: ['migrate'],
253+
contentDir: 'docs',
254+
dataDir: 'data',
255+
navDataPath: 'migrate',
256+
productSlug: 'terraform',
257+
semverCoerce: semver.coerce,
258+
versionedDocs: true,
259+
websiteDir: 'website',
260+
},
250261
'terraform-cdk': {
251262
assetDir: '',
252263
basePaths: ['cdktf'],

content/terraform-docs-agents/v1.23.x/docs/cloud-docs/agents/request-forwarding.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description: >-
66

77
# Request forwarding
88

9+
@include 'request-forwarding-tier.mdx'
10+
911
You can configure HCP Terraform Agents to handle HTTP and HTTPS
1012
request forwarding on behalf of HCP Terraform. This enables HCP Terraform to access
1113
services in private networks without requiring direct inbound network access.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Note>
2+
3+
Request forwarding is available on the HCP Terraform **Premium** edition. Refer to [HCP Terraform pricing](https://www.hashicorp.com/products/terraform/pricing) for details.
4+
5+
</Note>

content/terraform-docs-common/data/cloud-docs-nav-data.json

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,7 @@
2727
},
2828
{
2929
"title": "Migrate to HCP Terraform",
30-
"routes": [
31-
{
32-
"title": "Overview",
33-
"path": "migrate"
34-
},
35-
{
36-
"title": "The tf-migrate CLI",
37-
"routes": [
38-
{
39-
"title": "Overview",
40-
"path": "migrate/tf-migrate"
41-
},
42-
{
43-
"title": "CLI Reference",
44-
"routes": [
45-
{
46-
"title": "tf-migrate prepare",
47-
"path": "migrate/tf-migrate/reference/prepare"
48-
},
49-
{
50-
"title": "tf-migrate execute",
51-
"path": "migrate/tf-migrate/reference/execute"
52-
},
53-
{
54-
"title": "Configuration file reference",
55-
"path": "migrate/tf-migrate/reference/configuration"
56-
}
57-
]
58-
}
59-
]
60-
}
61-
]
30+
"path": "migrate"
6231
},
6332
{
6433
"title": "API",

content/terraform-docs-common/docs/cloud-docs/migrate/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Stop all Terraform operations associated with the state files. This may require
6262

6363
## Migrate state using Terraform migrate
6464

65-
You can use the Terraform migrate CLI tool to automatically migrate state to HCP Terraform and Terraform Enterprise. The tool does not ship with HCP Terraform. You must download and install the binary for the CLI tool separately. Refer to the [Terraform migrate documentation](/terraform/cloud-docs/migrate/tf-migrate) for more information.
65+
You can use the Terraform migrate CLI tool to automatically migrate state to HCP Terraform and Terraform Enterprise. The tool does not ship with HCP Terraform. You must download and install the binary for the CLI tool separately. Refer to the [Terraform migrate documentation](/terraform/migrate) for more information.
6666

6767
## Migrate state using the API
6868

content/terraform-docs-common/docs/cloud-docs/migrate/tf-migrate/index.mdx

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)