From d194a252c0558b7ea3ccbd3eed7d4c8303d3890e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 15 Nov 2023 01:47:30 +0000 Subject: [PATCH] Generate libsonnet source from libgenerator PR https://github.com/tf-libsonnet/libgenerator/pull/236 Signed-off-by: tflibsonnet-ci <120686569+tflibsonnet-ci@users.noreply.github.com> --- 0.x/_gen/data/iam_policy.libsonnet | 42 ++++++ 0.x/_gen/data/main.libsonnet | 1 + 0.x/_gen/main.libsonnet | 4 + 0.x/_gen/provider_hcp.libsonnet | 14 +- .../organization_iam_binding.libsonnet | 45 ++++++ .../organization_iam_policy.libsonnet | 32 +++++ .../resources/project_iam_binding.libsonnet | 58 ++++++++ .../resources/project_iam_policy.libsonnet | 45 ++++++ 0.x/_gen/resources/vault_cluster.libsonnet | 16 ++- docs/0.x/README.md | 4 + docs/0.x/data/iam_policy.md | 112 +++++++++++++++ docs/0.x/data/index.md | 1 + docs/0.x/organization_iam_binding.md | 111 +++++++++++++++ docs/0.x/organization_iam_policy.md | 92 +++++++++++++ docs/0.x/project_iam_binding.md | 130 ++++++++++++++++++ docs/0.x/project_iam_policy.md | 111 +++++++++++++++ docs/0.x/provider.md | 2 + docs/0.x/vault_cluster.md | 6 + 18 files changed, 821 insertions(+), 5 deletions(-) create mode 100644 0.x/_gen/data/iam_policy.libsonnet create mode 100644 0.x/_gen/resources/organization_iam_binding.libsonnet create mode 100644 0.x/_gen/resources/organization_iam_policy.libsonnet create mode 100644 0.x/_gen/resources/project_iam_binding.libsonnet create mode 100644 0.x/_gen/resources/project_iam_policy.libsonnet create mode 100644 docs/0.x/data/iam_policy.md create mode 100644 docs/0.x/organization_iam_binding.md create mode 100644 docs/0.x/organization_iam_policy.md create mode 100644 docs/0.x/project_iam_binding.md create mode 100644 docs/0.x/project_iam_policy.md diff --git a/0.x/_gen/data/iam_policy.libsonnet b/0.x/_gen/data/iam_policy.libsonnet new file mode 100644 index 0000000..2de9d65 --- /dev/null +++ b/0.x/_gen/data/iam_policy.libsonnet @@ -0,0 +1,42 @@ +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='iam_policy', url='', help='`iam_policy` represents the `hcp_iam_policy` Terraform data source.\n\nGenerates an IAM policy that may be referenced by and applied to other HCP IAM resources, such as the `hcp_project_iam_policy` resource.\n\nThis package contains functions and utilities for setting up the data source using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.data.iam_policy.new` injects a new `data_hcp_iam_policy` 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.iam_policy.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.data.iam_policy` using the reference:\n\n $._ref.data_hcp_iam_policy.some_id.get('id')\n\nThis is the same as directly entering `\"${ data_hcp_iam_policy.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 - `bindings` (`list[obj]`): A binding associates a set of principals to a role.\n\n**Returns**:\n- A mixin object that injects the new data source into the root Terraform configuration.\n", args=[]), + new( + dataSrcLabel, + bindings, + _meta={} + ):: tf.withData( + type='hcp_iam_policy', + label=dataSrcLabel, + attrs=self.newAttrs(bindings=bindings), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.data.iam_policy.newAttrs` constructs a new object with attributes and blocks configured for the `iam_policy`\nTerraform data source.\n\nUnlike [hcp.data.iam_policy.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 - `bindings` (`list[obj]`): A binding associates a set of principals to a role.\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 `iam_policy` data source into the root Terraform configuration.\n', args=[]), + newAttrs( + bindings + ):: std.prune(a={ + bindings: bindings, + }), + '#withBindings':: d.fn(help='`hcp.list[obj].withBindings` constructs a mixin object that can be merged into the `list[obj]`\nTerraform data source block to set or update the bindings field.\n\n\n\n**Args**:\n - `dataSrcLabel` (`string`): The name label of the block to update.\n - `value` (`list[obj]`): The value to set for the `bindings` field.\n', args=[]), + withBindings(dataSrcLabel, value): { + data+: { + hcp_iam_policy+: { + [dataSrcLabel]+: { + bindings: value, + }, + }, + }, + }, + '#withBindingsMixin':: d.fn(help='`hcp.list[obj].withBindingsMixin` constructs a mixin object that can be merged into the `list[obj]`\nTerraform data source block to set or update the bindings field.\n\nThis function will append the passed in array or object to the existing array. If you wish\nto instead replace the array with the passed in `value`, use the [hcp.list[obj].withBindings](TODO)\nfunction.\n\n\n**Args**:\n - `dataSrcLabel` (`string`): The name label of the block to update.\n - `value` (`list[obj]`): The value to set for the `bindings` field.\n', args=[]), + withBindingsMixin(dataSrcLabel, value):: { + data+: { + hcp_iam_policy+: { + [dataSrcLabel]+: { + bindings+: if std.isArray(v=value) then value else [value], + }, + }, + }, + }, +} diff --git a/0.x/_gen/data/main.libsonnet b/0.x/_gen/data/main.libsonnet index 2042735..716493a 100644 --- a/0.x/_gen/data/main.libsonnet +++ b/0.x/_gen/data/main.libsonnet @@ -12,6 +12,7 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); hvn: (import 'hvn.libsonnet'), hvn_peering_connection: (import 'hvn_peering_connection.libsonnet'), hvn_route: (import 'hvn_route.libsonnet'), + iam_policy: (import 'iam_policy.libsonnet'), organization: (import 'organization.libsonnet'), packer_bucket_names: (import 'packer_bucket_names.libsonnet'), packer_image: (import 'packer_image.libsonnet'), diff --git a/0.x/_gen/main.libsonnet b/0.x/_gen/main.libsonnet index 516c930..7777b0a 100644 --- a/0.x/_gen/main.libsonnet +++ b/0.x/_gen/main.libsonnet @@ -13,10 +13,14 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); hvn_peering_connection: (import 'resources/hvn_peering_connection.libsonnet'), hvn_route: (import 'resources/hvn_route.libsonnet'), iam_workload_identity_provider: (import 'resources/iam_workload_identity_provider.libsonnet'), + organization_iam_binding: (import 'resources/organization_iam_binding.libsonnet'), + organization_iam_policy: (import 'resources/organization_iam_policy.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'), project: (import 'resources/project.libsonnet'), + project_iam_binding: (import 'resources/project_iam_binding.libsonnet'), + project_iam_policy: (import 'resources/project_iam_policy.libsonnet'), service_principal: (import 'resources/service_principal.libsonnet'), service_principal_key: (import 'resources/service_principal_key.libsonnet'), vault_cluster: (import 'resources/vault_cluster.libsonnet'), diff --git a/0.x/_gen/provider_hcp.libsonnet b/0.x/_gen/provider_hcp.libsonnet index 63f349e..5785d67 100644 --- a/0.x/_gen/provider_hcp.libsonnet +++ b/0.x/_gen/provider_hcp.libsonnet @@ -2,10 +2,11 @@ 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='provider', url='', help='`provider` represents the `hcp` Terraform provider config.\n\n\n\nThis package contains functions and utilities for setting up the provider using Jsonnet code.\n'), - '#new':: d.fn(help='\n`hcp.provider.new` injects a new `hcp` Terraform `provider`\nblock into the root module document.\n\nOptionally, this inserts the provider into the\n[required_providers](https://developer.hashicorp.com/terraform/language/providers/requirements) `terraform` sub block if\nthe `src` and/or `version` parameters are set.\n\n**Args**:\n - `client_id` (`string`): The OAuth2 Client ID for API operations. When `null`, the `client_id` field will be omitted from the resulting object.\n - `client_secret` (`string`): The OAuth2 Client Secret for API operations. When `null`, the `client_secret` field will be omitted from the resulting object.\n - `project_id` (`string`): The default project in which resources should be created. When `null`, the `project_id` field will be omitted from the resulting object.\n - `alias` (`string`): The provider `alias` to set for this instance of the provider block. When `null`, the `alias`\n field will be omitted from the resulting provider block.\n - `src` (`string`): The provider `source` to set on the resulting `required_providers` block. If `src` or `version` is\n set and is not `null`, a `required_providers` block and entry for the provider will be injected into the document.\n - `version` (`string`): The provider `version` to set on the resulting `required_providers` block. If `src` or\n `version` is set and is not `null`, a `required_providers` block and entry for the provider will be injected into the\n document.\n\n\n**Returns**:\n- A mixin object that injects the new provider (and optionally, `required_providers` block) into the root Terraform configuration.\n', args=[]), + '#new':: d.fn(help='\n`hcp.provider.new` injects a new `hcp` Terraform `provider`\nblock into the root module document.\n\nOptionally, this inserts the provider into the\n[required_providers](https://developer.hashicorp.com/terraform/language/providers/requirements) `terraform` sub block if\nthe `src` and/or `version` parameters are set.\n\n**Args**:\n - `client_id` (`string`): The OAuth2 Client ID for API operations. When `null`, the `client_id` field will be omitted from the resulting object.\n - `client_secret` (`string`): The OAuth2 Client Secret for API operations. When `null`, the `client_secret` field will be omitted from the resulting object.\n - `credential_file` (`string`): The path to an HCP credential file to use to authenticate the provider to HCP. You can alternatively set the HCP_CRED_FILE environment variable to point at a credential file as well. Using a credential file allows you to authenticate the provider as a service principal via client credentials or dynamically based on Workload Identity Federation. When `null`, the `credential_file` field will be omitted from the resulting object.\n - `project_id` (`string`): The default project in which resources should be created. When `null`, the `project_id` field will be omitted from the resulting object.\n - `alias` (`string`): The provider `alias` to set for this instance of the provider block. When `null`, the `alias`\n field will be omitted from the resulting provider block.\n - `src` (`string`): The provider `source` to set on the resulting `required_providers` block. If `src` or `version` is\n set and is not `null`, a `required_providers` block and entry for the provider will be injected into the document.\n - `version` (`string`): The provider `version` to set on the resulting `required_providers` block. If `src` or\n `version` is set and is not `null`, a `required_providers` block and entry for the provider will be injected into the\n document.\n\n\n**Returns**:\n- A mixin object that injects the new provider (and optionally, `required_providers` block) into the root Terraform configuration.\n', args=[]), new( client_id=null, client_secret=null, + credential_file=null, project_id=null, alias=null, src=null, @@ -15,16 +16,23 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); alias=alias, src=src, version=version, - attrs=self.newAttrs(client_id=client_id, client_secret=client_secret, project_id=project_id) + attrs=self.newAttrs( + client_id=client_id, + client_secret=client_secret, + credential_file=credential_file, + project_id=project_id + ) ), - '#newAttrs':: d.fn(help='\n`hcp.provider.` constructs a new object with attributes and blocks configured for the `hcp`\nTerraform `provider`.\n\nUnlike [hcp.provider.new](#fn-hcpnew), this function will not inject the `provider`\nblock into the root Terraform document. Instead, this must be passed in as the `attrs` argument for the\n[tf.withProvider](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withprovider) 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 - `client_id` (`string`): The OAuth2 Client ID for API operations. When `null`, the `client_id` field will be omitted from the resulting object.\n - `client_secret` (`string`): The OAuth2 Client Secret for API operations. When `null`, the `client_secret` field will be omitted from the resulting object.\n - `project_id` (`string`): The default project in which resources should be created. When `null`, the `project_id` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that can be used with [tf.withProvider](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withprovider) to construct a new `hcp` provider\n configuration into the root Terraform configuration.\n', args=[]), + '#newAttrs':: d.fn(help='\n`hcp.provider.` constructs a new object with attributes and blocks configured for the `hcp`\nTerraform `provider`.\n\nUnlike [hcp.provider.new](#fn-hcpnew), this function will not inject the `provider`\nblock into the root Terraform document. Instead, this must be passed in as the `attrs` argument for the\n[tf.withProvider](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withprovider) 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 - `client_id` (`string`): The OAuth2 Client ID for API operations. When `null`, the `client_id` field will be omitted from the resulting object.\n - `client_secret` (`string`): The OAuth2 Client Secret for API operations. When `null`, the `client_secret` field will be omitted from the resulting object.\n - `credential_file` (`string`): The path to an HCP credential file to use to authenticate the provider to HCP. You can alternatively set the HCP_CRED_FILE environment variable to point at a credential file as well. Using a credential file allows you to authenticate the provider as a service principal via client credentials or dynamically based on Workload Identity Federation. When `null`, the `credential_file` field will be omitted from the resulting object.\n - `project_id` (`string`): The default project in which resources should be created. When `null`, the `project_id` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that can be used with [tf.withProvider](https://github.com/tf-libsonnet/core/tree/main/docs#fn-withprovider) to construct a new `hcp` provider\n configuration into the root Terraform configuration.\n', args=[]), newAttrs( client_id=null, client_secret=null, + credential_file=null, project_id=null ):: std.prune(a={ client_id: client_id, client_secret: client_secret, + credential_file: credential_file, project_id: project_id, }), } diff --git a/0.x/_gen/resources/organization_iam_binding.libsonnet b/0.x/_gen/resources/organization_iam_binding.libsonnet new file mode 100644 index 0000000..0616e14 --- /dev/null +++ b/0.x/_gen/resources/organization_iam_binding.libsonnet @@ -0,0 +1,45 @@ +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='organization_iam_binding', url='', help='`organization_iam_binding` represents the `hcp_organization_iam_binding` Terraform resource.\n\nUpdates the organization's IAM policy to bind a role to a new member. Existing bindings are preserved.\n\nThis package contains functions and utilities for setting up the resource using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.organization_iam_binding.new` injects a new `hcp_organization_iam_binding` 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.organization_iam_binding.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.organization_iam_binding` using the reference:\n\n $._ref.hcp_organization_iam_binding.some_id.get('id')\n\nThis is the same as directly entering `\"${ hcp_organization_iam_binding.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 - `principal_id` (`string`): The principal to bind to the given role.\n - `role` (`string`): The role name to bind to the given principal.\n\n**Returns**:\n- A mixin object that injects the new resource into the root Terraform configuration.\n", args=[]), + new( + resourceLabel, + principal_id, + role, + _meta={} + ):: tf.withResource( + type='hcp_organization_iam_binding', + label=resourceLabel, + attrs=self.newAttrs(principal_id=principal_id, role=role), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.organization_iam_binding.newAttrs` constructs a new object with attributes and blocks configured for the `organization_iam_binding`\nTerraform resource.\n\nUnlike [hcp.organization_iam_binding.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 - `principal_id` (`string`): The principal to bind to the given role.\n - `role` (`string`): The role name to bind to the given principal.\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 `organization_iam_binding` resource into the root Terraform configuration.\n', args=[]), + newAttrs( + principal_id, + role + ):: std.prune(a={ + principal_id: principal_id, + role: role, + }), + '#withPrincipalId':: d.fn(help='`hcp.string.withPrincipalId` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the principal_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 `principal_id` field.\n', args=[]), + withPrincipalId(resourceLabel, value): { + resource+: { + hcp_organization_iam_binding+: { + [resourceLabel]+: { + principal_id: value, + }, + }, + }, + }, + '#withRole':: d.fn(help='`hcp.string.withRole` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the role 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 `role` field.\n', args=[]), + withRole(resourceLabel, value): { + resource+: { + hcp_organization_iam_binding+: { + [resourceLabel]+: { + role: value, + }, + }, + }, + }, +} diff --git a/0.x/_gen/resources/organization_iam_policy.libsonnet b/0.x/_gen/resources/organization_iam_policy.libsonnet new file mode 100644 index 0000000..bc9c7c8 --- /dev/null +++ b/0.x/_gen/resources/organization_iam_policy.libsonnet @@ -0,0 +1,32 @@ +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='organization_iam_policy', url='', help='`organization_iam_policy` represents the `hcp_organization_iam_policy` Terraform resource.\n\nSets the organization's IAM policy and replaces any existing policy.\n\nThis package contains functions and utilities for setting up the resource using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.organization_iam_policy.new` injects a new `hcp_organization_iam_policy` 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.organization_iam_policy.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.organization_iam_policy` using the reference:\n\n $._ref.hcp_organization_iam_policy.some_id.get('id')\n\nThis is the same as directly entering `\"${ hcp_organization_iam_policy.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 - `policy_data` (`string`): The policy to apply.\n\n**Returns**:\n- A mixin object that injects the new resource into the root Terraform configuration.\n", args=[]), + new( + resourceLabel, + policy_data, + _meta={} + ):: tf.withResource( + type='hcp_organization_iam_policy', + label=resourceLabel, + attrs=self.newAttrs(policy_data=policy_data), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.organization_iam_policy.newAttrs` constructs a new object with attributes and blocks configured for the `organization_iam_policy`\nTerraform resource.\n\nUnlike [hcp.organization_iam_policy.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 - `policy_data` (`string`): The policy to apply.\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 `organization_iam_policy` resource into the root Terraform configuration.\n', args=[]), + newAttrs( + policy_data + ):: std.prune(a={ + policy_data: policy_data, + }), + '#withPolicyData':: d.fn(help='`hcp.string.withPolicyData` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the policy_data 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 `policy_data` field.\n', args=[]), + withPolicyData(resourceLabel, value): { + resource+: { + hcp_organization_iam_policy+: { + [resourceLabel]+: { + policy_data: value, + }, + }, + }, + }, +} diff --git a/0.x/_gen/resources/project_iam_binding.libsonnet b/0.x/_gen/resources/project_iam_binding.libsonnet new file mode 100644 index 0000000..9fba005 --- /dev/null +++ b/0.x/_gen/resources/project_iam_binding.libsonnet @@ -0,0 +1,58 @@ +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='project_iam_binding', url='', help='`project_iam_binding` represents the `hcp_project_iam_binding` Terraform resource.\n\nUpdates the project's IAM policy to bind a role to a new member. Existing bindings are preserved.\n\nThis package contains functions and utilities for setting up the resource using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.project_iam_binding.new` injects a new `hcp_project_iam_binding` 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.project_iam_binding.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.project_iam_binding` using the reference:\n\n $._ref.hcp_project_iam_binding.some_id.get('id')\n\nThis is the same as directly entering `\"${ hcp_project_iam_binding.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 - `principal_id` (`string`): The principal to bind to the given role.\n - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object.\n - `role` (`string`): The role name to bind to the given principal.\n\n**Returns**:\n- A mixin object that injects the new resource into the root Terraform configuration.\n", args=[]), + new( + resourceLabel, + principal_id, + role, + project_id=null, + _meta={} + ):: tf.withResource( + type='hcp_project_iam_binding', + label=resourceLabel, + attrs=self.newAttrs(principal_id=principal_id, project_id=project_id, role=role), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.project_iam_binding.newAttrs` constructs a new object with attributes and blocks configured for the `project_iam_binding`\nTerraform resource.\n\nUnlike [hcp.project_iam_binding.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 - `principal_id` (`string`): The principal to bind to the given role.\n - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object.\n - `role` (`string`): The role name to bind to the given principal.\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 `project_iam_binding` resource into the root Terraform configuration.\n', args=[]), + newAttrs( + principal_id, + role, + project_id=null + ):: std.prune(a={ + principal_id: principal_id, + project_id: project_id, + role: role, + }), + '#withPrincipalId':: d.fn(help='`hcp.string.withPrincipalId` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the principal_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 `principal_id` field.\n', args=[]), + withPrincipalId(resourceLabel, value): { + resource+: { + hcp_project_iam_binding+: { + [resourceLabel]+: { + principal_id: value, + }, + }, + }, + }, + '#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_project_iam_binding+: { + [resourceLabel]+: { + project_id: value, + }, + }, + }, + }, + '#withRole':: d.fn(help='`hcp.string.withRole` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the role 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 `role` field.\n', args=[]), + withRole(resourceLabel, value): { + resource+: { + hcp_project_iam_binding+: { + [resourceLabel]+: { + role: value, + }, + }, + }, + }, +} diff --git a/0.x/_gen/resources/project_iam_policy.libsonnet b/0.x/_gen/resources/project_iam_policy.libsonnet new file mode 100644 index 0000000..85ec7ed --- /dev/null +++ b/0.x/_gen/resources/project_iam_policy.libsonnet @@ -0,0 +1,45 @@ +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='project_iam_policy', url='', help='`project_iam_policy` represents the `hcp_project_iam_policy` Terraform resource.\n\nSets the project's IAM policy and replaces any existing policy.\n\nThis package contains functions and utilities for setting up the resource using Jsonnet code.\n'), + '#new':: d.fn(help="\n`hcp.project_iam_policy.new` injects a new `hcp_project_iam_policy` 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.project_iam_policy.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.project_iam_policy` using the reference:\n\n $._ref.hcp_project_iam_policy.some_id.get('id')\n\nThis is the same as directly entering `\"${ hcp_project_iam_policy.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 - `policy_data` (`string`): The policy to apply.\n - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object.\n\n**Returns**:\n- A mixin object that injects the new resource into the root Terraform configuration.\n", args=[]), + new( + resourceLabel, + policy_data, + project_id=null, + _meta={} + ):: tf.withResource( + type='hcp_project_iam_policy', + label=resourceLabel, + attrs=self.newAttrs(policy_data=policy_data, project_id=project_id), + _meta=_meta + ), + '#newAttrs':: d.fn(help='\n`hcp.project_iam_policy.newAttrs` constructs a new object with attributes and blocks configured for the `project_iam_policy`\nTerraform resource.\n\nUnlike [hcp.project_iam_policy.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 - `policy_data` (`string`): The policy to apply.\n - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object.\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 `project_iam_policy` resource into the root Terraform configuration.\n', args=[]), + newAttrs( + policy_data, + project_id=null + ):: std.prune(a={ + policy_data: policy_data, + project_id: project_id, + }), + '#withPolicyData':: d.fn(help='`hcp.string.withPolicyData` constructs a mixin object that can be merged into the `string`\nTerraform resource block to set or update the policy_data 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 `policy_data` field.\n', args=[]), + withPolicyData(resourceLabel, value): { + resource+: { + hcp_project_iam_policy+: { + [resourceLabel]+: { + policy_data: value, + }, + }, + }, + }, + '#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_project_iam_policy+: { + [resourceLabel]+: { + project_id: value, + }, + }, + }, + }, +} diff --git a/0.x/_gen/resources/vault_cluster.libsonnet b/0.x/_gen/resources/vault_cluster.libsonnet index 5235cea..b1e9ab1 100644 --- a/0.x/_gen/resources/vault_cluster.libsonnet +++ b/0.x/_gen/resources/vault_cluster.libsonnet @@ -3,7 +3,7 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); { '#':: d.pkg(name='vault_cluster', url='', help='`vault_cluster` represents the `hcp_vault_cluster` Terraform resource.\n\nThe Vault cluster resource allows you to manage an HCP Vault cluster.\n\nThis package contains functions and utilities for setting up the resource using Jsonnet code.\n'), audit_log_config:: { - '#new':: d.fn(help='\n`hcp.vault_cluster.audit_log_config.new` constructs a new object with attributes and blocks configured for the `audit_log_config`\nTerraform sub block.\n\n\n\n**Args**:\n - `cloudwatch_access_key_id` (`string`): CloudWatch access key ID for streaming audit logs When `null`, the `cloudwatch_access_key_id` field will be omitted from the resulting object.\n - `cloudwatch_region` (`string`): CloudWatch region for streaming audit logs When `null`, the `cloudwatch_region` field will be omitted from the resulting object.\n - `cloudwatch_secret_access_key` (`string`): CloudWatch secret access key for streaming audit logs When `null`, the `cloudwatch_secret_access_key` field will be omitted from the resulting object.\n - `datadog_api_key` (`string`): Datadog api key for streaming audit logs When `null`, the `datadog_api_key` field will be omitted from the resulting object.\n - `datadog_region` (`string`): Datadog region for streaming audit logs When `null`, the `datadog_region` field will be omitted from the resulting object.\n - `elasticsearch_endpoint` (`string`): ElasticSearch endpoint for streaming audit logs When `null`, the `elasticsearch_endpoint` field will be omitted from the resulting object.\n - `elasticsearch_password` (`string`): ElasticSearch password for streaming audit logs When `null`, the `elasticsearch_password` field will be omitted from the resulting object.\n - `elasticsearch_user` (`string`): ElasticSearch user for streaming audit logs When `null`, the `elasticsearch_user` field will be omitted from the resulting object.\n - `grafana_endpoint` (`string`): Grafana endpoint for streaming audit logs When `null`, the `grafana_endpoint` field will be omitted from the resulting object.\n - `grafana_password` (`string`): Grafana password for streaming audit logs When `null`, the `grafana_password` field will be omitted from the resulting object.\n - `grafana_user` (`string`): Grafana user for streaming audit logs When `null`, the `grafana_user` field will be omitted from the resulting object.\n - `splunk_hecendpoint` (`string`): Splunk endpoint for streaming audit logs When `null`, the `splunk_hecendpoint` field will be omitted from the resulting object.\n - `splunk_token` (`string`): Splunk token for streaming audit logs When `null`, the `splunk_token` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that represents the `audit_log_config` sub block.\n', args=[]), + '#new':: d.fn(help='\n`hcp.vault_cluster.audit_log_config.new` constructs a new object with attributes and blocks configured for the `audit_log_config`\nTerraform sub block.\n\n\n\n**Args**:\n - `cloudwatch_access_key_id` (`string`): CloudWatch access key ID for streaming audit logs When `null`, the `cloudwatch_access_key_id` field will be omitted from the resulting object.\n - `cloudwatch_region` (`string`): CloudWatch region for streaming audit logs When `null`, the `cloudwatch_region` field will be omitted from the resulting object.\n - `cloudwatch_secret_access_key` (`string`): CloudWatch secret access key for streaming audit logs When `null`, the `cloudwatch_secret_access_key` field will be omitted from the resulting object.\n - `datadog_api_key` (`string`): Datadog api key for streaming audit logs When `null`, the `datadog_api_key` field will be omitted from the resulting object.\n - `datadog_region` (`string`): Datadog region for streaming audit logs When `null`, the `datadog_region` field will be omitted from the resulting object.\n - `elasticsearch_endpoint` (`string`): ElasticSearch endpoint for streaming audit logs When `null`, the `elasticsearch_endpoint` field will be omitted from the resulting object.\n - `elasticsearch_password` (`string`): ElasticSearch password for streaming audit logs When `null`, the `elasticsearch_password` field will be omitted from the resulting object.\n - `elasticsearch_user` (`string`): ElasticSearch user for streaming audit logs When `null`, the `elasticsearch_user` field will be omitted from the resulting object.\n - `grafana_endpoint` (`string`): Grafana endpoint for streaming audit logs When `null`, the `grafana_endpoint` field will be omitted from the resulting object.\n - `grafana_password` (`string`): Grafana password for streaming audit logs When `null`, the `grafana_password` field will be omitted from the resulting object.\n - `grafana_user` (`string`): Grafana user for streaming audit logs When `null`, the `grafana_user` field will be omitted from the resulting object.\n - `newrelic_account_id` (`string`): NewRelic Account ID for streaming audit logs When `null`, the `newrelic_account_id` field will be omitted from the resulting object.\n - `newrelic_license_key` (`string`): NewRelic license key for streaming audit logs When `null`, the `newrelic_license_key` field will be omitted from the resulting object.\n - `newrelic_region` (`string`): NewRelic region for streaming audit logs, allowed values are "US" and "EU" When `null`, the `newrelic_region` field will be omitted from the resulting object.\n - `splunk_hecendpoint` (`string`): Splunk endpoint for streaming audit logs When `null`, the `splunk_hecendpoint` field will be omitted from the resulting object.\n - `splunk_token` (`string`): Splunk token for streaming audit logs When `null`, the `splunk_token` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that represents the `audit_log_config` sub block.\n', args=[]), new( cloudwatch_access_key_id=null, cloudwatch_region=null, @@ -16,6 +16,9 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); grafana_endpoint=null, grafana_password=null, grafana_user=null, + newrelic_account_id=null, + newrelic_license_key=null, + newrelic_region=null, splunk_hecendpoint=null, splunk_token=null ):: std.prune(a={ @@ -30,6 +33,9 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); grafana_endpoint: grafana_endpoint, grafana_password: grafana_password, grafana_user: grafana_user, + newrelic_account_id: newrelic_account_id, + newrelic_license_key: newrelic_license_key, + newrelic_region: newrelic_region, splunk_hecendpoint: splunk_hecendpoint, splunk_token: splunk_token, }), @@ -47,7 +53,7 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); }), }, metrics_config:: { - '#new':: d.fn(help='\n`hcp.vault_cluster.metrics_config.new` constructs a new object with attributes and blocks configured for the `metrics_config`\nTerraform sub block.\n\n\n\n**Args**:\n - `cloudwatch_access_key_id` (`string`): CloudWatch access key ID for streaming metrics When `null`, the `cloudwatch_access_key_id` field will be omitted from the resulting object.\n - `cloudwatch_region` (`string`): CloudWatch region for streaming metrics When `null`, the `cloudwatch_region` field will be omitted from the resulting object.\n - `cloudwatch_secret_access_key` (`string`): CloudWatch secret access key for streaming metrics When `null`, the `cloudwatch_secret_access_key` field will be omitted from the resulting object.\n - `datadog_api_key` (`string`): Datadog api key for streaming metrics When `null`, the `datadog_api_key` field will be omitted from the resulting object.\n - `datadog_region` (`string`): Datadog region for streaming metrics When `null`, the `datadog_region` field will be omitted from the resulting object.\n - `elasticsearch_endpoint` (`string`): ElasticSearch endpoint for streaming metrics When `null`, the `elasticsearch_endpoint` field will be omitted from the resulting object.\n - `elasticsearch_password` (`string`): ElasticSearch password for streaming metrics When `null`, the `elasticsearch_password` field will be omitted from the resulting object.\n - `elasticsearch_user` (`string`): ElasticSearch user for streaming metrics When `null`, the `elasticsearch_user` field will be omitted from the resulting object.\n - `grafana_endpoint` (`string`): Grafana endpoint for streaming metrics When `null`, the `grafana_endpoint` field will be omitted from the resulting object.\n - `grafana_password` (`string`): Grafana password for streaming metrics When `null`, the `grafana_password` field will be omitted from the resulting object.\n - `grafana_user` (`string`): Grafana user for streaming metrics When `null`, the `grafana_user` field will be omitted from the resulting object.\n - `splunk_hecendpoint` (`string`): Splunk endpoint for streaming metrics When `null`, the `splunk_hecendpoint` field will be omitted from the resulting object.\n - `splunk_token` (`string`): Splunk token for streaming metrics When `null`, the `splunk_token` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that represents the `metrics_config` sub block.\n', args=[]), + '#new':: d.fn(help='\n`hcp.vault_cluster.metrics_config.new` constructs a new object with attributes and blocks configured for the `metrics_config`\nTerraform sub block.\n\n\n\n**Args**:\n - `cloudwatch_access_key_id` (`string`): CloudWatch access key ID for streaming metrics When `null`, the `cloudwatch_access_key_id` field will be omitted from the resulting object.\n - `cloudwatch_region` (`string`): CloudWatch region for streaming metrics When `null`, the `cloudwatch_region` field will be omitted from the resulting object.\n - `cloudwatch_secret_access_key` (`string`): CloudWatch secret access key for streaming metrics When `null`, the `cloudwatch_secret_access_key` field will be omitted from the resulting object.\n - `datadog_api_key` (`string`): Datadog api key for streaming metrics When `null`, the `datadog_api_key` field will be omitted from the resulting object.\n - `datadog_region` (`string`): Datadog region for streaming metrics When `null`, the `datadog_region` field will be omitted from the resulting object.\n - `elasticsearch_endpoint` (`string`): ElasticSearch endpoint for streaming metrics When `null`, the `elasticsearch_endpoint` field will be omitted from the resulting object.\n - `elasticsearch_password` (`string`): ElasticSearch password for streaming metrics When `null`, the `elasticsearch_password` field will be omitted from the resulting object.\n - `elasticsearch_user` (`string`): ElasticSearch user for streaming metrics When `null`, the `elasticsearch_user` field will be omitted from the resulting object.\n - `grafana_endpoint` (`string`): Grafana endpoint for streaming metrics When `null`, the `grafana_endpoint` field will be omitted from the resulting object.\n - `grafana_password` (`string`): Grafana password for streaming metrics When `null`, the `grafana_password` field will be omitted from the resulting object.\n - `grafana_user` (`string`): Grafana user for streaming metrics When `null`, the `grafana_user` field will be omitted from the resulting object.\n - `newrelic_account_id` (`string`): NewRelic Account ID for streaming metrics When `null`, the `newrelic_account_id` field will be omitted from the resulting object.\n - `newrelic_license_key` (`string`): NewRelic license key for streaming metrics When `null`, the `newrelic_license_key` field will be omitted from the resulting object.\n - `newrelic_region` (`string`): NewRelic region for streaming metrics, allowed values are "US" and "EU" When `null`, the `newrelic_region` field will be omitted from the resulting object.\n - `splunk_hecendpoint` (`string`): Splunk endpoint for streaming metrics When `null`, the `splunk_hecendpoint` field will be omitted from the resulting object.\n - `splunk_token` (`string`): Splunk token for streaming metrics When `null`, the `splunk_token` field will be omitted from the resulting object.\n\n**Returns**:\n - An attribute object that represents the `metrics_config` sub block.\n', args=[]), new( cloudwatch_access_key_id=null, cloudwatch_region=null, @@ -60,6 +66,9 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); grafana_endpoint=null, grafana_password=null, grafana_user=null, + newrelic_account_id=null, + newrelic_license_key=null, + newrelic_region=null, splunk_hecendpoint=null, splunk_token=null ):: std.prune(a={ @@ -74,6 +83,9 @@ local d = (import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet'); grafana_endpoint: grafana_endpoint, grafana_password: grafana_password, grafana_user: grafana_user, + newrelic_account_id: newrelic_account_id, + newrelic_license_key: newrelic_license_key, + newrelic_region: newrelic_region, splunk_hecendpoint: splunk_hecendpoint, splunk_token: splunk_token, }), diff --git a/docs/0.x/README.md b/docs/0.x/README.md index 4defbc0..64e8c36 100644 --- a/docs/0.x/README.md +++ b/docs/0.x/README.md @@ -23,10 +23,14 @@ project. * [hvn_peering_connection](hvn_peering_connection.md) * [hvn_route](hvn_route.md) * [iam_workload_identity_provider](iam_workload_identity_provider.md) +* [organization_iam_binding](organization_iam_binding.md) +* [organization_iam_policy](organization_iam_policy.md) * [packer_channel](packer_channel.md) * [packer_channel_assignment](packer_channel_assignment.md) * [packer_run_task](packer_run_task.md) * [project](project.md) +* [project_iam_binding](project_iam_binding.md) +* [project_iam_policy](project_iam_policy.md) * [provider](provider.md) * [service_principal](service_principal.md) * [service_principal_key](service_principal_key.md) diff --git a/docs/0.x/data/iam_policy.md b/docs/0.x/data/iam_policy.md new file mode 100644 index 0000000..2c48be1 --- /dev/null +++ b/docs/0.x/data/iam_policy.md @@ -0,0 +1,112 @@ +--- +permalink: /data/iam_policy/ +--- + +# data.iam_policy + +`iam_policy` represents the `hcp_iam_policy` Terraform data source. + +Generates an IAM policy that may be referenced by and applied to other HCP IAM resources, such as the `hcp_project_iam_policy` resource. + +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 withBindings()`](#fn-withbindings) +* [`fn withBindingsMixin()`](#fn-withbindingsmixin) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.data.iam_policy.new` injects a new `data_hcp_iam_policy` 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.iam_policy.new('some_id') + +You can get the reference to the `id` field of the created `hcp.data.iam_policy` using the reference: + + $._ref.data_hcp_iam_policy.some_id.get('id') + +This is the same as directly entering `"${ data_hcp_iam_policy.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. + - `bindings` (`list[obj]`): A binding associates a set of principals to a role. + +**Returns**: +- A mixin object that injects the new data source into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.data.iam_policy.newAttrs` constructs a new object with attributes and blocks configured for the `iam_policy` +Terraform data source. + +Unlike [hcp.data.iam_policy.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**: + - `bindings` (`list[obj]`): A binding associates a set of principals to a role. + +**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 `iam_policy` data source into the root Terraform configuration. + + +### fn withBindings + +```ts +withBindings() +``` + +`hcp.list[obj].withBindings` constructs a mixin object that can be merged into the `list[obj]` +Terraform data source block to set or update the bindings field. + + + +**Args**: + - `dataSrcLabel` (`string`): The name label of the block to update. + - `value` (`list[obj]`): The value to set for the `bindings` field. + + +### fn withBindingsMixin + +```ts +withBindingsMixin() +``` + +`hcp.list[obj].withBindingsMixin` constructs a mixin object that can be merged into the `list[obj]` +Terraform data source block to set or update the bindings field. + +This function will append the passed in array or object to the existing array. If you wish +to instead replace the array with the passed in `value`, use the [hcp.list[obj].withBindings](TODO) +function. + + +**Args**: + - `dataSrcLabel` (`string`): The name label of the block to update. + - `value` (`list[obj]`): The value to set for the `bindings` field. diff --git a/docs/0.x/data/index.md b/docs/0.x/data/index.md index 8e5161d..6a9736c 100644 --- a/docs/0.x/data/index.md +++ b/docs/0.x/data/index.md @@ -17,6 +17,7 @@ permalink: /data/ * [hvn](hvn.md) * [hvn_peering_connection](hvn_peering_connection.md) * [hvn_route](hvn_route.md) +* [iam_policy](iam_policy.md) * [organization](organization.md) * [packer_bucket_names](packer_bucket_names.md) * [packer_image](packer_image.md) diff --git a/docs/0.x/organization_iam_binding.md b/docs/0.x/organization_iam_binding.md new file mode 100644 index 0000000..7974fe6 --- /dev/null +++ b/docs/0.x/organization_iam_binding.md @@ -0,0 +1,111 @@ +--- +permalink: /organization_iam_binding/ +--- + +# organization_iam_binding + +`organization_iam_binding` represents the `hcp_organization_iam_binding` Terraform resource. + +Updates the organization's IAM policy to bind a role to a new member. Existing bindings are preserved. + +This package contains functions and utilities for setting up the resource using Jsonnet code. + + +## Index + +* [`fn new()`](#fn-new) +* [`fn newAttrs()`](#fn-newattrs) +* [`fn withPrincipalId()`](#fn-withprincipalid) +* [`fn withRole()`](#fn-withrole) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.organization_iam_binding.new` injects a new `hcp_organization_iam_binding` 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.organization_iam_binding.new('some_id') + +You can get the reference to the `id` field of the created `hcp.organization_iam_binding` using the reference: + + $._ref.hcp_organization_iam_binding.some_id.get('id') + +This is the same as directly entering `"${ hcp_organization_iam_binding.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. + - `principal_id` (`string`): The principal to bind to the given role. + - `role` (`string`): The role name to bind to the given principal. + +**Returns**: +- A mixin object that injects the new resource into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.organization_iam_binding.newAttrs` constructs a new object with attributes and blocks configured for the `organization_iam_binding` +Terraform resource. + +Unlike [hcp.organization_iam_binding.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**: + - `principal_id` (`string`): The principal to bind to the given role. + - `role` (`string`): The role name to bind to the given principal. + +**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 `organization_iam_binding` resource into the root Terraform configuration. + + +### fn withPrincipalId + +```ts +withPrincipalId() +``` + +`hcp.string.withPrincipalId` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the principal_id field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `principal_id` field. + + +### fn withRole + +```ts +withRole() +``` + +`hcp.string.withRole` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the role field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `role` field. diff --git a/docs/0.x/organization_iam_policy.md b/docs/0.x/organization_iam_policy.md new file mode 100644 index 0000000..d42bac3 --- /dev/null +++ b/docs/0.x/organization_iam_policy.md @@ -0,0 +1,92 @@ +--- +permalink: /organization_iam_policy/ +--- + +# organization_iam_policy + +`organization_iam_policy` represents the `hcp_organization_iam_policy` Terraform resource. + +Sets the organization's IAM policy and replaces any existing policy. + +This package contains functions and utilities for setting up the resource using Jsonnet code. + + +## Index + +* [`fn new()`](#fn-new) +* [`fn newAttrs()`](#fn-newattrs) +* [`fn withPolicyData()`](#fn-withpolicydata) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.organization_iam_policy.new` injects a new `hcp_organization_iam_policy` 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.organization_iam_policy.new('some_id') + +You can get the reference to the `id` field of the created `hcp.organization_iam_policy` using the reference: + + $._ref.hcp_organization_iam_policy.some_id.get('id') + +This is the same as directly entering `"${ hcp_organization_iam_policy.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. + - `policy_data` (`string`): The policy to apply. + +**Returns**: +- A mixin object that injects the new resource into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.organization_iam_policy.newAttrs` constructs a new object with attributes and blocks configured for the `organization_iam_policy` +Terraform resource. + +Unlike [hcp.organization_iam_policy.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**: + - `policy_data` (`string`): The policy to apply. + +**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 `organization_iam_policy` resource into the root Terraform configuration. + + +### fn withPolicyData + +```ts +withPolicyData() +``` + +`hcp.string.withPolicyData` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the policy_data field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `policy_data` field. diff --git a/docs/0.x/project_iam_binding.md b/docs/0.x/project_iam_binding.md new file mode 100644 index 0000000..8b4942b --- /dev/null +++ b/docs/0.x/project_iam_binding.md @@ -0,0 +1,130 @@ +--- +permalink: /project_iam_binding/ +--- + +# project_iam_binding + +`project_iam_binding` represents the `hcp_project_iam_binding` Terraform resource. + +Updates the project's IAM policy to bind a role to a new member. Existing bindings are preserved. + +This package contains functions and utilities for setting up the resource using Jsonnet code. + + +## Index + +* [`fn new()`](#fn-new) +* [`fn newAttrs()`](#fn-newattrs) +* [`fn withPrincipalId()`](#fn-withprincipalid) +* [`fn withProjectId()`](#fn-withprojectid) +* [`fn withRole()`](#fn-withrole) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.project_iam_binding.new` injects a new `hcp_project_iam_binding` 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.project_iam_binding.new('some_id') + +You can get the reference to the `id` field of the created `hcp.project_iam_binding` using the reference: + + $._ref.hcp_project_iam_binding.some_id.get('id') + +This is the same as directly entering `"${ hcp_project_iam_binding.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. + - `principal_id` (`string`): The principal to bind to the given role. + - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object. + - `role` (`string`): The role name to bind to the given principal. + +**Returns**: +- A mixin object that injects the new resource into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.project_iam_binding.newAttrs` constructs a new object with attributes and blocks configured for the `project_iam_binding` +Terraform resource. + +Unlike [hcp.project_iam_binding.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**: + - `principal_id` (`string`): The principal to bind to the given role. + - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object. + - `role` (`string`): The role name to bind to the given principal. + +**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 `project_iam_binding` resource into the root Terraform configuration. + + +### fn withPrincipalId + +```ts +withPrincipalId() +``` + +`hcp.string.withPrincipalId` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the principal_id field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `principal_id` field. + + +### 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 withRole + +```ts +withRole() +``` + +`hcp.string.withRole` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the role field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `role` field. diff --git a/docs/0.x/project_iam_policy.md b/docs/0.x/project_iam_policy.md new file mode 100644 index 0000000..41c8bf1 --- /dev/null +++ b/docs/0.x/project_iam_policy.md @@ -0,0 +1,111 @@ +--- +permalink: /project_iam_policy/ +--- + +# project_iam_policy + +`project_iam_policy` represents the `hcp_project_iam_policy` Terraform resource. + +Sets the project's IAM policy and replaces any existing policy. + +This package contains functions and utilities for setting up the resource using Jsonnet code. + + +## Index + +* [`fn new()`](#fn-new) +* [`fn newAttrs()`](#fn-newattrs) +* [`fn withPolicyData()`](#fn-withpolicydata) +* [`fn withProjectId()`](#fn-withprojectid) + +## Fields + +### fn new + +```ts +new() +``` + + +`hcp.project_iam_policy.new` injects a new `hcp_project_iam_policy` 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.project_iam_policy.new('some_id') + +You can get the reference to the `id` field of the created `hcp.project_iam_policy` using the reference: + + $._ref.hcp_project_iam_policy.some_id.get('id') + +This is the same as directly entering `"${ hcp_project_iam_policy.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. + - `policy_data` (`string`): The policy to apply. + - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object. + +**Returns**: +- A mixin object that injects the new resource into the root Terraform configuration. + + +### fn newAttrs + +```ts +newAttrs() +``` + + +`hcp.project_iam_policy.newAttrs` constructs a new object with attributes and blocks configured for the `project_iam_policy` +Terraform resource. + +Unlike [hcp.project_iam_policy.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**: + - `policy_data` (`string`): The policy to apply. + - `project_id` (`string`): The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used. When `null`, the `project_id` field will be omitted from the resulting object. + +**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 `project_iam_policy` resource into the root Terraform configuration. + + +### fn withPolicyData + +```ts +withPolicyData() +``` + +`hcp.string.withPolicyData` constructs a mixin object that can be merged into the `string` +Terraform resource block to set or update the policy_data field. + + + +**Args**: + - `resourceLabel` (`string`): The name label of the block to update. + - `value` (`string`): The value to set for the `policy_data` field. + + +### 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. diff --git a/docs/0.x/provider.md b/docs/0.x/provider.md index b93b16a..d14734a 100644 --- a/docs/0.x/provider.md +++ b/docs/0.x/provider.md @@ -35,6 +35,7 @@ the `src` and/or `version` parameters are set. **Args**: - `client_id` (`string`): The OAuth2 Client ID for API operations. When `null`, the `client_id` field will be omitted from the resulting object. - `client_secret` (`string`): The OAuth2 Client Secret for API operations. When `null`, the `client_secret` field will be omitted from the resulting object. + - `credential_file` (`string`): The path to an HCP credential file to use to authenticate the provider to HCP. You can alternatively set the HCP_CRED_FILE environment variable to point at a credential file as well. Using a credential file allows you to authenticate the provider as a service principal via client credentials or dynamically based on Workload Identity Federation. When `null`, the `credential_file` field will be omitted from the resulting object. - `project_id` (`string`): The default project in which resources should be created. When `null`, the `project_id` field will be omitted from the resulting object. - `alias` (`string`): The provider `alias` to set for this instance of the provider block. When `null`, the `alias` field will be omitted from the resulting provider block. @@ -69,6 +70,7 @@ injecting into a complete block. **Args**: - `client_id` (`string`): The OAuth2 Client ID for API operations. When `null`, the `client_id` field will be omitted from the resulting object. - `client_secret` (`string`): The OAuth2 Client Secret for API operations. When `null`, the `client_secret` field will be omitted from the resulting object. + - `credential_file` (`string`): The path to an HCP credential file to use to authenticate the provider to HCP. You can alternatively set the HCP_CRED_FILE environment variable to point at a credential file as well. Using a credential file allows you to authenticate the provider as a service principal via client credentials or dynamically based on Workload Identity Federation. When `null`, the `credential_file` field will be omitted from the resulting object. - `project_id` (`string`): The default project in which resources should be created. When `null`, the `project_id` field will be omitted from the resulting object. **Returns**: diff --git a/docs/0.x/vault_cluster.md b/docs/0.x/vault_cluster.md index c867f3d..3d89702 100644 --- a/docs/0.x/vault_cluster.md +++ b/docs/0.x/vault_cluster.md @@ -449,6 +449,9 @@ Terraform sub block. - `grafana_endpoint` (`string`): Grafana endpoint for streaming audit logs When `null`, the `grafana_endpoint` field will be omitted from the resulting object. - `grafana_password` (`string`): Grafana password for streaming audit logs When `null`, the `grafana_password` field will be omitted from the resulting object. - `grafana_user` (`string`): Grafana user for streaming audit logs When `null`, the `grafana_user` field will be omitted from the resulting object. + - `newrelic_account_id` (`string`): NewRelic Account ID for streaming audit logs When `null`, the `newrelic_account_id` field will be omitted from the resulting object. + - `newrelic_license_key` (`string`): NewRelic license key for streaming audit logs When `null`, the `newrelic_license_key` field will be omitted from the resulting object. + - `newrelic_region` (`string`): NewRelic region for streaming audit logs, allowed values are "US" and "EU" When `null`, the `newrelic_region` field will be omitted from the resulting object. - `splunk_hecendpoint` (`string`): Splunk endpoint for streaming audit logs When `null`, the `splunk_hecendpoint` field will be omitted from the resulting object. - `splunk_token` (`string`): Splunk token for streaming audit logs When `null`, the `splunk_token` field will be omitted from the resulting object. @@ -509,6 +512,9 @@ Terraform sub block. - `grafana_endpoint` (`string`): Grafana endpoint for streaming metrics When `null`, the `grafana_endpoint` field will be omitted from the resulting object. - `grafana_password` (`string`): Grafana password for streaming metrics When `null`, the `grafana_password` field will be omitted from the resulting object. - `grafana_user` (`string`): Grafana user for streaming metrics When `null`, the `grafana_user` field will be omitted from the resulting object. + - `newrelic_account_id` (`string`): NewRelic Account ID for streaming metrics When `null`, the `newrelic_account_id` field will be omitted from the resulting object. + - `newrelic_license_key` (`string`): NewRelic license key for streaming metrics When `null`, the `newrelic_license_key` field will be omitted from the resulting object. + - `newrelic_region` (`string`): NewRelic region for streaming metrics, allowed values are "US" and "EU" When `null`, the `newrelic_region` field will be omitted from the resulting object. - `splunk_hecendpoint` (`string`): Splunk endpoint for streaming metrics When `null`, the `splunk_hecendpoint` field will be omitted from the resulting object. - `splunk_token` (`string`): Splunk token for streaming metrics When `null`, the `splunk_token` field will be omitted from the resulting object.