Skip to content

Commit

Permalink
Generate libsonnet source from libgenerator PR tf-libsonnet/libgenera…
Browse files Browse the repository at this point in the history
…tor#220

Signed-off-by: tflibsonnet-ci <[email protected]>
  • Loading branch information
yorinasub17 authored and tflibsonnet-ci committed Nov 10, 2023
1 parent 51834a4 commit f397b63
Show file tree
Hide file tree
Showing 28 changed files with 1,705 additions and 301 deletions.
5 changes: 4 additions & 1 deletion 0.x/_gen/data/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ 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'),
organization: (import 'organization.libsonnet'),
packer_bucket_names: (import 'packer_bucket_names.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'),
project: (import 'project.libsonnet'),
service_principal: (import 'service_principal.libsonnet'),
vault_cluster: (import 'vault_cluster.libsonnet'),
vault_plugin: (import 'vault_plugin.libsonnet'),
vault_secrets_app: (import 'vault_secrets_app.libsonnet'),
vault_secrets_secret: (import 'vault_secrets_secret.libsonnet'),
}
19 changes: 19 additions & 0 deletions 0.x/_gen/data/organization.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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', url='', help='`organization` represents the `hcp_organization` Terraform data source.\n\nThe organization data source retrieves the HCP organization the provider is configured for.\n\nThis package contains functions and utilities for setting up the data source using Jsonnet code.\n'),
'#new':: d.fn(help="\n`hcp.data.organization.new` injects a new `data_hcp_organization` 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.organization.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.data.organization` using the reference:\n\n $._ref.data_hcp_organization.some_id.get('id')\n\nThis is the same as directly entering `\"${ data_hcp_organization.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\n**Returns**:\n- A mixin object that injects the new data source into the root Terraform configuration.\n", args=[]),
new(
dataSrcLabel,
_meta={}
):: tf.withData(
type='hcp_organization',
label=dataSrcLabel,
attrs=self.newAttrs(),
_meta=_meta
),
'#newAttrs':: d.fn(help='\n`hcp.data.organization.newAttrs` constructs a new object with attributes and blocks configured for the `organization`\nTerraform data source.\n\nUnlike [hcp.data.organization.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**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 `organization` data source into the root Terraform configuration.\n', args=[]),
newAttrs(

):: std.prune(a={}),
}
94 changes: 0 additions & 94 deletions 0.x/_gen/data/packer_image_iteration.libsonnet

This file was deleted.

32 changes: 32 additions & 0 deletions 0.x/_gen/data/project.libsonnet
Original file line number Diff line number Diff line change
@@ -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='project', url='', help='`project` represents the `hcp_project` Terraform data source.\n\nThe project data source retrieves the given HCP project.\n\nThis package contains functions and utilities for setting up the data source using Jsonnet code.\n'),
'#new':: d.fn(help="\n`hcp.data.project.new` injects a new `data_hcp_project` 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.project.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.data.project` using the reference:\n\n $._ref.data_hcp_project.some_id.get('id')\n\nThis is the same as directly entering `\"${ data_hcp_project.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` (`string`): The id of the project. May be given as \u0026#34;\u0026lt;id\u0026gt;\u0026#34; or \u0026#34;project/\u0026lt;id\u0026gt;\u0026#34;. If not set, the provider project is used. When `null`, the `project` field will be omitted from the resulting object.\n\n**Returns**:\n- A mixin object that injects the new data source into the root Terraform configuration.\n", args=[]),
new(
dataSrcLabel,
project=null,
_meta={}
):: tf.withData(
type='hcp_project',
label=dataSrcLabel,
attrs=self.newAttrs(project=project),
_meta=_meta
),
'#newAttrs':: d.fn(help='\n`hcp.data.project.newAttrs` constructs a new object with attributes and blocks configured for the `project`\nTerraform data source.\n\nUnlike [hcp.data.project.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` (`string`): The id of the project. May be given as &#34;&lt;id&gt;&#34; or &#34;project/&lt;id&gt;&#34;. If not set, the provider project is used. When `null`, the `project` field will be omitted from the resulting object.\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 `project` data source into the root Terraform configuration.\n', args=[]),
newAttrs(
project=null
):: std.prune(a={
project: project,
}),
'#withProject':: d.fn(help='`hcp.string.withProject` constructs a mixin object that can be merged into the `string`\nTerraform data source block to set or update the project 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` field.\n', args=[]),
withProject(dataSrcLabel, value): {
data+: {
hcp_project+: {
[dataSrcLabel]+: {
project: value,
},
},
},
},
}
32 changes: 32 additions & 0 deletions 0.x/_gen/data/service_principal.libsonnet
Original file line number Diff line number Diff line change
@@ -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='service_principal', url='', help='`service_principal` represents the `hcp_service_principal` Terraform data source.\n\nThe service principal data source retrieves the given service principal.\n\nThis package contains functions and utilities for setting up the data source using Jsonnet code.\n'),
'#new':: d.fn(help="\n`hcp.data.service_principal.new` injects a new `data_hcp_service_principal` 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.service_principal.new('some_id')\n\nYou can get the reference to the `id` field of the created `hcp.data.service_principal` using the reference:\n\n $._ref.data_hcp_service_principal.some_id.get('id')\n\nThis is the same as directly entering `\"${ data_hcp_service_principal.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 - `resource_name` (`string`): The service principal\u0026#39;s resource name in format `iam/project/\u0026lt;project_id\u0026gt;/service-principal/\u0026lt;name\u0026gt;` or `iam/organization/\u0026lt;organization_id\u0026gt;/service-principal/\u0026lt;name\u0026gt;`\n\n**Returns**:\n- A mixin object that injects the new data source into the root Terraform configuration.\n", args=[]),
new(
dataSrcLabel,
resource_name,
_meta={}
):: tf.withData(
type='hcp_service_principal',
label=dataSrcLabel,
attrs=self.newAttrs(resource_name=resource_name),
_meta=_meta
),
'#newAttrs':: d.fn(help='\n`hcp.data.service_principal.newAttrs` constructs a new object with attributes and blocks configured for the `service_principal`\nTerraform data source.\n\nUnlike [hcp.data.service_principal.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 - `resource_name` (`string`): The service principal&#39;s resource name in format `iam/project/&lt;project_id&gt;/service-principal/&lt;name&gt;` or `iam/organization/&lt;organization_id&gt;/service-principal/&lt;name&gt;`\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 `service_principal` data source into the root Terraform configuration.\n', args=[]),
newAttrs(
resource_name
):: std.prune(a={
resource_name: resource_name,
}),
'#withResourceName':: d.fn(help='`hcp.string.withResourceName` constructs a mixin object that can be merged into the `string`\nTerraform data source block to set or update the resource_name 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 `resource_name` field.\n', args=[]),
withResourceName(dataSrcLabel, value): {
data+: {
hcp_service_principal+: {
[dataSrcLabel]+: {
resource_name: value,
},
},
},
},
}
Loading

0 comments on commit f397b63

Please sign in to comment.