/
featurestore.go
229 lines (193 loc) · 14.8 KB
/
featurestore.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new Featurestore in a given project and location.
// Auto-naming is currently not supported for this resource.
type Featurestore struct {
pulumi.CustomResourceState
// Timestamp when this Featurestore was created.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key.
EncryptionSpec GoogleCloudAiplatformV1beta1EncryptionSpecResponseOutput `pulumi:"encryptionSpec"`
// Optional. Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.
Etag pulumi.StringOutput `pulumi:"etag"`
// Required. The ID to use for this Featurestore, which will become the final component of the Featurestore's resource name. This value may be up to 60 characters, and valid characters are `[a-z0-9_]`. The first character cannot be a number. The value must be unique within the project and location.
FeaturestoreId pulumi.StringOutput `pulumi:"featurestoreId"`
// Optional. The labels with user-defined metadata to organize your Featurestore. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Featurestore(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
Labels pulumi.StringMapOutput `pulumi:"labels"`
Location pulumi.StringOutput `pulumi:"location"`
// Name of the Featurestore. Format: `projects/{project}/locations/{location}/featurestores/{featurestore}`
Name pulumi.StringOutput `pulumi:"name"`
// Optional. Config for online storage resources. The field should not co-exist with the field of `OnlineStoreReplicationConfig`. If both of it and OnlineStoreReplicationConfig are unset, the feature store will not have an online store and cannot be used for online serving.
OnlineServingConfig GoogleCloudAiplatformV1beta1FeaturestoreOnlineServingConfigResponseOutput `pulumi:"onlineServingConfig"`
// Optional. TTL in days for feature values that will be stored in online serving storage. The Feature Store online storage periodically removes obsolete feature values older than `online_storage_ttl_days` since the feature generation time. Note that `online_storage_ttl_days` should be less than or equal to `offline_storage_ttl_days` for each EntityType under a featurestore. If not set, default to 4000 days
OnlineStorageTtlDays pulumi.IntOutput `pulumi:"onlineStorageTtlDays"`
Project pulumi.StringOutput `pulumi:"project"`
// State of the featurestore.
State pulumi.StringOutput `pulumi:"state"`
// Timestamp when this Featurestore was last updated.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewFeaturestore registers a new resource with the given unique name, arguments, and options.
func NewFeaturestore(ctx *pulumi.Context,
name string, args *FeaturestoreArgs, opts ...pulumi.ResourceOption) (*Featurestore, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FeaturestoreId == nil {
return nil, errors.New("invalid value for required argument 'FeaturestoreId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"featurestoreId",
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Featurestore
err := ctx.RegisterResource("google-native:aiplatform/v1beta1:Featurestore", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFeaturestore gets an existing Featurestore resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetFeaturestore(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FeaturestoreState, opts ...pulumi.ResourceOption) (*Featurestore, error) {
var resource Featurestore
err := ctx.ReadResource("google-native:aiplatform/v1beta1:Featurestore", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Featurestore resources.
type featurestoreState struct {
}
type FeaturestoreState struct {
}
func (FeaturestoreState) ElementType() reflect.Type {
return reflect.TypeOf((*featurestoreState)(nil)).Elem()
}
type featurestoreArgs struct {
// Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key.
EncryptionSpec *GoogleCloudAiplatformV1beta1EncryptionSpec `pulumi:"encryptionSpec"`
// Optional. Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.
Etag *string `pulumi:"etag"`
// Required. The ID to use for this Featurestore, which will become the final component of the Featurestore's resource name. This value may be up to 60 characters, and valid characters are `[a-z0-9_]`. The first character cannot be a number. The value must be unique within the project and location.
FeaturestoreId string `pulumi:"featurestoreId"`
// Optional. The labels with user-defined metadata to organize your Featurestore. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Featurestore(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
Labels map[string]string `pulumi:"labels"`
Location *string `pulumi:"location"`
// Optional. Config for online storage resources. The field should not co-exist with the field of `OnlineStoreReplicationConfig`. If both of it and OnlineStoreReplicationConfig are unset, the feature store will not have an online store and cannot be used for online serving.
OnlineServingConfig *GoogleCloudAiplatformV1beta1FeaturestoreOnlineServingConfig `pulumi:"onlineServingConfig"`
// Optional. TTL in days for feature values that will be stored in online serving storage. The Feature Store online storage periodically removes obsolete feature values older than `online_storage_ttl_days` since the feature generation time. Note that `online_storage_ttl_days` should be less than or equal to `offline_storage_ttl_days` for each EntityType under a featurestore. If not set, default to 4000 days
OnlineStorageTtlDays *int `pulumi:"onlineStorageTtlDays"`
Project *string `pulumi:"project"`
}
// The set of arguments for constructing a Featurestore resource.
type FeaturestoreArgs struct {
// Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key.
EncryptionSpec GoogleCloudAiplatformV1beta1EncryptionSpecPtrInput
// Optional. Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.
Etag pulumi.StringPtrInput
// Required. The ID to use for this Featurestore, which will become the final component of the Featurestore's resource name. This value may be up to 60 characters, and valid characters are `[a-z0-9_]`. The first character cannot be a number. The value must be unique within the project and location.
FeaturestoreId pulumi.StringInput
// Optional. The labels with user-defined metadata to organize your Featurestore. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Featurestore(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
Labels pulumi.StringMapInput
Location pulumi.StringPtrInput
// Optional. Config for online storage resources. The field should not co-exist with the field of `OnlineStoreReplicationConfig`. If both of it and OnlineStoreReplicationConfig are unset, the feature store will not have an online store and cannot be used for online serving.
OnlineServingConfig GoogleCloudAiplatformV1beta1FeaturestoreOnlineServingConfigPtrInput
// Optional. TTL in days for feature values that will be stored in online serving storage. The Feature Store online storage periodically removes obsolete feature values older than `online_storage_ttl_days` since the feature generation time. Note that `online_storage_ttl_days` should be less than or equal to `offline_storage_ttl_days` for each EntityType under a featurestore. If not set, default to 4000 days
OnlineStorageTtlDays pulumi.IntPtrInput
Project pulumi.StringPtrInput
}
func (FeaturestoreArgs) ElementType() reflect.Type {
return reflect.TypeOf((*featurestoreArgs)(nil)).Elem()
}
type FeaturestoreInput interface {
pulumi.Input
ToFeaturestoreOutput() FeaturestoreOutput
ToFeaturestoreOutputWithContext(ctx context.Context) FeaturestoreOutput
}
func (*Featurestore) ElementType() reflect.Type {
return reflect.TypeOf((**Featurestore)(nil)).Elem()
}
func (i *Featurestore) ToFeaturestoreOutput() FeaturestoreOutput {
return i.ToFeaturestoreOutputWithContext(context.Background())
}
func (i *Featurestore) ToFeaturestoreOutputWithContext(ctx context.Context) FeaturestoreOutput {
return pulumi.ToOutputWithContext(ctx, i).(FeaturestoreOutput)
}
type FeaturestoreOutput struct{ *pulumi.OutputState }
func (FeaturestoreOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Featurestore)(nil)).Elem()
}
func (o FeaturestoreOutput) ToFeaturestoreOutput() FeaturestoreOutput {
return o
}
func (o FeaturestoreOutput) ToFeaturestoreOutputWithContext(ctx context.Context) FeaturestoreOutput {
return o
}
// Timestamp when this Featurestore was created.
func (o FeaturestoreOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key.
func (o FeaturestoreOutput) EncryptionSpec() GoogleCloudAiplatformV1beta1EncryptionSpecResponseOutput {
return o.ApplyT(func(v *Featurestore) GoogleCloudAiplatformV1beta1EncryptionSpecResponseOutput {
return v.EncryptionSpec
}).(GoogleCloudAiplatformV1beta1EncryptionSpecResponseOutput)
}
// Optional. Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.
func (o FeaturestoreOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput)
}
// Required. The ID to use for this Featurestore, which will become the final component of the Featurestore's resource name. This value may be up to 60 characters, and valid characters are `[a-z0-9_]`. The first character cannot be a number. The value must be unique within the project and location.
func (o FeaturestoreOutput) FeaturestoreId() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.FeaturestoreId }).(pulumi.StringOutput)
}
// Optional. The labels with user-defined metadata to organize your Featurestore. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Featurestore(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
func (o FeaturestoreOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
func (o FeaturestoreOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Name of the Featurestore. Format: `projects/{project}/locations/{location}/featurestores/{featurestore}`
func (o FeaturestoreOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Optional. Config for online storage resources. The field should not co-exist with the field of `OnlineStoreReplicationConfig`. If both of it and OnlineStoreReplicationConfig are unset, the feature store will not have an online store and cannot be used for online serving.
func (o FeaturestoreOutput) OnlineServingConfig() GoogleCloudAiplatformV1beta1FeaturestoreOnlineServingConfigResponseOutput {
return o.ApplyT(func(v *Featurestore) GoogleCloudAiplatformV1beta1FeaturestoreOnlineServingConfigResponseOutput {
return v.OnlineServingConfig
}).(GoogleCloudAiplatformV1beta1FeaturestoreOnlineServingConfigResponseOutput)
}
// Optional. TTL in days for feature values that will be stored in online serving storage. The Feature Store online storage periodically removes obsolete feature values older than `online_storage_ttl_days` since the feature generation time. Note that `online_storage_ttl_days` should be less than or equal to `offline_storage_ttl_days` for each EntityType under a featurestore. If not set, default to 4000 days
func (o FeaturestoreOutput) OnlineStorageTtlDays() pulumi.IntOutput {
return o.ApplyT(func(v *Featurestore) pulumi.IntOutput { return v.OnlineStorageTtlDays }).(pulumi.IntOutput)
}
func (o FeaturestoreOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// State of the featurestore.
func (o FeaturestoreOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Timestamp when this Featurestore was last updated.
func (o FeaturestoreOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Featurestore) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FeaturestoreInput)(nil)).Elem(), &Featurestore{})
pulumi.RegisterOutputType(FeaturestoreOutput{})
}