/
deployment.go
252 lines (212 loc) · 16 KB
/
deployment.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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// 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 alpha
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a deployment and all of the resources described by the deployment manifest.
type Deployment struct {
pulumi.CustomResourceState
// Sets the policy to use for creating new resources.
CreatePolicy pulumi.StringPtrOutput `pulumi:"createPolicy"`
// User provided default credential for the deployment.
Credential CredentialResponseOutput `pulumi:"credential"`
// An optional user-provided description of the deployment.
Description pulumi.StringOutput `pulumi:"description"`
// Provides a fingerprint to use in requests to modify a deployment, such as `update()`, `stop()`, and `cancelPreview()` requests. A fingerprint is a randomly generated value that must be provided with `update()`, `stop()`, and `cancelPreview()` requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens at a time. The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a `get()` request to a deployment.
Fingerprint pulumi.StringOutput `pulumi:"fingerprint"`
// Creation timestamp in RFC3339 text format.
InsertTime pulumi.StringOutput `pulumi:"insertTime"`
// Map of One Platform labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and must conform to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?` Label values must be between 0 and 63 characters long and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
Labels DeploymentLabelEntryResponseArrayOutput `pulumi:"labels"`
// URL of the manifest representing the last manifest that was successfully deployed. If no manifest has been successfully deployed, this field will be absent.
Manifest pulumi.StringOutput `pulumi:"manifest"`
// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name pulumi.StringOutput `pulumi:"name"`
// The Operation that most recently ran, or is currently running, on this deployment.
Operation OperationResponseOutput `pulumi:"operation"`
// List of outputs from the last manifest that deployed successfully.
Outputs DeploymentOutputEntryResponseArrayOutput `pulumi:"outputs"`
// If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the `update()` method or you can use the `cancelPreview()` method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.
Preview pulumi.BoolPtrOutput `pulumi:"preview"`
Project pulumi.StringOutput `pulumi:"project"`
// Server defined URL for the resource.
SelfLink pulumi.StringOutput `pulumi:"selfLink"`
// [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates.
Target TargetConfigurationResponseOutput `pulumi:"target"`
// If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here.
Update DeploymentUpdateResponseOutput `pulumi:"update"`
// Update timestamp in RFC3339 text format.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewDeployment registers a new resource with the given unique name, arguments, and options.
func NewDeployment(ctx *pulumi.Context,
name string, args *DeploymentArgs, opts ...pulumi.ResourceOption) (*Deployment, error) {
if args == nil {
args = &DeploymentArgs{}
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Deployment
err := ctx.RegisterResource("google-native:deploymentmanager/alpha:Deployment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDeployment gets an existing Deployment 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 GetDeployment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DeploymentState, opts ...pulumi.ResourceOption) (*Deployment, error) {
var resource Deployment
err := ctx.ReadResource("google-native:deploymentmanager/alpha:Deployment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Deployment resources.
type deploymentState struct {
}
type DeploymentState struct {
}
func (DeploymentState) ElementType() reflect.Type {
return reflect.TypeOf((*deploymentState)(nil)).Elem()
}
type deploymentArgs struct {
// Sets the policy to use for creating new resources.
CreatePolicy *string `pulumi:"createPolicy"`
// User provided default credential for the deployment.
Credential *Credential `pulumi:"credential"`
// An optional user-provided description of the deployment.
Description *string `pulumi:"description"`
Id *string `pulumi:"id"`
// Map of One Platform labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and must conform to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?` Label values must be between 0 and 63 characters long and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
Labels []DeploymentLabelEntry `pulumi:"labels"`
// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name *string `pulumi:"name"`
// If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the `update()` method or you can use the `cancelPreview()` method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.
Preview *bool `pulumi:"preview"`
Project *string `pulumi:"project"`
// [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates.
Target *TargetConfiguration `pulumi:"target"`
}
// The set of arguments for constructing a Deployment resource.
type DeploymentArgs struct {
// Sets the policy to use for creating new resources.
CreatePolicy pulumi.StringPtrInput
// User provided default credential for the deployment.
Credential CredentialPtrInput
// An optional user-provided description of the deployment.
Description pulumi.StringPtrInput
Id pulumi.StringPtrInput
// Map of One Platform labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and must conform to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?` Label values must be between 0 and 63 characters long and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
Labels DeploymentLabelEntryArrayInput
// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name pulumi.StringPtrInput
// If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the `update()` method or you can use the `cancelPreview()` method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.
Preview pulumi.BoolPtrInput
Project pulumi.StringPtrInput
// [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates.
Target TargetConfigurationPtrInput
}
func (DeploymentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*deploymentArgs)(nil)).Elem()
}
type DeploymentInput interface {
pulumi.Input
ToDeploymentOutput() DeploymentOutput
ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput
}
func (*Deployment) ElementType() reflect.Type {
return reflect.TypeOf((**Deployment)(nil)).Elem()
}
func (i *Deployment) ToDeploymentOutput() DeploymentOutput {
return i.ToDeploymentOutputWithContext(context.Background())
}
func (i *Deployment) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeploymentOutput)
}
type DeploymentOutput struct{ *pulumi.OutputState }
func (DeploymentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Deployment)(nil)).Elem()
}
func (o DeploymentOutput) ToDeploymentOutput() DeploymentOutput {
return o
}
func (o DeploymentOutput) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
return o
}
// Sets the policy to use for creating new resources.
func (o DeploymentOutput) CreatePolicy() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringPtrOutput { return v.CreatePolicy }).(pulumi.StringPtrOutput)
}
// User provided default credential for the deployment.
func (o DeploymentOutput) Credential() CredentialResponseOutput {
return o.ApplyT(func(v *Deployment) CredentialResponseOutput { return v.Credential }).(CredentialResponseOutput)
}
// An optional user-provided description of the deployment.
func (o DeploymentOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// Provides a fingerprint to use in requests to modify a deployment, such as `update()`, `stop()`, and `cancelPreview()` requests. A fingerprint is a randomly generated value that must be provided with `update()`, `stop()`, and `cancelPreview()` requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens at a time. The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a `get()` request to a deployment.
func (o DeploymentOutput) Fingerprint() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Fingerprint }).(pulumi.StringOutput)
}
// Creation timestamp in RFC3339 text format.
func (o DeploymentOutput) InsertTime() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.InsertTime }).(pulumi.StringOutput)
}
// Map of One Platform labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and must conform to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?` Label values must be between 0 and 63 characters long and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
func (o DeploymentOutput) Labels() DeploymentLabelEntryResponseArrayOutput {
return o.ApplyT(func(v *Deployment) DeploymentLabelEntryResponseArrayOutput { return v.Labels }).(DeploymentLabelEntryResponseArrayOutput)
}
// URL of the manifest representing the last manifest that was successfully deployed. If no manifest has been successfully deployed, this field will be absent.
func (o DeploymentOutput) Manifest() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Manifest }).(pulumi.StringOutput)
}
// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
func (o DeploymentOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The Operation that most recently ran, or is currently running, on this deployment.
func (o DeploymentOutput) Operation() OperationResponseOutput {
return o.ApplyT(func(v *Deployment) OperationResponseOutput { return v.Operation }).(OperationResponseOutput)
}
// List of outputs from the last manifest that deployed successfully.
func (o DeploymentOutput) Outputs() DeploymentOutputEntryResponseArrayOutput {
return o.ApplyT(func(v *Deployment) DeploymentOutputEntryResponseArrayOutput { return v.Outputs }).(DeploymentOutputEntryResponseArrayOutput)
}
// If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the `update()` method or you can use the `cancelPreview()` method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.
func (o DeploymentOutput) Preview() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Deployment) pulumi.BoolPtrOutput { return v.Preview }).(pulumi.BoolPtrOutput)
}
func (o DeploymentOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Server defined URL for the resource.
func (o DeploymentOutput) SelfLink() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.SelfLink }).(pulumi.StringOutput)
}
// [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates.
func (o DeploymentOutput) Target() TargetConfigurationResponseOutput {
return o.ApplyT(func(v *Deployment) TargetConfigurationResponseOutput { return v.Target }).(TargetConfigurationResponseOutput)
}
// If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here.
func (o DeploymentOutput) Update() DeploymentUpdateResponseOutput {
return o.ApplyT(func(v *Deployment) DeploymentUpdateResponseOutput { return v.Update }).(DeploymentUpdateResponseOutput)
}
// Update timestamp in RFC3339 text format.
func (o DeploymentOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DeploymentInput)(nil)).Elem(), &Deployment{})
pulumi.RegisterOutputType(DeploymentOutput{})
}