/
domainMapping.go
392 lines (331 loc) · 14.3 KB
/
domainMapping.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package appengine
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A domain serving an App Engine application.
//
// To get more information about DomainMapping, see:
//
// * [API documentation](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.domainMappings)
// * How-to Guides
// * [Official Documentation](https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains)
//
// ## Example Usage
// ### App Engine Domain Mapping Basic
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/appengine"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := appengine.NewDomainMapping(ctx, "domainMapping", &appengine.DomainMappingArgs{
// DomainName: pulumi.String("verified-domain.com"),
// SslSettings: &appengine.DomainMappingSslSettingsArgs{
// SslManagementType: pulumi.String("AUTOMATIC"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// DomainMapping can be imported using any of these accepted formats
//
// ```sh
// $ pulumi import gcp:appengine/domainMapping:DomainMapping default apps/{{project}}/domainMappings/{{domain_name}}
// ```
//
// ```sh
// $ pulumi import gcp:appengine/domainMapping:DomainMapping default {{project}}/{{domain_name}}
// ```
//
// ```sh
// $ pulumi import gcp:appengine/domainMapping:DomainMapping default {{domain_name}}
// ```
type DomainMapping struct {
pulumi.CustomResourceState
// Relative name of the domain serving the application. Example: example.com.
DomainName pulumi.StringOutput `pulumi:"domainName"`
// Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.
Name pulumi.StringOutput `pulumi:"name"`
// Whether the domain creation should override any existing mappings for this domain.
// By default, overrides are rejected.
// Default value is `STRICT`.
// Possible values are `STRICT` and `OVERRIDE`.
OverrideStrategy pulumi.StringPtrOutput `pulumi:"overrideStrategy"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringOutput `pulumi:"project"`
// The resource records required to configure this domain mapping. These records must be added to the domain's DNS
// configuration in order to serve the application via this domain mapping.
ResourceRecords DomainMappingResourceRecordArrayOutput `pulumi:"resourceRecords"`
// SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.
// Structure is documented below.
SslSettings DomainMappingSslSettingsPtrOutput `pulumi:"sslSettings"`
}
// NewDomainMapping registers a new resource with the given unique name, arguments, and options.
func NewDomainMapping(ctx *pulumi.Context,
name string, args *DomainMappingArgs, opts ...pulumi.ResourceOption) (*DomainMapping, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DomainName == nil {
return nil, errors.New("invalid value for required argument 'DomainName'")
}
var resource DomainMapping
err := ctx.RegisterResource("gcp:appengine/domainMapping:DomainMapping", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDomainMapping gets an existing DomainMapping 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 GetDomainMapping(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DomainMappingState, opts ...pulumi.ResourceOption) (*DomainMapping, error) {
var resource DomainMapping
err := ctx.ReadResource("gcp:appengine/domainMapping:DomainMapping", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DomainMapping resources.
type domainMappingState struct {
// Relative name of the domain serving the application. Example: example.com.
DomainName *string `pulumi:"domainName"`
// Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.
Name *string `pulumi:"name"`
// Whether the domain creation should override any existing mappings for this domain.
// By default, overrides are rejected.
// Default value is `STRICT`.
// Possible values are `STRICT` and `OVERRIDE`.
OverrideStrategy *string `pulumi:"overrideStrategy"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The resource records required to configure this domain mapping. These records must be added to the domain's DNS
// configuration in order to serve the application via this domain mapping.
ResourceRecords []DomainMappingResourceRecord `pulumi:"resourceRecords"`
// SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.
// Structure is documented below.
SslSettings *DomainMappingSslSettings `pulumi:"sslSettings"`
}
type DomainMappingState struct {
// Relative name of the domain serving the application. Example: example.com.
DomainName pulumi.StringPtrInput
// Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.
Name pulumi.StringPtrInput
// Whether the domain creation should override any existing mappings for this domain.
// By default, overrides are rejected.
// Default value is `STRICT`.
// Possible values are `STRICT` and `OVERRIDE`.
OverrideStrategy pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// The resource records required to configure this domain mapping. These records must be added to the domain's DNS
// configuration in order to serve the application via this domain mapping.
ResourceRecords DomainMappingResourceRecordArrayInput
// SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.
// Structure is documented below.
SslSettings DomainMappingSslSettingsPtrInput
}
func (DomainMappingState) ElementType() reflect.Type {
return reflect.TypeOf((*domainMappingState)(nil)).Elem()
}
type domainMappingArgs struct {
// Relative name of the domain serving the application. Example: example.com.
DomainName string `pulumi:"domainName"`
// Whether the domain creation should override any existing mappings for this domain.
// By default, overrides are rejected.
// Default value is `STRICT`.
// Possible values are `STRICT` and `OVERRIDE`.
OverrideStrategy *string `pulumi:"overrideStrategy"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.
// Structure is documented below.
SslSettings *DomainMappingSslSettings `pulumi:"sslSettings"`
}
// The set of arguments for constructing a DomainMapping resource.
type DomainMappingArgs struct {
// Relative name of the domain serving the application. Example: example.com.
DomainName pulumi.StringInput
// Whether the domain creation should override any existing mappings for this domain.
// By default, overrides are rejected.
// Default value is `STRICT`.
// Possible values are `STRICT` and `OVERRIDE`.
OverrideStrategy pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.
// Structure is documented below.
SslSettings DomainMappingSslSettingsPtrInput
}
func (DomainMappingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*domainMappingArgs)(nil)).Elem()
}
type DomainMappingInput interface {
pulumi.Input
ToDomainMappingOutput() DomainMappingOutput
ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput
}
func (*DomainMapping) ElementType() reflect.Type {
return reflect.TypeOf((*DomainMapping)(nil))
}
func (i *DomainMapping) ToDomainMappingOutput() DomainMappingOutput {
return i.ToDomainMappingOutputWithContext(context.Background())
}
func (i *DomainMapping) ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainMappingOutput)
}
func (i *DomainMapping) ToDomainMappingPtrOutput() DomainMappingPtrOutput {
return i.ToDomainMappingPtrOutputWithContext(context.Background())
}
func (i *DomainMapping) ToDomainMappingPtrOutputWithContext(ctx context.Context) DomainMappingPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainMappingPtrOutput)
}
type DomainMappingPtrInput interface {
pulumi.Input
ToDomainMappingPtrOutput() DomainMappingPtrOutput
ToDomainMappingPtrOutputWithContext(ctx context.Context) DomainMappingPtrOutput
}
type domainMappingPtrType DomainMappingArgs
func (*domainMappingPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**DomainMapping)(nil))
}
func (i *domainMappingPtrType) ToDomainMappingPtrOutput() DomainMappingPtrOutput {
return i.ToDomainMappingPtrOutputWithContext(context.Background())
}
func (i *domainMappingPtrType) ToDomainMappingPtrOutputWithContext(ctx context.Context) DomainMappingPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainMappingPtrOutput)
}
// DomainMappingArrayInput is an input type that accepts DomainMappingArray and DomainMappingArrayOutput values.
// You can construct a concrete instance of `DomainMappingArrayInput` via:
//
// DomainMappingArray{ DomainMappingArgs{...} }
type DomainMappingArrayInput interface {
pulumi.Input
ToDomainMappingArrayOutput() DomainMappingArrayOutput
ToDomainMappingArrayOutputWithContext(context.Context) DomainMappingArrayOutput
}
type DomainMappingArray []DomainMappingInput
func (DomainMappingArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DomainMapping)(nil)).Elem()
}
func (i DomainMappingArray) ToDomainMappingArrayOutput() DomainMappingArrayOutput {
return i.ToDomainMappingArrayOutputWithContext(context.Background())
}
func (i DomainMappingArray) ToDomainMappingArrayOutputWithContext(ctx context.Context) DomainMappingArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainMappingArrayOutput)
}
// DomainMappingMapInput is an input type that accepts DomainMappingMap and DomainMappingMapOutput values.
// You can construct a concrete instance of `DomainMappingMapInput` via:
//
// DomainMappingMap{ "key": DomainMappingArgs{...} }
type DomainMappingMapInput interface {
pulumi.Input
ToDomainMappingMapOutput() DomainMappingMapOutput
ToDomainMappingMapOutputWithContext(context.Context) DomainMappingMapOutput
}
type DomainMappingMap map[string]DomainMappingInput
func (DomainMappingMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DomainMapping)(nil)).Elem()
}
func (i DomainMappingMap) ToDomainMappingMapOutput() DomainMappingMapOutput {
return i.ToDomainMappingMapOutputWithContext(context.Background())
}
func (i DomainMappingMap) ToDomainMappingMapOutputWithContext(ctx context.Context) DomainMappingMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainMappingMapOutput)
}
type DomainMappingOutput struct{ *pulumi.OutputState }
func (DomainMappingOutput) ElementType() reflect.Type {
return reflect.TypeOf((*DomainMapping)(nil))
}
func (o DomainMappingOutput) ToDomainMappingOutput() DomainMappingOutput {
return o
}
func (o DomainMappingOutput) ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput {
return o
}
func (o DomainMappingOutput) ToDomainMappingPtrOutput() DomainMappingPtrOutput {
return o.ToDomainMappingPtrOutputWithContext(context.Background())
}
func (o DomainMappingOutput) ToDomainMappingPtrOutputWithContext(ctx context.Context) DomainMappingPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v DomainMapping) *DomainMapping {
return &v
}).(DomainMappingPtrOutput)
}
type DomainMappingPtrOutput struct{ *pulumi.OutputState }
func (DomainMappingPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DomainMapping)(nil))
}
func (o DomainMappingPtrOutput) ToDomainMappingPtrOutput() DomainMappingPtrOutput {
return o
}
func (o DomainMappingPtrOutput) ToDomainMappingPtrOutputWithContext(ctx context.Context) DomainMappingPtrOutput {
return o
}
func (o DomainMappingPtrOutput) Elem() DomainMappingOutput {
return o.ApplyT(func(v *DomainMapping) DomainMapping {
if v != nil {
return *v
}
var ret DomainMapping
return ret
}).(DomainMappingOutput)
}
type DomainMappingArrayOutput struct{ *pulumi.OutputState }
func (DomainMappingArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]DomainMapping)(nil))
}
func (o DomainMappingArrayOutput) ToDomainMappingArrayOutput() DomainMappingArrayOutput {
return o
}
func (o DomainMappingArrayOutput) ToDomainMappingArrayOutputWithContext(ctx context.Context) DomainMappingArrayOutput {
return o
}
func (o DomainMappingArrayOutput) Index(i pulumi.IntInput) DomainMappingOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) DomainMapping {
return vs[0].([]DomainMapping)[vs[1].(int)]
}).(DomainMappingOutput)
}
type DomainMappingMapOutput struct{ *pulumi.OutputState }
func (DomainMappingMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]DomainMapping)(nil))
}
func (o DomainMappingMapOutput) ToDomainMappingMapOutput() DomainMappingMapOutput {
return o
}
func (o DomainMappingMapOutput) ToDomainMappingMapOutputWithContext(ctx context.Context) DomainMappingMapOutput {
return o
}
func (o DomainMappingMapOutput) MapIndex(k pulumi.StringInput) DomainMappingOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) DomainMapping {
return vs[0].(map[string]DomainMapping)[vs[1].(string)]
}).(DomainMappingOutput)
}
func init() {
pulumi.RegisterOutputType(DomainMappingOutput{})
pulumi.RegisterOutputType(DomainMappingPtrOutput{})
pulumi.RegisterOutputType(DomainMappingArrayOutput{})
pulumi.RegisterOutputType(DomainMappingMapOutput{})
}