Skip to content

Commit e317d53

Browse files
committed
provisioner/terraform: add cost to resource_metadata
1 parent 917129d commit e317d53

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

provisioner/terraform/resources.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type metadataAttributes struct {
5555
ResourceID string `mapstructure:"resource_id"`
5656
Hide bool `mapstructure:"hide"`
5757
Icon string `mapstructure:"icon"`
58+
Cost int `mapstructure:"cost"`
5859
Items []metadataItem `mapstructure:"item"`
5960
}
6061

provisioner/terraform/resources_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func TestConvertResources(t *testing.T) {
149149
Type: "null_resource",
150150
Hide: true,
151151
Icon: "/icon/server.svg",
152+
Cost: 29,
152153
Metadata: []*proto.Resource_Metadata{{
153154
Key: "hello",
154155
Value: "world",

provisioner/terraform/testdata/resource-metadata/resource-metadata.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "coder_metadata" "about_info" {
1818
resource_id = null_resource.about.id
1919
hide = true
2020
icon = "/icon/server.svg"
21+
cost = 29
2122
item {
2223
key = "hello"
2324
value = "world"

provisionersdk/proto/provisioner.pb.go

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

provisionersdk/proto/provisioner.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ message Resource {
127127
string value = 2;
128128
bool sensitive = 3;
129129
bool is_null = 4;
130-
int32 cost = 5;
131130
}
132131
repeated Metadata metadata = 4;
133132
bool hide = 5;
134133
string icon = 6;
135134
string instance_type = 7;
135+
int32 cost = 8;
136136
}
137137

138138
// Parse consumes source-code from a directory to produce inputs.

0 commit comments

Comments
 (0)