/
deploymentResourcePool.go
167 lines (138 loc) · 7.32 KB
/
deploymentResourcePool.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
// 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 v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Create a DeploymentResourcePool.
type DeploymentResourcePool struct {
pulumi.CustomResourceState
// Timestamp when this DeploymentResourcePool was created.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// The underlying DedicatedResources that the DeploymentResourcePool uses.
DedicatedResources GoogleCloudAiplatformV1DedicatedResourcesResponseOutput `pulumi:"dedicatedResources"`
Location pulumi.StringOutput `pulumi:"location"`
// Immutable. The resource name of the DeploymentResourcePool. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
}
// NewDeploymentResourcePool registers a new resource with the given unique name, arguments, and options.
func NewDeploymentResourcePool(ctx *pulumi.Context,
name string, args *DeploymentResourcePoolArgs, opts ...pulumi.ResourceOption) (*DeploymentResourcePool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DedicatedResources == nil {
return nil, errors.New("invalid value for required argument 'DedicatedResources'")
}
if args.DeploymentResourcePoolId == nil {
return nil, errors.New("invalid value for required argument 'DeploymentResourcePoolId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource DeploymentResourcePool
err := ctx.RegisterResource("google-native:aiplatform/v1:DeploymentResourcePool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDeploymentResourcePool gets an existing DeploymentResourcePool 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 GetDeploymentResourcePool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DeploymentResourcePoolState, opts ...pulumi.ResourceOption) (*DeploymentResourcePool, error) {
var resource DeploymentResourcePool
err := ctx.ReadResource("google-native:aiplatform/v1:DeploymentResourcePool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DeploymentResourcePool resources.
type deploymentResourcePoolState struct {
}
type DeploymentResourcePoolState struct {
}
func (DeploymentResourcePoolState) ElementType() reflect.Type {
return reflect.TypeOf((*deploymentResourcePoolState)(nil)).Elem()
}
type deploymentResourcePoolArgs struct {
// The underlying DedicatedResources that the DeploymentResourcePool uses.
DedicatedResources GoogleCloudAiplatformV1DedicatedResources `pulumi:"dedicatedResources"`
// The ID to use for the DeploymentResourcePool, which will become the final component of the DeploymentResourcePool's resource name. The maximum length is 63 characters, and valid characters are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
DeploymentResourcePoolId string `pulumi:"deploymentResourcePoolId"`
Location *string `pulumi:"location"`
// Immutable. The resource name of the DeploymentResourcePool. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
Name *string `pulumi:"name"`
Project *string `pulumi:"project"`
}
// The set of arguments for constructing a DeploymentResourcePool resource.
type DeploymentResourcePoolArgs struct {
// The underlying DedicatedResources that the DeploymentResourcePool uses.
DedicatedResources GoogleCloudAiplatformV1DedicatedResourcesInput
// The ID to use for the DeploymentResourcePool, which will become the final component of the DeploymentResourcePool's resource name. The maximum length is 63 characters, and valid characters are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
DeploymentResourcePoolId pulumi.StringInput
Location pulumi.StringPtrInput
// Immutable. The resource name of the DeploymentResourcePool. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
Name pulumi.StringPtrInput
Project pulumi.StringPtrInput
}
func (DeploymentResourcePoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*deploymentResourcePoolArgs)(nil)).Elem()
}
type DeploymentResourcePoolInput interface {
pulumi.Input
ToDeploymentResourcePoolOutput() DeploymentResourcePoolOutput
ToDeploymentResourcePoolOutputWithContext(ctx context.Context) DeploymentResourcePoolOutput
}
func (*DeploymentResourcePool) ElementType() reflect.Type {
return reflect.TypeOf((**DeploymentResourcePool)(nil)).Elem()
}
func (i *DeploymentResourcePool) ToDeploymentResourcePoolOutput() DeploymentResourcePoolOutput {
return i.ToDeploymentResourcePoolOutputWithContext(context.Background())
}
func (i *DeploymentResourcePool) ToDeploymentResourcePoolOutputWithContext(ctx context.Context) DeploymentResourcePoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeploymentResourcePoolOutput)
}
type DeploymentResourcePoolOutput struct{ *pulumi.OutputState }
func (DeploymentResourcePoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DeploymentResourcePool)(nil)).Elem()
}
func (o DeploymentResourcePoolOutput) ToDeploymentResourcePoolOutput() DeploymentResourcePoolOutput {
return o
}
func (o DeploymentResourcePoolOutput) ToDeploymentResourcePoolOutputWithContext(ctx context.Context) DeploymentResourcePoolOutput {
return o
}
// Timestamp when this DeploymentResourcePool was created.
func (o DeploymentResourcePoolOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *DeploymentResourcePool) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// The underlying DedicatedResources that the DeploymentResourcePool uses.
func (o DeploymentResourcePoolOutput) DedicatedResources() GoogleCloudAiplatformV1DedicatedResourcesResponseOutput {
return o.ApplyT(func(v *DeploymentResourcePool) GoogleCloudAiplatformV1DedicatedResourcesResponseOutput {
return v.DedicatedResources
}).(GoogleCloudAiplatformV1DedicatedResourcesResponseOutput)
}
func (o DeploymentResourcePoolOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *DeploymentResourcePool) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Immutable. The resource name of the DeploymentResourcePool. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
func (o DeploymentResourcePoolOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DeploymentResourcePool) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o DeploymentResourcePoolOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *DeploymentResourcePool) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DeploymentResourcePoolInput)(nil)).Elem(), &DeploymentResourcePool{})
pulumi.RegisterOutputType(DeploymentResourcePoolOutput{})
}