Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): product relative links #3401

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ export class FnGenerated {
);
}
/**
* {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output).
* {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output).
* @param {any} value
*/
static sensitive(value: any) {
Expand Down
16 changes: 15 additions & 1 deletion tools/generate-function-bindings/scripts/fetch-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@ async function fetchMetadata() {
`${TERRAFORM_BINARY_NAME} metadata functions -json`
).toString();
const out = path.join(__dirname, FUNCTIONS_METADATA_FILE);
await fs.writeFile(out, prettier.format(json, { parser: "json" }));

const fixed = fixProductRelativeLinks(json);

await fs.writeFile(out, prettier.format(fixed, { parser: "json" }));
}

/**
* There are some relative links in the functions definitions that have the format
* /language/xy
* whereas the developer portal expects them to be
* /terraform/language/xy
* Until this is fixed in the terraform codebase, we need to fix this manually here.
*/
function fixProductRelativeLinks(content: string): string {
return content.replace(/\(\/language\//g, "(/terraform/language/");
}

fetchMetadata();
2 changes: 1 addition & 1 deletion tools/generate-function-bindings/scripts/functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
]
},
"sensitive": {
"description": "`sensitive` takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output).",
"description": "`sensitive` takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output).",
"return_type": "dynamic",
"parameters": [
{ "name": "value", "is_nullable": true, "type": "dynamic" }
Expand Down
34 changes: 23 additions & 11 deletions website/docs/cdktf/api-reference/csharp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25295,6 +25295,7 @@ This contains the text that Terraform will include as part of error messages whe
using HashiCorp.Cdktf;

new TestingAppConfig {
System.Collections.Generic.IDictionary< string, object > Context = null,
bool EnableFutureFlags = null,
bool FakeCdktfJsonPath = null,
string Outdir = null,
Expand All @@ -25305,13 +25306,24 @@ new TestingAppConfig {

#### Properties <a name="Properties" id="Properties"></a>

| **Name** | **Type** | **Description** |
| ----------------------------------------------------------------------------------------------- | ------------------- | ----------------- |
| <code><a href="#cdktf.TestingAppConfig.property.enableFutureFlags">EnableFutureFlags</a></code> | <code>bool</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.fakeCdktfJsonPath">FakeCdktfJsonPath</a></code> | <code>bool</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.outdir">Outdir</a></code> | <code>string</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.stackTraces">StackTraces</a></code> | <code>bool</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.stubVersion">StubVersion</a></code> | <code>bool</code> | _No description._ |
| **Name** | **Type** | **Description** |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------------- |
| <code><a href="#cdktf.TestingAppConfig.property.context">Context</a></code> | <code>System.Collections.Generic.IDictionary< string, object ></code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.enableFutureFlags">EnableFutureFlags</a></code> | <code>bool</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.fakeCdktfJsonPath">FakeCdktfJsonPath</a></code> | <code>bool</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.outdir">Outdir</a></code> | <code>string</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.stackTraces">StackTraces</a></code> | <code>bool</code> | _No description._ |
| <code><a href="#cdktf.TestingAppConfig.property.stubVersion">StubVersion</a></code> | <code>bool</code> | _No description._ |

---

##### `Context`<sup>Optional</sup> <a name="Context" id="cdktf.TestingAppConfig.property.context"></a>

```csharp
public System.Collections.Generic.IDictionary< string, object > Context { get; set; }
```

- _Type:_ System.Collections.Generic.IDictionary< string, object >

---

Expand Down Expand Up @@ -28474,7 +28486,7 @@ new Fn();
| <code><a href="#cdktf.Fn.replace">Replace</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/replace replace} searches a given string for another given substring, and replaces each occurrence with a given replacement string. |
| <code><a href="#cdktf.Fn.reverse">Reverse</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/reverse reverse} takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order. |
| <code><a href="#cdktf.Fn.rsadecrypt">Rsadecrypt</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/rsadecrypt rsadecrypt} decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext. |
| <code><a href="#cdktf.Fn.sensitive">Sensitive</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output). |
| <code><a href="#cdktf.Fn.sensitive">Sensitive</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output). |
| <code><a href="#cdktf.Fn.setintersection">Setintersection</a></code> | The {@link https://developer.hashicorp.com/terraform/language/functions/setintersection setintersection} function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the [intersection](<https://en.wikipedia.org/wiki/Intersection_(set_theory)>) of the sets. |
| <code><a href="#cdktf.Fn.setproduct">Setproduct</a></code> | The {@link https://developer.hashicorp.com/terraform/language/functions/setproduct setproduct} function finds all of the possible combinations of elements from all of the given sets by computing the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product). |
| <code><a href="#cdktf.Fn.setsubtract">Setsubtract</a></code> | The {@link https://developer.hashicorp.com/terraform/language/functions/setsubtract setsubtract} function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the [relative complement](<https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement>) of the second set. |
Expand Down Expand Up @@ -29746,7 +29758,7 @@ using HashiCorp.Cdktf;
Fn.Sensitive(object Value);
```

{@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output).
{@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output).

###### `Value`<sup>Required</sup> <a name="Value" id="cdktf.Fn.sensitive.parameter.value"></a>

Expand Down Expand Up @@ -30804,7 +30816,7 @@ new FnGenerated();
| <code><a href="#cdktf.FnGenerated.replace">Replace</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/replace replace} searches a given string for another given substring, and replaces each occurrence with a given replacement string. |
| <code><a href="#cdktf.FnGenerated.reverse">Reverse</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/reverse reverse} takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order. |
| <code><a href="#cdktf.FnGenerated.rsadecrypt">Rsadecrypt</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/rsadecrypt rsadecrypt} decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext. |
| <code><a href="#cdktf.FnGenerated.sensitive">Sensitive</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output). |
| <code><a href="#cdktf.FnGenerated.sensitive">Sensitive</a></code> | {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output). |
| <code><a href="#cdktf.FnGenerated.setintersection">Setintersection</a></code> | The {@link https://developer.hashicorp.com/terraform/language/functions/setintersection setintersection} function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the [intersection](<https://en.wikipedia.org/wiki/Intersection_(set_theory)>) of the sets. |
| <code><a href="#cdktf.FnGenerated.setproduct">Setproduct</a></code> | The {@link https://developer.hashicorp.com/terraform/language/functions/setproduct setproduct} function finds all of the possible combinations of elements from all of the given sets by computing the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product). |
| <code><a href="#cdktf.FnGenerated.setsubtract">Setsubtract</a></code> | The {@link https://developer.hashicorp.com/terraform/language/functions/setsubtract setsubtract} function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the [relative complement](<https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement>) of the second set. |
Expand Down Expand Up @@ -32069,7 +32081,7 @@ using HashiCorp.Cdktf;
FnGenerated.Sensitive(object Value);
```

{@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output).
{@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output).

###### `Value`<sup>Required</sup> <a name="Value" id="cdktf.FnGenerated.sensitive.parameter.value"></a>

Expand Down
Loading
Loading