From b6e70d50a37e6f18efcef29497851977955e9125 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 13 Jul 2023 22:31:25 +0000 Subject: [PATCH] Generate libsonnet source from libgenerator PR https://github.com/tf-libsonnet/libgenerator/pull/184 Signed-off-by: tflibsonnet-ci <120686569+tflibsonnet-ci@users.noreply.github.com> --- 0.x/_gen/data/main.libsonnet | 1 + 0.x/_gen/data/packer_run_task.libsonnet | 63 +++++++ 0.x/_gen/main.libsonnet | 1 + 0.x/_gen/resources/packer_run_task.libsonnet | 82 ++++++++ docs/0.x/README.md | 1 + docs/0.x/data/index.md | 1 + docs/0.x/data/packer_run_task.md | 163 ++++++++++++++++ docs/0.x/packer_run_task.md | 188 +++++++++++++++++++ 8 files changed, 500 insertions(+) create mode 100644 0.x/_gen/data/packer_run_task.libsonnet create mode 100644 0.x/_gen/resources/packer_run_task.libsonnet create mode 100644 docs/0.x/data/packer_run_task.md create mode 100644 docs/0.x/packer_run_task.md diff --git a/0.x/_gen/data/main.libsonnet b/0.x/_gen/data/main.libsonnet index aa3e29c..ca82db1 100644 --- a/0.x/_gen/data/main.libsonnet +++ b/0.x/_gen/data/main.libsonnet @@ -16,6 +16,7 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); packer_image: (import 'packer_image.libsonnet'), packer_image_iteration: (import 'packer_image_iteration.libsonnet'), packer_iteration: (import 'packer_iteration.libsonnet'), + packer_run_task: (import 'packer_run_task.libsonnet'), vault_cluster: (import 'vault_cluster.libsonnet'), vault_secrets_app: (import 'vault_secrets_app.libsonnet'), } diff --git a/0.x/_gen/data/packer_run_task.libsonnet b/0.x/_gen/data/packer_run_task.libsonnet new file mode 100644 index 0000000..43729eb --- /dev/null +++ b/0.x/_gen/data/packer_run_task.libsonnet @@ -0,0 +1,63 @@ +local tf = (import 'github.com/tf-libsonnet/core/main.libsonnet'); +local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); +{ + '#':: d.pkg(name='packer_run_task', url='', help='`packer_run_task` represents the `hcp_packer_run_task` Terraform data source.\n\nThe Packer Run Task data source gets the configuration information needed to set up an HCP Packer Registry's run task.\n\nThis package contains functions and utilities for setting up the data source using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.data.packer_run_task.new` injects a new `data_hcp_packer_run_task` Terraform `data source`\nblock into the root module document.\n\nAdditionally, this inserts a private function into the `_ref` attribute that generates references to attributes of the\nresource. For example, if you added a new instance to the root using:\n\n # arguments omitted for brevity\n hcp.data.packer_run_task.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.data.packer_run_task` using the reference:\n\n $._ref.data_hcp_packer_run_task.some_id.get('id')\n\nThis is the same as directly entering `\"${ data_hcp_packer_run_task.some_id.id }\"` as the value.\n\nNOTE: if you are chaining multiple resources together in a merge operation, you may not be able to use `super`, `self`,\nor `$` to refer to the root object. Instead, make an explicit outer object using `local`.\n\n**Args**:\n - `dataSrcLabel` (`string`): The name label of the block.\n - `project_id` (`string`): \nThe ID of the HCP project where the HCP Packer Registry is located. \nIf not specified, the project specified in the HCP Provider config block will be used, if configured.\nIf a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object.\n - `timeouts` (`obj`): Set the `timeouts` field on the resulting data source block. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.data.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor.\n\n**Returns**:\n- A mixin object that injects the new data source into the root Terraform configuration.\n", args=[]), + new( + dataSrcLabel, + project_id=null, + timeouts=null, + _meta={} + ):: tf.withData( + type='hcp_packer_run_task', + label=dataSrcLabel, + attrs=self.newAttrs(project_id=project_id, timeouts=timeouts), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.data.packer_run_task.newAttrs` constructs a new object with attributes and blocks configured for the `packer_run_task`\nTerraform data source.\n\nUnlike [hcp.data.packer_run_task.new](#fn-new), this function will not inject the `data source`\nblock into the root Terraform document. Instead, this must be passed in as the `attrs` argument for the\n[tf.withData](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withdata) function to build a complete block.\n\nThis is most useful when you need to preprocess the attributes with functions, conditional, or looping logic prior to\ninjecting into a complete block.\n\n**Args**:\n - `project_id` (`string`): \nThe ID of the HCP project where the HCP Packer Registry is located. \nIf not specified, the project specified in the HCP Provider config block will be used, if configured.\nIf a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object.\n - `timeouts` (`obj`): Set the `timeouts` field on the resulting object. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.data.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor.\n\n**Returns**:\n - An attribute object that can be used with [tf.withData](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withdata) to construct a new `packer_run_task` data source into the root Terraform configuration.\n', args=[]), + newAttrs( + project_id=null, + timeouts=null + ):: std.prune(a={ + project_id: project_id, + timeouts: timeouts, + }), + timeouts:: { + '#new':: d.fn(help='\n`hcp.packer_run_task.timeouts.new` constructs a new object with attributes and blocks configured for the `timeouts`\nTerraform sub block.\n\n\n\n**Args**:\n - `default` (`string`): Set the `default` field on the resulting object. When `null`, the `default` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that represents the `timeouts` sub block.\n', args=[]), + new( + default=null + ):: std.prune(a={ + default: default, + }), + }, + '#withProjectId':: d.fn(help='`hcp.string.withProjectId` constructs a mixin object that can be merged into the `string`\nTerraform data source block to set or update the project_id field.\n\n\n\n**Args**:\n - `dataSrcLabel` (`string`): The name label of the block to update.\n - `value` (`string`): The value to set for the `project_id` field.\n', args=[]), + withProjectId(dataSrcLabel, value): { + data+: { + hcp_packer_run_task+: { + [dataSrcLabel]+: { + project_id: value, + }, + }, + }, + }, + '#withTimeouts':: d.fn(help='`hcp.obj.withTimeouts` constructs a mixin object that can be merged into the `obj`\nTerraform data source block to set or update the timeouts field.\n\nThis function will replace the map with the passed in `value`. If you wish to instead merge the\npassed in value to the existing map, use the [hcp.obj.withTimeoutsMixin](TODO) function.\n\n**Args**:\n - `dataSrcLabel` (`string`): The name label of the block to update.\n - `value` (`obj`): The value to set for the `timeouts` field.\n', args=[]), + withTimeouts(dataSrcLabel, value): { + data+: { + hcp_packer_run_task+: { + [dataSrcLabel]+: { + timeouts: value, + }, + }, + }, + }, + '#withTimeoutsMixin':: d.fn(help='`hcp.obj.withTimeoutsMixin` constructs a mixin object that can be merged into the `obj`\nTerraform data source block to set or update the timeouts field.\n\nThis function will merge the passed in value to the existing map. If you wish\nto instead replace the entire map with the passed in `value`, use the [hcp.obj.withTimeouts](TODO)\nfunction.\n\n\n**Args**:\n - `dataSrcLabel` (`string`): The name label of the block to update.\n - `value` (`obj`): The value to set for the `timeouts` field.\n', args=[]), + withTimeoutsMixin(dataSrcLabel, value): { + data+: { + hcp_packer_run_task+: { + [dataSrcLabel]+: { + timeouts+: value, + }, + }, + }, + }, +} diff --git a/0.x/_gen/main.libsonnet b/0.x/_gen/main.libsonnet index db156e1..b4ea4b6 100644 --- a/0.x/_gen/main.libsonnet +++ b/0.x/_gen/main.libsonnet @@ -14,6 +14,7 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); hvn_route: (import 'resources/hvn_route.libsonnet'), packer_channel: (import 'resources/packer_channel.libsonnet'), packer_channel_assignment: (import 'resources/packer_channel_assignment.libsonnet'), + packer_run_task: (import 'resources/packer_run_task.libsonnet'), vault_cluster: (import 'resources/vault_cluster.libsonnet'), vault_cluster_admin_token: (import 'resources/vault_cluster_admin_token.libsonnet'), data: (import 'data/main.libsonnet'), diff --git a/0.x/_gen/resources/packer_run_task.libsonnet b/0.x/_gen/resources/packer_run_task.libsonnet new file mode 100644 index 0000000..d416b1d --- /dev/null +++ b/0.x/_gen/resources/packer_run_task.libsonnet @@ -0,0 +1,82 @@ +local tf = (import 'github.com/tf-libsonnet/core/main.libsonnet'); +local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); +{ + '#':: d.pkg(name='packer_run_task', url='', help='`packer_run_task` represents the `hcp_packer_run_task` Terraform resource.\n\n\nThe Packer Run Task resource allows you to regenerate the HMAC key for an HCP Packer Registry's run task.\n\nIf you do not need to regenerate the HMAC key, it is recommended to use the `hcp_packer_run_task` data source instead.\n\nThis package contains functions and utilities for setting up the resource using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.packer_run_task.new` injects a new `hcp_packer_run_task` Terraform `resource`\nblock into the root module document.\n\nAdditionally, this inserts a private function into the `_ref` attribute that generates references to attributes of the\nresource. For example, if you added a new instance to the root using:\n\n # arguments omitted for brevity\n hcp.packer_run_task.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.packer_run_task` using the reference:\n\n $._ref.hcp_packer_run_task.some_id.get('id')\n\nThis is the same as directly entering `\"${ hcp_packer_run_task.some_id.id }\"` as the value.\n\nNOTE: if you are chaining multiple resources together in a merge operation, you may not be able to use `super`, `self`,\nor `$` to refer to the root object. Instead, make an explicit outer object using `local`.\n\n**Args**:\n - `resourceLabel` (`string`): The name label of the block.\n - `project_id` (`string`): \nThe ID of the HCP project where the HCP Packer Registry is located. \nIf not specified, the project specified in the HCP Provider config block will be used, if configured.\nIf a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object.\n - `regenerate_hmac` (`bool`): If true, the HMAC Key (`hmac_key`) will be regenerated during `terraform apply`. While set to true, the key will be regenerated on every `terraform apply` until `regenerate_hmac` is set to false or removed from the config. When `null`, the `regenerate_hmac` field will be omitted from the resulting object.\n - `timeouts` (`obj`): Set the `timeouts` field on the resulting resource block. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor.\n\n**Returns**:\n- A mixin object that injects the new resource into the root Terraform configuration.\n", args=[]), + new( + resourceLabel, + project_id=null, + regenerate_hmac=null, + timeouts=null, + _meta={} + ):: tf.withResource( + type='hcp_packer_run_task', + label=resourceLabel, + attrs=self.newAttrs(project_id=project_id, regenerate_hmac=regenerate_hmac, timeouts=timeouts), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.packer_run_task.newAttrs` constructs a new object with attributes and blocks configured for the `packer_run_task`\nTerraform resource.\n\nUnlike [hcp.packer_run_task.new](#fn-new), this function will not inject the `resource`\nblock into the root Terraform document. Instead, this must be passed in as the `attrs` argument for the\n[tf.withResource](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withresource) function to build a complete block.\n\nThis is most useful when you need to preprocess the attributes with functions, conditional, or looping logic prior to\ninjecting into a complete block.\n\n**Args**:\n - `project_id` (`string`): \nThe ID of the HCP project where the HCP Packer Registry is located. \nIf not specified, the project specified in the HCP Provider config block will be used, if configured.\nIf a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object.\n - `regenerate_hmac` (`bool`): If true, the HMAC Key (`hmac_key`) will be regenerated during `terraform apply`. While set to true, the key will be regenerated on every `terraform apply` until `regenerate_hmac` is set to false or removed from the config. When `null`, the `regenerate_hmac` field will be omitted from the resulting object.\n - `timeouts` (`obj`): Set the `timeouts` field on the resulting object. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor.\n\n**Returns**:\n - An attribute object that can be used with [tf.withResource](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withresource) to construct a new `packer_run_task` resource into the root Terraform configuration.\n', args=[]), + newAttrs( + project_id=null, + regenerate_hmac=null, + timeouts=null + ):: std.prune(a={ + project_id: project_id, + regenerate_hmac: regenerate_hmac, + timeouts: timeouts, + }), + timeouts:: { + '#new':: d.fn(help='\n`hcp.packer_run_task.timeouts.new` constructs a new object with attributes and blocks configured for the `timeouts`\nTerraform sub block.\n\n\n\n**Args**:\n - `create` (`string`): Set the `create` field on the resulting object. When `null`, the `create` field will be omitted from the resulting object.\n - `default` (`string`): Set the `default` field on the resulting object. When `null`, the `default` field will be omitted from the resulting object.\n - `delete` (`string`): Set the `delete` field on the resulting object. When `null`, the `delete` field will be omitted from the resulting object.\n - `update` (`string`): Set the `update` field on the resulting object. When `null`, the `update` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that represents the `timeouts` sub block.\n', args=[]), + new( + create=null, + default=null, + delete=null, + update=null + ):: std.prune(a={ + create: create, + default: default, + delete: delete, + update: update, + }), + }, + '#withProjectId':: d.fn(help='`hcp.string.withProjectId` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the project_id field.\n\n\n\n**Args**:\n - `resourceLabel` (`string`): The name label of the block to update.\n - `value` (`string`): The value to set for the `project_id` field.\n', args=[]), + withProjectId(resourceLabel, value): { + resource+: { + hcp_packer_run_task+: { + [resourceLabel]+: { + project_id: value, + }, + }, + }, + }, + '#withRegenerateHmac':: d.fn(help='`hcp.bool.withRegenerateHmac` constructs a mixin object that can be merged into the `bool`\nTerraform resource block to set or update the regenerate_hmac field.\n\n\n\n**Args**:\n - `resourceLabel` (`string`): The name label of the block to update.\n - `value` (`bool`): The value to set for the `regenerate_hmac` field.\n', args=[]), + withRegenerateHmac(resourceLabel, value): { + resource+: { + hcp_packer_run_task+: { + [resourceLabel]+: { + regenerate_hmac: value, + }, + }, + }, + }, + '#withTimeouts':: d.fn(help='`hcp.obj.withTimeouts` constructs a mixin object that can be merged into the `obj`\nTerraform resource block to set or update the timeouts field.\n\nThis function will replace the map with the passed in `value`. If you wish to instead merge the\npassed in value to the existing map, use the [hcp.obj.withTimeoutsMixin](TODO) function.\n\n**Args**:\n - `resourceLabel` (`string`): The name label of the block to update.\n - `value` (`obj`): The value to set for the `timeouts` field.\n', args=[]), + withTimeouts(resourceLabel, value): { + resource+: { + hcp_packer_run_task+: { + [resourceLabel]+: { + timeouts: value, + }, + }, + }, + }, + '#withTimeoutsMixin':: d.fn(help='`hcp.obj.withTimeoutsMixin` constructs a mixin object that can be merged into the `obj`\nTerraform resource block to set or update the timeouts field.\n\nThis function will merge the passed in value to the existing map. If you wish\nto instead replace the entire map with the passed in `value`, use the [hcp.obj.withTimeouts](TODO)\nfunction.\n\n\n**Args**:\n - `resourceLabel` (`string`): The name label of the block to update.\n - `value` (`obj`): The value to set for the `timeouts` field.\n', args=[]), + withTimeoutsMixin(resourceLabel, value): { + resource+: { + hcp_packer_run_task+: { + [resourceLabel]+: { + timeouts+: value, + }, + }, + }, + }, +} diff --git a/docs/0.x/README.md b/docs/0.x/README.md index 314e7ad..2dbca30 100644 --- a/docs/0.x/README.md +++ b/docs/0.x/README.md @@ -24,6 +24,7 @@ project. * [hvn_route](hvn_route.md) * [packer_channel](packer_channel.md) * [packer_channel_assignment](packer_channel_assignment.md) +* [packer_run_task](packer_run_task.md) * [provider](provider.md) * [vault_cluster](vault_cluster.md) * [vault_cluster_admin_token](vault_cluster_admin_token.md) \ No newline at end of file diff --git a/docs/0.x/data/index.md b/docs/0.x/data/index.md index ee1eab8..44f50f5 100644 --- a/docs/0.x/data/index.md +++ b/docs/0.x/data/index.md @@ -21,5 +21,6 @@ permalink: /data/ * [packer_image](packer_image.md) * [packer_image_iteration](packer_image_iteration.md) * [packer_iteration](packer_iteration.md) +* [packer_run_task](packer_run_task.md) * [vault_cluster](vault_cluster.md) * [vault_secrets_app](vault_secrets_app.md) \ No newline at end of file diff --git a/docs/0.x/data/packer_run_task.md b/docs/0.x/data/packer_run_task.md new file mode 100644 index 0000000..ff01992 --- /dev/null +++ b/docs/0.x/data/packer_run_task.md @@ -0,0 +1,163 @@ +--- +permalink: /data/packer_run_task/ +--- + +# data.packer_run_task + +`packer_run_task` represents the `hcp_packer_run_task` Terraform data source. + +The Packer Run Task data source gets the configuration information needed to set up an HCP Packer Registry's run task. + +This package contains functions and utilities for setting up the data source using Jsonnet code. + + +## Index + +* [`fn new()`](#fn-new) +* [`fn newAttrs()`](#fn-newattrs) +* [`fn withProjectId()`](#fn-withprojectid) +* [`fn withTimeouts()`](#fn-withtimeouts) +* [`fn withTimeoutsMixin()`](#fn-withtimeoutsmixin) +* [`obj timeouts`](#obj-timeouts) + * [`fn new()`](#fn-timeoutsnew) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.data.packer_run_task.new` injects a new `data_hcp_packer_run_task` Terraform `data source` +block into the root module document. + +Additionally, this inserts a private function into the `_ref` attribute that generates references to attributes of the +resource. For example, if you added a new instance to the root using: + + # arguments omitted for brevity + hcp.data.packer_run_task.new('some_id') + +You can get the reference to the `id` field of the created `hcp.data.packer_run_task` using the reference: + + $._ref.data_hcp_packer_run_task.some_id.get('id') + +This is the same as directly entering `"${ data_hcp_packer_run_task.some_id.id }"` as the value. + +NOTE: if you are chaining multiple resources together in a merge operation, you may not be able to use `super`, `self`, +or `$` to refer to the root object. Instead, make an explicit outer object using `local`. + +**Args**: + - `dataSrcLabel` (`string`): The name label of the block. + - `project_id` (`string`): +The ID of the HCP project where the HCP Packer Registry is located. +If not specified, the project specified in the HCP Provider config block will be used, if configured. +If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object. + - `timeouts` (`obj`): Set the `timeouts` field on the resulting data source block. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.data.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor. + +**Returns**: +- A mixin object that injects the new data source into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.data.packer_run_task.newAttrs` constructs a new object with attributes and blocks configured for the `packer_run_task` +Terraform data source. + +Unlike [hcp.data.packer_run_task.new](#fn-new), this function will not inject the `data source` +block into the root Terraform document. Instead, this must be passed in as the `attrs` argument for the +[tf.withData](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withdata) function to build a complete block. + +This is most useful when you need to preprocess the attributes with functions, conditional, or looping logic prior to +injecting into a complete block. + +**Args**: + - `project_id` (`string`): +The ID of the HCP project where the HCP Packer Registry is located. +If not specified, the project specified in the HCP Provider config block will be used, if configured. +If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object. + - `timeouts` (`obj`): Set the `timeouts` field on the resulting object. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.data.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor. + +**Returns**: + - An attribute object that can be used with [tf.withData](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withdata) to construct a new `packer_run_task` data source into the root Terraform configuration. + + +### fn withProjectId + +```ts +withProjectId() +``` + +`hcp.string.withProjectId` constructs a mixin object that can be merged into the `string` +Terraform data source block to set or update the project_id field. + + + +**Args**: + - `dataSrcLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `project_id` field. + + +### fn withTimeouts + +```ts +withTimeouts() +``` + +`hcp.obj.withTimeouts` constructs a mixin object that can be merged into the `obj` +Terraform data source block to set or update the timeouts field. + +This function will replace the map with the passed in `value`. If you wish to instead merge the +passed in value to the existing map, use the [hcp.obj.withTimeoutsMixin](TODO) function. + +**Args**: + - `dataSrcLabel` (`string`): The name label of the block to update. + - `value` (`obj`): The value to set for the `timeouts` field. + + +### fn withTimeoutsMixin + +```ts +withTimeoutsMixin() +``` + +`hcp.obj.withTimeoutsMixin` constructs a mixin object that can be merged into the `obj` +Terraform data source block to set or update the timeouts field. + +This function will merge the passed in value to the existing map. If you wish +to instead replace the entire map with the passed in `value`, use the [hcp.obj.withTimeouts](TODO) +function. + + +**Args**: + - `dataSrcLabel` (`string`): The name label of the block to update. + - `value` (`obj`): The value to set for the `timeouts` field. + + +## obj timeouts + + + +### fn timeouts.new + +```ts +new() +``` + + +`hcp.packer_run_task.timeouts.new` constructs a new object with attributes and blocks configured for the `timeouts` +Terraform sub block. + + + +**Args**: + - `default` (`string`): Set the `default` field on the resulting object. When `null`, the `default` field will be omitted from the resulting object. + +**Returns**: + - An attribute object that represents the `timeouts` sub block. diff --git a/docs/0.x/packer_run_task.md b/docs/0.x/packer_run_task.md new file mode 100644 index 0000000..ac55382 --- /dev/null +++ b/docs/0.x/packer_run_task.md @@ -0,0 +1,188 @@ +--- +permalink: /packer_run_task/ +--- + +# packer_run_task + +`packer_run_task` represents the `hcp_packer_run_task` Terraform resource. + + +The Packer Run Task resource allows you to regenerate the HMAC key for an HCP Packer Registry's run task. + +If you do not need to regenerate the HMAC key, it is recommended to use the `hcp_packer_run_task` data source instead. + +This package contains functions and utilities for setting up the resource using Jsonnet code. + + +## Index + +* [`fn new()`](#fn-new) +* [`fn newAttrs()`](#fn-newattrs) +* [`fn withProjectId()`](#fn-withprojectid) +* [`fn withRegenerateHmac()`](#fn-withregeneratehmac) +* [`fn withTimeouts()`](#fn-withtimeouts) +* [`fn withTimeoutsMixin()`](#fn-withtimeoutsmixin) +* [`obj timeouts`](#obj-timeouts) + * [`fn new()`](#fn-timeoutsnew) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.packer_run_task.new` injects a new `hcp_packer_run_task` Terraform `resource` +block into the root module document. + +Additionally, this inserts a private function into the `_ref` attribute that generates references to attributes of the +resource. For example, if you added a new instance to the root using: + + # arguments omitted for brevity + hcp.packer_run_task.new('some_id') + +You can get the reference to the `id` field of the created `hcp.packer_run_task` using the reference: + + $._ref.hcp_packer_run_task.some_id.get('id') + +This is the same as directly entering `"${ hcp_packer_run_task.some_id.id }"` as the value. + +NOTE: if you are chaining multiple resources together in a merge operation, you may not be able to use `super`, `self`, +or `$` to refer to the root object. Instead, make an explicit outer object using `local`. + +**Args**: + - `resourceLabel` (`string`): The name label of the block. + - `project_id` (`string`): +The ID of the HCP project where the HCP Packer Registry is located. +If not specified, the project specified in the HCP Provider config block will be used, if configured. +If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object. + - `regenerate_hmac` (`bool`): If true, the HMAC Key (`hmac_key`) will be regenerated during `terraform apply`. While set to true, the key will be regenerated on every `terraform apply` until `regenerate_hmac` is set to false or removed from the config. When `null`, the `regenerate_hmac` field will be omitted from the resulting object. + - `timeouts` (`obj`): Set the `timeouts` field on the resulting resource block. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor. + +**Returns**: +- A mixin object that injects the new resource into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.packer_run_task.newAttrs` constructs a new object with attributes and blocks configured for the `packer_run_task` +Terraform resource. + +Unlike [hcp.packer_run_task.new](#fn-new), this function will not inject the `resource` +block into the root Terraform document. Instead, this must be passed in as the `attrs` argument for the +[tf.withResource](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withresource) function to build a complete block. + +This is most useful when you need to preprocess the attributes with functions, conditional, or looping logic prior to +injecting into a complete block. + +**Args**: + - `project_id` (`string`): +The ID of the HCP project where the HCP Packer Registry is located. +If not specified, the project specified in the HCP Provider config block will be used, if configured. +If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. When `null`, the `project_id` field will be omitted from the resulting object. + - `regenerate_hmac` (`bool`): If true, the HMAC Key (`hmac_key`) will be regenerated during `terraform apply`. While set to true, the key will be regenerated on every `terraform apply` until `regenerate_hmac` is set to false or removed from the config. When `null`, the `regenerate_hmac` field will be omitted from the resulting object. + - `timeouts` (`obj`): Set the `timeouts` field on the resulting object. When `null`, the `timeouts` sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the [hcp.packer_run_task.timeouts.new](#fn-timeoutsnew) constructor. + +**Returns**: + - An attribute object that can be used with [tf.withResource](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withresource) to construct a new `packer_run_task` resource into the root Terraform configuration. + + +### fn withProjectId + +```ts +withProjectId() +``` + +`hcp.string.withProjectId` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the project_id field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `project_id` field. + + +### fn withRegenerateHmac + +```ts +withRegenerateHmac() +``` + +`hcp.bool.withRegenerateHmac` constructs a mixin object that can be merged into the `bool` +Terraform resource block to set or update the regenerate_hmac field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`bool`): The value to set for the `regenerate_hmac` field. + + +### fn withTimeouts + +```ts +withTimeouts() +``` + +`hcp.obj.withTimeouts` constructs a mixin object that can be merged into the `obj` +Terraform resource block to set or update the timeouts field. + +This function will replace the map with the passed in `value`. If you wish to instead merge the +passed in value to the existing map, use the [hcp.obj.withTimeoutsMixin](TODO) function. + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`obj`): The value to set for the `timeouts` field. + + +### fn withTimeoutsMixin + +```ts +withTimeoutsMixin() +``` + +`hcp.obj.withTimeoutsMixin` constructs a mixin object that can be merged into the `obj` +Terraform resource block to set or update the timeouts field. + +This function will merge the passed in value to the existing map. If you wish +to instead replace the entire map with the passed in `value`, use the [hcp.obj.withTimeouts](TODO) +function. + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`obj`): The value to set for the `timeouts` field. + + +## obj timeouts + + + +### fn timeouts.new + +```ts +new() +``` + + +`hcp.packer_run_task.timeouts.new` constructs a new object with attributes and blocks configured for the `timeouts` +Terraform sub block. + + + +**Args**: + - `create` (`string`): Set the `create` field on the resulting object. When `null`, the `create` field will be omitted from the resulting object. + - `default` (`string`): Set the `default` field on the resulting object. When `null`, the `default` field will be omitted from the resulting object. + - `delete` (`string`): Set the `delete` field on the resulting object. When `null`, the `delete` field will be omitted from the resulting object. + - `update` (`string`): Set the `update` field on the resulting object. When `null`, the `update` field will be omitted from the resulting object. + +**Returns**: + - An attribute object that represents the `timeouts` sub block.