diff --git a/Makefile b/Makefile index f43e9aa..e814916 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ TERRAFORM_VERSION_VALID := $(shell [ "$(TERRAFORM_VERSION)" = "`printf "$(TERRAF export TERRAFORM_PROVIDER_SOURCE ?= hashicorp/null export TERRAFORM_PROVIDER_REPO ?= https://github.com/hashicorp/terraform-provider-null -export TERRAFORM_PROVIDER_VERSION ?= 3.1.0 +export TERRAFORM_PROVIDER_VERSION ?= 3.2.2 export TERRAFORM_PROVIDER_DOWNLOAD_NAME ?= terraform-provider-null export TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX ?= https://releases.hashicorp.com/$(TERRAFORM_PROVIDER_DOWNLOAD_NAME)/$(TERRAFORM_PROVIDER_VERSION) export TERRAFORM_NATIVE_PROVIDER_BINARY ?= terraform-provider-null_v3.1.0_x5 @@ -44,7 +44,7 @@ NPROCS ?= 1 # to half the number of CPU cores. GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 ))) -GO_REQUIRED_VERSION ?= 1.19 +GO_REQUIRED_VERSION ?= 1.21 GOLANGCILINT_VERSION ?= 1.54.0 GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider $(GO_PROJECT)/cmd/generator GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION) diff --git a/apis/null/v1alpha1/zz_resource_types.go b/apis/null/v1alpha1/zz_resource_types.go index c2ce9ad..d9b78ba 100755 --- a/apis/null/v1alpha1/zz_resource_types.go +++ b/apis/null/v1alpha1/zz_resource_types.go @@ -15,14 +15,18 @@ import ( type ResourceInitParameters struct { + // running any associated provisioners. // A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. // +mapType=granular Triggers map[string]*string `json:"triggers,omitempty" tf:"triggers,omitempty"` } type ResourceObservation struct { + + // (String) This is set to a random value at create time. ID *string `json:"id,omitempty" tf:"id,omitempty"` + // running any associated provisioners. // A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. // +mapType=granular Triggers map[string]*string `json:"triggers,omitempty" tf:"triggers,omitempty"` @@ -30,6 +34,7 @@ type ResourceObservation struct { type ResourceParameters struct { + // running any associated provisioners. // A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. // +kubebuilder:validation:Optional // +mapType=granular @@ -63,7 +68,7 @@ type ResourceStatus struct { // +kubebuilder:subresource:status // +kubebuilder:storageversion -// Resource is the Schema for the Resources API. The null_resource resource implements the standard resource lifecycle but takes no further action. The triggers argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced. +// Resource is the Schema for the Resources API. The null_resource resource implements the standard resource lifecycle but takes no further action.hashicorp. The triggers argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced. // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" diff --git a/config/provider-metadata.yaml b/config/provider-metadata.yaml index 34ba35f..34f77d3 100644 --- a/config/provider-metadata.yaml +++ b/config/provider-metadata.yaml @@ -2,7 +2,7 @@ name: hashicorp/null resources: null_resource: subCategory: "" - description: The null_resource resource implements the standard resource lifecycle but takes no further action. The triggers argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced. + description: The null_resource resource implements the standard resource lifecycle but takes no further action. On Terraform 1.4 and later, use the terraform_data resource type https://developer.hashicorp.com/terraform/language/resources/terraform-data instead. The triggers argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced. name: null_resource title: null_resource Resource - terraform-provider-null examples: @@ -11,26 +11,30 @@ resources: { "connection": [ { - "host": "${element(aws_instance.cluster.*.public_ip, 0)}" + "host": "${element(aws_instance.cluster[*].public_ip, 0)}" } ], "provisioner": { "remote-exec": [ { "inline": [ - "bootstrap-cluster.sh ${join(\" \", aws_instance.cluster.*.private_ip)}" + "bootstrap-cluster.sh ${join(\" \",\n aws_instance.cluster[*].private_ip)}" ] } ] }, "triggers": { - "cluster_instance_ids": "${join(\",\", aws_instance.cluster.*.id)}" + "cluster_instance_ids": "${join(\",\", aws_instance.cluster[*].id)}" } } dependencies: aws_instance.cluster: |- { - "count": 3 + "ami": "ami-0dcc1e21636832c5d", + "count": 3, + "instance_type": "m5.large" } - argumentDocs: {} + argumentDocs: + id: (String) This is set to a random value at create time. + triggers: (Map of String) A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. importStatements: [] diff --git a/config/schema.json b/config/schema.json index d160792..ac6e2ac 100644 --- a/config/schema.json +++ b/config/schema.json @@ -1 +1 @@ -{"format_version":"1.0","provider_schemas":{"registry.terraform.io/hashicorp/null":{"provider":{"version":0,"block":{"description_kind":"plain"}},"resource_schemas":{"null_resource":{"version":0,"block":{"attributes":{"id":{"type":"string","description":"This is set to a random value at create time.","description_kind":"markdown","computed":true},"triggers":{"type":["map","string"],"description":"A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners.","description_kind":"markdown","optional":true}},"description":"The `null_resource` resource implements the standard resource lifecycle but takes no further action.\n\nThe `triggers` argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced.","description_kind":"markdown"}}},"data_source_schemas":{"null_data_source":{"version":0,"block":{"attributes":{"has_computed_default":{"type":"string","description":"If set, its literal value will be stored and returned. If not, its value defaults to `\"default\"`. This argument exists primarily for testing and has little practical use.","description_kind":"markdown","optional":true,"computed":true},"id":{"type":"string","description":"This attribute is only present for some legacy compatibility issues and should not be used. It will be removed in a future version.","description_kind":"markdown","deprecated":true,"computed":true},"inputs":{"type":["map","string"],"description":"A map of arbitrary strings that is copied into the `outputs` attribute, and accessible directly for interpolation.","description_kind":"markdown","optional":true},"outputs":{"type":["map","string"],"description":"After the data source is \"read\", a copy of the `inputs` map.","description_kind":"markdown","computed":true},"random":{"type":"string","description":"A random value. This is primarily for testing and has little practical use; prefer the [hashicorp/random provider](https://registry.terraform.io/providers/hashicorp/random) for more practical random number use-cases.","description_kind":"markdown","computed":true}},"description":"The `null_data_source` data source implements the standard data source lifecycle but does not\ninteract with any external APIs.\n\nHistorically, the `null_data_source` was typically used to construct intermediate values to re-use elsewhere in configuration. The\nsame can now be achieved using [locals](https://www.terraform.io/docs/language/values/locals.html).\n","description_kind":"markdown","deprecated":true}}}}}} +{"format_version":"1.0","provider_schemas":{"registry.terraform.io/hashicorp/null":{"provider":{"version":0,"block":{"description_kind":"plain"}},"resource_schemas":{"null_resource":{"version":0,"block":{"attributes":{"id":{"type":"string","description":"This is set to a random value at create time.","description_kind":"plain","computed":true},"triggers":{"type":["map","string"],"description":"A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners.","description_kind":"plain","optional":true}},"description":"The `null_resource` resource implements the standard resource lifecycle but takes no further action. On Terraform 1.4 and later, use the [terraform_data resource type](https://developer.hashicorp.com/terraform/language/resources/terraform-data) instead.\n\nThe `triggers` argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced.","description_kind":"plain"}}},"data_source_schemas":{"null_data_source":{"version":0,"block":{"attributes":{"has_computed_default":{"type":"string","description":"If set, its literal value will be stored and returned. If not, its value defaults to `\"default\"`. This argument exists primarily for testing and has little practical use.","description_kind":"plain","optional":true,"computed":true},"id":{"type":"string","description":"This attribute is only present for some legacy compatibility issues and should not be used. It will be removed in a future version.","description_kind":"plain","deprecated":true,"computed":true},"inputs":{"type":["map","string"],"description":"A map of arbitrary strings that is copied into the `outputs` attribute, and accessible directly for interpolation.","description_kind":"plain","optional":true},"outputs":{"type":["map","string"],"description":"After the data source is \"read\", a copy of the `inputs` map.","description_kind":"plain","computed":true},"random":{"type":"string","description":"A random value. This is primarily for testing and has little practical use; prefer the [hashicorp/random provider](https://registry.terraform.io/providers/hashicorp/random) for more practical random number use-cases.","description_kind":"plain","computed":true}},"description":"The `null_data_source` data source implements the standard data source lifecycle but does not\ninteract with any external APIs.\n\nHistorically, the `null_data_source` was typically used to construct intermediate values to re-use elsewhere in configuration. The\nsame can now be achieved using [locals](https://developer.hashicorp.com/terraform/language/values/locals) or the [terraform_data resource type](https://developer.hashicorp.com/terraform/language/resources/terraform-data) in Terraform 1.4 and later.","description_kind":"plain","deprecated":true}}}}}} diff --git a/examples-generated/null/v1alpha1/resource.yaml b/examples-generated/null/v1alpha1/resource.yaml index 59f7545..2c0d175 100644 --- a/examples-generated/null/v1alpha1/resource.yaml +++ b/examples-generated/null/v1alpha1/resource.yaml @@ -9,10 +9,12 @@ metadata: spec: forProvider: connection: - - host: ${element(aws_instance.cluster.*.public_ip, 0)} + - host: ${element(aws_instance.cluster[*].public_ip, 0)} provisioner: remote-exec: - inline: - - bootstrap-cluster.sh ${join(" ", aws_instance.cluster.*.private_ip)} + - |- + bootstrap-cluster.sh ${join(" ", + aws_instance.cluster[*].private_ip)} triggers: - cluster_instance_ids: ${join(",", aws_instance.cluster.*.id)} + cluster_instance_ids: ${join(",", aws_instance.cluster[*].id)} diff --git a/package/crds/null.template.upbound.io_resources.yaml b/package/crds/null.template.upbound.io_resources.yaml index 1b0825a..1d8b818 100644 --- a/package/crds/null.template.upbound.io_resources.yaml +++ b/package/crds/null.template.upbound.io_resources.yaml @@ -36,8 +36,8 @@ spec: openAPIV3Schema: description: Resource is the Schema for the Resources API. The null_resource resource implements the standard resource lifecycle but takes no further - action. The triggers argument allows specifying an arbitrary set of values - that, when changed, will cause the resource to be replaced. + action.hashicorp. The triggers argument allows specifying an arbitrary set + of values that, when changed, will cause the resource to be replaced. properties: apiVersion: description: |- @@ -78,9 +78,9 @@ spec: triggers: additionalProperties: type: string - description: A map of arbitrary strings that, when changed, will - force the null resource to be replaced, re-running any associated - provisioners. + description: |- + running any associated provisioners. + A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. type: object x-kubernetes-map-type: granular type: object @@ -100,9 +100,9 @@ spec: triggers: additionalProperties: type: string - description: A map of arbitrary strings that, when changed, will - force the null resource to be replaced, re-running any associated - provisioners. + description: |- + running any associated provisioners. + A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. type: object x-kubernetes-map-type: granular type: object @@ -279,13 +279,15 @@ spec: atProvider: properties: id: + description: (String) This is set to a random value at create + time. type: string triggers: additionalProperties: type: string - description: A map of arbitrary strings that, when changed, will - force the null resource to be replaced, re-running any associated - provisioners. + description: |- + running any associated provisioners. + A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners. type: object x-kubernetes-map-type: granular type: object