/
alternativeContact.go
311 lines (265 loc) · 11.8 KB
/
alternativeContact.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
// *** 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 account
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages the specified alternate contact attached to an AWS Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/account"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := account.NewAlternativeContact(ctx, "operations", &account.AlternativeContactArgs{
// AlternateContactType: pulumi.String("OPERATIONS"),
// EmailAddress: pulumi.String("test@example.com"),
// PhoneNumber: pulumi.String("+1234567890"),
// Title: pulumi.String("Example"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// The Alternate Contact for the current account can be imported using the `alternate_contact_type`, e.g.,
//
// ```sh
// $ pulumi import aws:account/alternativeContact:AlternativeContact operations OPERATIONS
// ```
//
// If you provide an account ID, the Alternate Contact can be imported using the `account_id` and `alternate_contact_type` separated by a forward slash (`/`) e.g.,
//
// ```sh
// $ pulumi import aws:account/alternativeContact:AlternativeContact operations 1234567890/OPERATIONS
// ```
type AlternativeContact struct {
pulumi.CustomResourceState
// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
AccountId pulumi.StringPtrOutput `pulumi:"accountId"`
// The type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
AlternateContactType pulumi.StringOutput `pulumi:"alternateContactType"`
// An email address for the alternate contact.
EmailAddress pulumi.StringOutput `pulumi:"emailAddress"`
// The name of the alternate contact.
Name pulumi.StringOutput `pulumi:"name"`
// A phone number for the alternate contact.
PhoneNumber pulumi.StringOutput `pulumi:"phoneNumber"`
// A title for the alternate contact.
Title pulumi.StringOutput `pulumi:"title"`
}
// NewAlternativeContact registers a new resource with the given unique name, arguments, and options.
func NewAlternativeContact(ctx *pulumi.Context,
name string, args *AlternativeContactArgs, opts ...pulumi.ResourceOption) (*AlternativeContact, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AlternateContactType == nil {
return nil, errors.New("invalid value for required argument 'AlternateContactType'")
}
if args.EmailAddress == nil {
return nil, errors.New("invalid value for required argument 'EmailAddress'")
}
if args.PhoneNumber == nil {
return nil, errors.New("invalid value for required argument 'PhoneNumber'")
}
if args.Title == nil {
return nil, errors.New("invalid value for required argument 'Title'")
}
var resource AlternativeContact
err := ctx.RegisterResource("aws:account/alternativeContact:AlternativeContact", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAlternativeContact gets an existing AlternativeContact 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 GetAlternativeContact(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AlternativeContactState, opts ...pulumi.ResourceOption) (*AlternativeContact, error) {
var resource AlternativeContact
err := ctx.ReadResource("aws:account/alternativeContact:AlternativeContact", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AlternativeContact resources.
type alternativeContactState struct {
// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
AccountId *string `pulumi:"accountId"`
// The type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
AlternateContactType *string `pulumi:"alternateContactType"`
// An email address for the alternate contact.
EmailAddress *string `pulumi:"emailAddress"`
// The name of the alternate contact.
Name *string `pulumi:"name"`
// A phone number for the alternate contact.
PhoneNumber *string `pulumi:"phoneNumber"`
// A title for the alternate contact.
Title *string `pulumi:"title"`
}
type AlternativeContactState struct {
// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
AccountId pulumi.StringPtrInput
// The type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
AlternateContactType pulumi.StringPtrInput
// An email address for the alternate contact.
EmailAddress pulumi.StringPtrInput
// The name of the alternate contact.
Name pulumi.StringPtrInput
// A phone number for the alternate contact.
PhoneNumber pulumi.StringPtrInput
// A title for the alternate contact.
Title pulumi.StringPtrInput
}
func (AlternativeContactState) ElementType() reflect.Type {
return reflect.TypeOf((*alternativeContactState)(nil)).Elem()
}
type alternativeContactArgs struct {
// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
AccountId *string `pulumi:"accountId"`
// The type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
AlternateContactType string `pulumi:"alternateContactType"`
// An email address for the alternate contact.
EmailAddress string `pulumi:"emailAddress"`
// The name of the alternate contact.
Name *string `pulumi:"name"`
// A phone number for the alternate contact.
PhoneNumber string `pulumi:"phoneNumber"`
// A title for the alternate contact.
Title string `pulumi:"title"`
}
// The set of arguments for constructing a AlternativeContact resource.
type AlternativeContactArgs struct {
// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
AccountId pulumi.StringPtrInput
// The type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
AlternateContactType pulumi.StringInput
// An email address for the alternate contact.
EmailAddress pulumi.StringInput
// The name of the alternate contact.
Name pulumi.StringPtrInput
// A phone number for the alternate contact.
PhoneNumber pulumi.StringInput
// A title for the alternate contact.
Title pulumi.StringInput
}
func (AlternativeContactArgs) ElementType() reflect.Type {
return reflect.TypeOf((*alternativeContactArgs)(nil)).Elem()
}
type AlternativeContactInput interface {
pulumi.Input
ToAlternativeContactOutput() AlternativeContactOutput
ToAlternativeContactOutputWithContext(ctx context.Context) AlternativeContactOutput
}
func (*AlternativeContact) ElementType() reflect.Type {
return reflect.TypeOf((**AlternativeContact)(nil)).Elem()
}
func (i *AlternativeContact) ToAlternativeContactOutput() AlternativeContactOutput {
return i.ToAlternativeContactOutputWithContext(context.Background())
}
func (i *AlternativeContact) ToAlternativeContactOutputWithContext(ctx context.Context) AlternativeContactOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlternativeContactOutput)
}
// AlternativeContactArrayInput is an input type that accepts AlternativeContactArray and AlternativeContactArrayOutput values.
// You can construct a concrete instance of `AlternativeContactArrayInput` via:
//
// AlternativeContactArray{ AlternativeContactArgs{...} }
type AlternativeContactArrayInput interface {
pulumi.Input
ToAlternativeContactArrayOutput() AlternativeContactArrayOutput
ToAlternativeContactArrayOutputWithContext(context.Context) AlternativeContactArrayOutput
}
type AlternativeContactArray []AlternativeContactInput
func (AlternativeContactArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AlternativeContact)(nil)).Elem()
}
func (i AlternativeContactArray) ToAlternativeContactArrayOutput() AlternativeContactArrayOutput {
return i.ToAlternativeContactArrayOutputWithContext(context.Background())
}
func (i AlternativeContactArray) ToAlternativeContactArrayOutputWithContext(ctx context.Context) AlternativeContactArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlternativeContactArrayOutput)
}
// AlternativeContactMapInput is an input type that accepts AlternativeContactMap and AlternativeContactMapOutput values.
// You can construct a concrete instance of `AlternativeContactMapInput` via:
//
// AlternativeContactMap{ "key": AlternativeContactArgs{...} }
type AlternativeContactMapInput interface {
pulumi.Input
ToAlternativeContactMapOutput() AlternativeContactMapOutput
ToAlternativeContactMapOutputWithContext(context.Context) AlternativeContactMapOutput
}
type AlternativeContactMap map[string]AlternativeContactInput
func (AlternativeContactMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AlternativeContact)(nil)).Elem()
}
func (i AlternativeContactMap) ToAlternativeContactMapOutput() AlternativeContactMapOutput {
return i.ToAlternativeContactMapOutputWithContext(context.Background())
}
func (i AlternativeContactMap) ToAlternativeContactMapOutputWithContext(ctx context.Context) AlternativeContactMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlternativeContactMapOutput)
}
type AlternativeContactOutput struct{ *pulumi.OutputState }
func (AlternativeContactOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AlternativeContact)(nil)).Elem()
}
func (o AlternativeContactOutput) ToAlternativeContactOutput() AlternativeContactOutput {
return o
}
func (o AlternativeContactOutput) ToAlternativeContactOutputWithContext(ctx context.Context) AlternativeContactOutput {
return o
}
type AlternativeContactArrayOutput struct{ *pulumi.OutputState }
func (AlternativeContactArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AlternativeContact)(nil)).Elem()
}
func (o AlternativeContactArrayOutput) ToAlternativeContactArrayOutput() AlternativeContactArrayOutput {
return o
}
func (o AlternativeContactArrayOutput) ToAlternativeContactArrayOutputWithContext(ctx context.Context) AlternativeContactArrayOutput {
return o
}
func (o AlternativeContactArrayOutput) Index(i pulumi.IntInput) AlternativeContactOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AlternativeContact {
return vs[0].([]*AlternativeContact)[vs[1].(int)]
}).(AlternativeContactOutput)
}
type AlternativeContactMapOutput struct{ *pulumi.OutputState }
func (AlternativeContactMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AlternativeContact)(nil)).Elem()
}
func (o AlternativeContactMapOutput) ToAlternativeContactMapOutput() AlternativeContactMapOutput {
return o
}
func (o AlternativeContactMapOutput) ToAlternativeContactMapOutputWithContext(ctx context.Context) AlternativeContactMapOutput {
return o
}
func (o AlternativeContactMapOutput) MapIndex(k pulumi.StringInput) AlternativeContactOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AlternativeContact {
return vs[0].(map[string]*AlternativeContact)[vs[1].(string)]
}).(AlternativeContactOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AlternativeContactInput)(nil)).Elem(), &AlternativeContact{})
pulumi.RegisterInputType(reflect.TypeOf((*AlternativeContactArrayInput)(nil)).Elem(), AlternativeContactArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AlternativeContactMapInput)(nil)).Elem(), AlternativeContactMap{})
pulumi.RegisterOutputType(AlternativeContactOutput{})
pulumi.RegisterOutputType(AlternativeContactArrayOutput{})
pulumi.RegisterOutputType(AlternativeContactMapOutput{})
}