2020-03-09 17:35:20 +00:00
{{ template "header" .Header }}
2020-04-17 18:45:06 +00:00
{{ htmlSafe "<!-- WARNING: this file was generated by" }} {{ .Tool }}. {{ htmlSafe "-->" }}
{{ htmlSafe "<!-- Do not edit by hand unless you're certain you know what you are doing! -->" }}
2020-10-07 20:25:25 +00:00
{{- if .DeprecationMessage }}
2023-08-26 17:36:28 +00:00
<div class="resource-deprecated">Deprecated: {{ markdownify .DeprecationMessage -}}</div>
2020-10-07 20:25:25 +00:00
{{- end }}
2020-03-09 17:35:20 +00:00
{{ htmlSafe .Comment }}
Add ability to process docs without dedicated Examples logic (#15475)
This pull request depends on corresponding changes in the
pulumi-terraform bridge.
The bridge will mark up each code section it finds (not just ones found
under an "Example Usage" header) with an HTML comment - currently this
will be `<!--Begin Code Chooser -->` and `<!--End Code Chooser -->` but
the name is subject to change.
In this PR, we are adding logic to detect if an incoming Description
block has an `{{% examples }}` shortcode markup: if yes, we will process
it as before. If no, we will switch to new functionality that relies on
documentation with code sections having no short codes, no "Examples
Section" logic, and will generate every code section it finds in an
incoming schema that is in the Description/Content section of a registry
page with a chooser and language choosables.
This work is part of https://github.com/pulumi/pulumi-aws/issues/2624.
Edit: unit tests are added
This PR is a prerequisite for
https://github.com/pulumi/pulumi-terraform-bridge/pull/1689. It aims to
support both legacy and new behavior.
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
Fixes # (issue)
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-23 18:06:44 +00:00
2020-05-08 23:25:28 +00:00
{{- if ne (len .ExamplesSection) 0 }}
{{ template "examples" .ExamplesSection }}
{{- end }}
2020-03-09 17:35:20 +00:00
<!-- Create resource -->
2024-03-21 13:41:07 +00:00
{{ if ne (len .CreationExampleSyntax) 0 }} ## Create {{ .Header.Title }} Resource
{{- if eq .LangChooserLanguages "" }}
<div>
<pulumi-chooser type="language" options="typescript,python,go,csharp,java,yaml"></pulumi-chooser>
</div>
{{- else }}
<div>
<pulumi-chooser type="language" options="{{ .LangChooserLanguages }}"></pulumi-chooser>
</div>
{{- end }}
{{ range $ lang , $ code := .CreationExampleSyntax }}
<div>
{{ htmlSafe "<pulumi-choosable type=\"language\" values=\"" }}{{ $ lang }}{{ htmlSafe "\">" }}
```{{ $ lang }}
{{ htmlSafe $ code }}
```
2020-03-09 17:35:20 +00:00
2024-03-21 13:41:07 +00:00
</pulumi-choosable>
</div>
{{ end }}
## Definition of {{ .Header.Title }} {#create}{{ else }}
## Create {{ .Header.Title }} Resource {#create}
{{- end }}
2020-04-17 18:45:06 +00:00
{{- if eq .LangChooserLanguages "" }}
2022-05-03 16:06:16 +00:00
<div>
<pulumi-chooser type="language" options="typescript,python,go,csharp,java,yaml"></pulumi-chooser>
</div>
2020-04-17 18:45:06 +00:00
{{- else }}
2022-05-03 16:06:16 +00:00
<div>
<pulumi-chooser type="language" options="{{ .LangChooserLanguages }}"></pulumi-chooser>
</div>
2020-04-17 18:45:06 +00:00
{{- end }}
2020-03-09 17:35:20 +00:00
2020-04-17 18:46:02 +00:00
{{/*
Render the specific snippet to construct the resource, e.g.
"new Bucket(name: string, args?: BucketArgs, opts?: pulumi.ResourceOptions);"
"def Bucket(resource_name, opts=None, acceleration_status=None, ..."
*/}}
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="javascript,typescript">
2020-03-09 17:35:20 +00:00
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span>{{ template "linkify_param" .ConstructorResource.nodejs }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.nodejs }}<span class="p">);</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="python">
2021-04-17 22:33:23 +00:00
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
<span class="k">def </span>{{ template "linkify_param" .ConstructorResource.python }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.python }}<span class="p">)</span>
<span class=nd>@overload</span>
<span class="k">def </span>{{ template "linkify_param" .ConstructorResource.python }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.pythonargs }}<span class="p">)</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="go">
2020-05-15 16:51:24 +00:00
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span>{{ template "linkify_go_param" .ConstructorResource.go }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.go }}<span class="p">) (*{{ template "linkify_param" .ConstructorResource.go }}, error)</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="csharp">
2020-03-09 17:35:20 +00:00
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span>{{ template "linkify_param" .ConstructorResource.csharp }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.csharp }}<span class="p">)</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-21 11:23:36 +00:00
<div>
<pulumi-choosable type="language" values="java">
<div class="highlight"><pre class="chroma">
<code class="language-java" data-lang="java"><span class="k">public </span>{{ template "linkify_param" .ConstructorResource.java }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.javaargs }}<span class="p">)</span>
<span class="k">public </span>{{ template "linkify_param" .ConstructorResource.java }}<span class="p">(</span>{{ htmlSafe .ConstructorParams.java }}<span class="p">)</span>
</code></pre></div>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="yaml">
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">type: {{ template "linkify_param" .ConstructorResource.yaml }}<span class="p"></span>
{{ template "yaml_constructor" .ConstructorParamsTyped.yaml }}
</code></pre></div>
</pulumi-choosable>
</div>
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="javascript,typescript">
2020-04-17 18:46:02 +00:00
{{ template "constructor_args" .ConstructorParamsTyped.nodejs }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-27 14:56:51 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="python">
2021-04-17 22:33:23 +00:00
{{ template "constructor_args" .ConstructorParamsTyped.pythonargs }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-27 14:56:51 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="go">
2020-04-17 18:46:02 +00:00
{{ template "constructor_args" .ConstructorParamsTyped.go }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="csharp">
2020-04-17 18:46:02 +00:00
{{ template "constructor_args" .ConstructorParamsTyped.csharp }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-27 14:56:51 +00:00
2022-04-21 11:23:36 +00:00
<div>
<pulumi-choosable type="language" values="java">
{{ template "constructor_args" .ConstructorParamsTyped.java }}
</pulumi-choosable>
</div>
2020-04-18 09:45:47 +00:00
## {{ .Header.Title }} Resource Properties {#properties}
2020-04-17 23:48:47 +00:00
2022-05-03 16:06:16 +00:00
To learn more about resource properties and how to use them, see [Inputs and Outputs](/docs/intro/concepts/inputs-outputs) in the Architecture and Concepts docs.
2020-04-17 23:48:47 +00:00
### Inputs
2022-05-03 16:06:16 +00:00
The {{ .Header.Title }} resource accepts the following [input](/docs/intro/concepts/inputs-outputs) properties:
2020-03-09 17:35:20 +00:00
{{ template "properties" .InputProperties }}
<!-- Output properties -->
2020-04-17 23:48:47 +00:00
### Outputs
2020-03-09 17:35:20 +00:00
2020-04-18 21:17:08 +00:00
All [input]( #inputs ) properties are implicitly available as output properties . Additionally , the { { . Header . Title } } resource produces the following output properties :
2020-03-09 17:35:20 +00:00
{{ template "properties" .OutputProperties }}
2021-08-12 21:31:15 +00:00
<!-- Methods -->
{{- if ne (len .Methods) 0 }}
## {{ .Header.Title }} Resource Methods {#methods}
{{ range .Methods }}
### {{ .Title }} Method {#method_{{ .Title }}}
{{- if .DeprecationMessage }}
2023-08-26 17:36:28 +00:00
<div class="resource-deprecated">Deprecated: {{ markdownify .DeprecationMessage -}}</div>
2021-08-12 21:31:15 +00:00
{{- end }}
{{ htmlSafe .Comment }}
{{- if ne (len .ExamplesSection) 0 }}
{{ template "examples" .ExamplesSection }}
{{- end }}
#### Using {{ .Title }}
2022-05-03 16:06:16 +00:00
<div>
<pulumi-chooser type="language" options="typescript,python,go,csharp,java,yaml"></pulumi-chooser>
</div>
2021-08-12 21:31:15 +00:00
<!-- TS/JS -->
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="javascript,typescript">
2021-08-12 21:31:15 +00:00
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript">{{ .MethodName.nodejs }}<span class="p">(</span>{{ if ne .MethodArgs.nodejs "" }}{{ htmlSafe .MethodArgs.nodejs }}{{ end }}<span class="p">): {{ if ne .MethodResult.nodejs.Name "" }}Output<{{ template "linkify_param" .MethodResult.nodejs }}>{{ else }}void{{ end }}</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2021-08-12 21:31:15 +00:00
<!-- Python -->
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="python">
2021-08-12 21:31:15 +00:00
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class="k">def </span>{{ .MethodName.python }}(</span>{{ if ne .MethodArgs.python "" }}{{ htmlSafe .MethodArgs.python }}{{ end }}<span class="p">) -></span> {{ if ne .MethodResult.python.Name "" }}Output[{{ template "linkify_param" .MethodResult.python }}]{{ else }}None{{ end }}</code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2021-08-12 21:31:15 +00:00
<!-- Go -->
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="go">
2021-08-12 21:31:15 +00:00
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func</span> <span class="p">(r *{{ .ResourceName }})</span> {{ .MethodName.go }}<span class="p">(</span>{{ if ne .MethodArgs.go "" }}{{ htmlSafe .MethodArgs.go }}{{ end }}<span class="p">) {{ if ne .MethodResult.go.Name "" }}({{ template "linkify_param" .MethodResult.go }}, error){{ else }}error{{ end }}</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2021-08-12 21:31:15 +00:00
<!-- C # -->
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="csharp">
2021-08-12 21:31:15 +00:00
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span>{{ if ne .MethodResult.csharp.Name "" }}Output<{{ template "linkify_param" .MethodResult.csharp }}>{{ else }}void{{ end }} <span class="nx">{{ .MethodName.csharp }}</span><span class="p">({{ if ne .MethodArgs.csharp "" }}{{ htmlSafe .MethodArgs.csharp }}{{ end }})</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2021-08-12 21:31:15 +00:00
{{ if ne (len .InputProperties) 0 }}
The following arguments are supported:
{{ template "properties" .InputProperties }}
{{ end }}
{{ if ne (len .OutputProperties) 0 }}
#### {{ .Title }} Result {#method_{{ .Title }}_result}
{{ template "properties" .OutputProperties }}
{{ end }}
{{ end }}
{{- end -}}
2020-03-09 17:35:20 +00:00
<!-- Read resource -->
{{ if ne (len .StateInputs) 0 }}
2022-09-17 19:25:30 +00:00
## Look up Existing {{.Header.Title}} Resource {#look-up}
2020-03-09 17:35:20 +00:00
2020-03-27 14:56:51 +00:00
Get an existing {{.Header.Title}} resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
2020-04-17 18:45:06 +00:00
{{- if eq .LangChooserLanguages "" }}
2022-05-03 16:06:16 +00:00
<div>
<pulumi-chooser type="language" options="typescript,python,go,csharp,java,yaml"></pulumi-chooser>
</div>
2020-04-17 18:45:06 +00:00
{{- else }}
2022-05-03 16:06:16 +00:00
<div>
<pulumi-chooser type="language" options="{{ .LangChooserLanguages }}"></pulumi-chooser>
</div>
2020-04-17 18:45:06 +00:00
{{- end }}
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="javascript,typescript">
2020-03-17 20:37:40 +00:00
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">public static </span><span class="nf">get</span><span class="p">(</span>{{ htmlSafe .LookupParams.nodejs }}<span class="p">): </span>{{ template "linkify_param" .ConstructorResource.nodejs }}</code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="python">
2020-08-19 15:34:06 +00:00
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@staticmethod</span>
2021-04-17 22:33:23 +00:00
<span class="k">def </span><span class="nf">get</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
<span class="nx">id</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/ #pulumi . ResourceOptions " >Optional[ResourceOptions]</a></span> = None<span class= " p " >,</span>
{{ htmlSafe .LookupParams.python }}<span class="p">) -></span> {{ .ConstructorResource.python.Name }}</code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="go">
2020-03-17 20:37:40 +00:00
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span>Get{{ .Header.Title }}<span class="p">(</span>{{ htmlSafe .LookupParams.go }}<span class="p">) (*{{ template "linkify_param" .ConstructorResource.go }}, error)</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="csharp">
2020-03-17 20:37:40 +00:00
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public static </span>{{ template "linkify_param" .ConstructorResource.csharp }}<span class="nf"> Get</span><span class="p">(</span>{{ htmlSafe .LookupParams.csharp }}<span class="p">)</span></code></pre></div>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-21 11:23:36 +00:00
<div>
<pulumi-choosable type="language" values="java">
<div class="highlight"><pre class="chroma"><code class="language-java" data-lang="java"><span class="k">public static </span>{{ template "linkify_param" .ConstructorResource.java }}<span class="nf"> get</span><span class="p">(</span>{{ htmlSafe .LookupParams.java }}<span class="p">)</span></code></pre></div>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="yaml">
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">Resource lookup is not supported in YAML</code></pre></div>
</pulumi-choosable>
</div>
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="javascript,typescript">
2020-03-09 17:35:20 +00:00
{{ template "read_inputs" }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-27 14:56:51 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="python">
2020-03-27 14:56:51 +00:00
<dl class="resources-properties">
<dt class="property-required" title="Required">
<span>resource_name</span>
<span class="property-indicator"></span>
</dt>
<dd>The unique name of the resulting resource.</dd>
<dt class="property-required" title="Optional">
<span>id</span>
<span class="property-indicator"></span>
</dt>
<dd>The <em>unique</em> provider ID of the resource to lookup.</dd>
</dl>
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-27 14:56:51 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="go">
2020-03-09 17:35:20 +00:00
{{ template "read_inputs" }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-29 22:04:15 +00:00
<div>
<pulumi-choosable type="language" values="csharp">
2020-03-09 17:35:20 +00:00
{{ template "read_inputs" }}
2022-04-29 22:04:15 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
2022-04-21 11:23:36 +00:00
<div>
<pulumi-choosable type="language" values="java">
{{ template "read_inputs" }}
</pulumi-choosable>
</div>
2022-05-03 16:06:16 +00:00
<div>
<pulumi-choosable type="language" values="typescript,javascript,python,go,csharp,java">
2020-03-09 17:35:20 +00:00
The following state arguments are supported:
{{ template "properties" .StateInputs }}
2022-05-03 16:06:16 +00:00
</pulumi-choosable>
</div>
2020-03-09 17:35:20 +00:00
{{ end }}
<!-- Supporting types -->
{{ if ne (len .NestedTypes) 0 }}
2020-03-12 00:58:12 +00:00
2020-03-09 17:35:20 +00:00
## Supporting Types
2020-04-18 09:45:47 +00:00
2023-02-04 02:34:33 +00:00
{{- if ge (len .NestedTypes) 200 }}
2023-02-03 23:19:33 +00:00
> **Note:** There are over 200 nested types for this resource.
Only the first 200 types are included in this documentation.
{{ end }}
2020-12-14 22:40:14 +00:00
2023-02-03 23:19:33 +00:00
{{ range $ index , $ elem := .NestedTypes }}
{{ if lt $ index 200 }}
2023-08-09 00:52:32 +00:00
<h4 id="{{ $ elem . AnchorID }}">
{{ htmlSafe $ elem . Name }}<pulumi-choosable type="language" values="python,go" class="inline">, {{ htmlSafe $ elem . Name }}<wbr>Args</pulumi-choosable>
</h4>
2020-03-09 17:35:20 +00:00
2023-02-03 23:19:33 +00:00
{{- if $ elem . Properties }}{{template "properties" $ elem . Properties -}}{{ end -}}
{{- if $ elem . EnumValues }}{{- template "enums" $ elem . EnumValues -}}{{ end -}}
{{- end -}}
{{- end -}}
2020-12-14 22:40:14 +00:00
{{- end -}}
2020-04-02 00:22:23 +00:00
2020-11-09 14:12:58 +00:00
{{ if .ImportDocs }}
2022-05-01 17:25:12 +00:00
2020-11-09 14:12:58 +00:00
## Import
2022-05-01 17:25:12 +00:00
2020-11-09 14:12:58 +00:00
{{ htmlSafe .ImportDocs }}
2022-05-01 17:25:12 +00:00
2024-03-27 22:24:47 +00:00
To learn more about importing existing cloud resources, see [Importing resources](/docs/using-pulumi/adopting-pulumi/import/).
2020-11-09 14:12:58 +00:00
{{ end }}
2020-04-07 00:01:33 +00:00
{{ template "package_details" .PackageDetails }}