updated template env ref based on PR feedback and prompt workflow

pull/765/head
Scott Anderson 2020-02-19 15:27:12 -07:00
parent 0f387c37ee
commit cb5e5f3c0f
2 changed files with 15 additions and 10 deletions

View File

@ -112,8 +112,8 @@ influx pkg export all \
``` ```
## Include user-definable resource names ## Include user-definable resource names
To let users customize resource names when installing your template, use After exporting a template manifest, replace resource names with **environment references**
**environment references** in place of names. to let users customize resource names when installing your template.
In your template manifest, replace a [supported resource field](#resource-fields-that-support-environment-references) In your template manifest, replace a [supported resource field](#resource-fields-that-support-environment-references)
with an `envRef` object. with an `envRef` object.
@ -157,16 +157,21 @@ metadata:
{{% /code-tab-content %}} {{% /code-tab-content %}}
{{< /code-tabs-wrapper >}} {{< /code-tabs-wrapper >}}
Using the example above, users would include `--env-ref=bucket-name-1=myBucket` Using the example above, users are prompted to provide a value for `bucket-name-1`
when [installing the template](/v2.0/influxdb-templates/use/#install-templates) to when [installing the template](/v2.0/influxdb-templates/use/#install-templates).
set the bucket name to "myBucket". Users can also include the `--env-ref` flag with the appropriate key-value pair
when installing the template.
```sh ```sh
# Set bucket-name-1 to "myBucket"
influx pkg \ influx pkg \
-f /path/to/template.yml \ -f /path/to/template.yml \
--env-ref=bucket-name-1=myBucket --env-ref=bucket-name-1=myBucket
``` ```
_If sharing your template, we recommend documenting what environment references
exist in the template and what keys to use to replace them._
{{% note %}} {{% note %}}
#### Resource fields that support environment references #### Resource fields that support environment references
Only the following fields support environment references: Only the following fields support environment references:

View File

@ -164,11 +164,11 @@ influx pkg \
### Define environment references ### Define environment references
Some templates include [environment references](/v2.0/influxdb-templates/create/#include-user-definable-resource-names) that let you provide custom resource names. Some templates include [environment references](/v2.0/influxdb-templates/create/#include-user-definable-resource-names) that let you provide custom resource names.
Template maintainers should document what environment references exist in the template The `influx pkg` command prompts you to provide a value for each environment
and what keys to use to replace them. reference in the template.
You can also provide values for environment references by including an `--env-ref`
To provide values for environment references, include an `--env-ref` flag with a flag with a key-value pair comprised of the environment reference key and the
key-value pair comprised of the environment reference key and the value to replace it. value to replace it.
```sh ```sh
influx pkg -f /path/to/template.yml \ influx pkg -f /path/to/template.yml \