Skip to content

Commit

Permalink
Introduced value_promise and fixed ResourceRead in value_stash
Browse files Browse the repository at this point in the history
  • Loading branch information
teneko committed Sep 5, 2022
1 parent 6f6b911 commit c81360c
Show file tree
Hide file tree
Showing 25 changed files with 846 additions and 109 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=github.com
NAMESPACE=teneko
NAMESPACE=pseudo-dynamic
NAME=value
VERSION=0.1.0
BINARY=terraform-provider-${NAME}
Expand Down
26 changes: 26 additions & 0 deletions docs/resources/promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "value_promise Resource - terraform-provider-value"
subcategory: ""
description: |-
Allows you to treat a value as unknown. This is desirable when delaying postconditions.
---

# value_promise (Resource)

Allows you to treat a value as unknown. This is desirable when delaying postconditions.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `value` (Dynamic) The value to promise. Any (nested) change to `value` results into `result` to be marked as `(known after apply)`

### Read-Only

- `result` (Dynamic) Is set to `value`.


8 changes: 4 additions & 4 deletions docs/resources/stash.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
page_title: "value_stash Resource - terraform-provider-value"
subcategory: ""
description: |-
Allows you to manage a value as resource.
---

# value_stash (Resource)


Allows you to manage a value as resource.



<!-- schema generated by tfplugindocs -->
## Schema

### Required
### Optional

- `value` (Dynamic) The value to stash.
- `value` (Dynamic) The value to store/stash.


1 change: 0 additions & 1 deletion example/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.terraform.lock.hcl
18 changes: 18 additions & 0 deletions examples/promise/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_providers {
value = {
source = "github.com/pseudo-dynamic/value"
version = "0.1.0"
}
}
}

resource "value_promise" "default" {
value = {
timestamp = timestamp()
}
}

output "result" {
value = value_promise.default.result
}
8 changes: 2 additions & 6 deletions example/main.tf → examples/stash/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
value = {
source = "github.com/teneko/value"
source = "github.com/pseudo-dynamic/value"
version = "0.1.0"
}
}
Expand All @@ -24,12 +24,8 @@ resource "value_stash" "default" {
quantity = 2
}
]

lifecycle {
ignore_changes = all
}
}

output "edu_order" {
output "value" {
value = value_stash.default.value
}
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/teneko/terraform-provider-value
module github.com/pseudo-dynamic/terraform-provider-value

go 1.17

require (
github.com/hashicorp/go-hclog v1.0.0
github.com/hashicorp/go-hclog v1.2.1
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-go v0.5.0
github.com/hashicorp/terraform-plugin-mux v0.4.0
github.com/hashicorp/terraform-plugin-go v0.12.0
github.com/hashicorp/terraform-plugin-mux v0.7.0
golang.org/x/mod v0.5.1
google.golang.org/grpc v1.43.0
google.golang.org/grpc v1.48.0
)

require (
Expand All @@ -18,21 +18,21 @@ require (
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.3.0 // indirect
github.com/hashicorp/go-plugin v1.4.4 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.4.0 // indirect
github.com/hashicorp/terraform-exec v0.17.2 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.2.0 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect
github.com/hashicorp/terraform-plugin-log v0.6.0 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/huandu/xstrings v1.3.2 // indirect
Expand All @@ -48,13 +48,14 @@ require (
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/protobuf v1.25.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)
Loading

0 comments on commit c81360c

Please sign in to comment.