/
globalSettings.go
245 lines (199 loc) · 8.01 KB
/
globalSettings.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
// *** 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 backup
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AWS Backup Global Settings resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/backup"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := backup.NewGlobalSettings(ctx, "test", &backup.GlobalSettingsArgs{
// GlobalSettings: pulumi.StringMap{
// "isCrossAccountBackupEnabled": pulumi.String("true"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Backup Global Settings can be imported using the `id`, e.g.,
//
// ```sh
// $ pulumi import aws:backup/globalSettings:GlobalSettings example 123456789012
// ```
type GlobalSettings struct {
pulumi.CustomResourceState
// A list of resources along with the opt-in preferences for the account.
GlobalSettings pulumi.StringMapOutput `pulumi:"globalSettings"`
}
// NewGlobalSettings registers a new resource with the given unique name, arguments, and options.
func NewGlobalSettings(ctx *pulumi.Context,
name string, args *GlobalSettingsArgs, opts ...pulumi.ResourceOption) (*GlobalSettings, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GlobalSettings == nil {
return nil, errors.New("invalid value for required argument 'GlobalSettings'")
}
var resource GlobalSettings
err := ctx.RegisterResource("aws:backup/globalSettings:GlobalSettings", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGlobalSettings gets an existing GlobalSettings 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 GetGlobalSettings(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GlobalSettingsState, opts ...pulumi.ResourceOption) (*GlobalSettings, error) {
var resource GlobalSettings
err := ctx.ReadResource("aws:backup/globalSettings:GlobalSettings", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GlobalSettings resources.
type globalSettingsState struct {
// A list of resources along with the opt-in preferences for the account.
GlobalSettings map[string]string `pulumi:"globalSettings"`
}
type GlobalSettingsState struct {
// A list of resources along with the opt-in preferences for the account.
GlobalSettings pulumi.StringMapInput
}
func (GlobalSettingsState) ElementType() reflect.Type {
return reflect.TypeOf((*globalSettingsState)(nil)).Elem()
}
type globalSettingsArgs struct {
// A list of resources along with the opt-in preferences for the account.
GlobalSettings map[string]string `pulumi:"globalSettings"`
}
// The set of arguments for constructing a GlobalSettings resource.
type GlobalSettingsArgs struct {
// A list of resources along with the opt-in preferences for the account.
GlobalSettings pulumi.StringMapInput
}
func (GlobalSettingsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*globalSettingsArgs)(nil)).Elem()
}
type GlobalSettingsInput interface {
pulumi.Input
ToGlobalSettingsOutput() GlobalSettingsOutput
ToGlobalSettingsOutputWithContext(ctx context.Context) GlobalSettingsOutput
}
func (*GlobalSettings) ElementType() reflect.Type {
return reflect.TypeOf((**GlobalSettings)(nil)).Elem()
}
func (i *GlobalSettings) ToGlobalSettingsOutput() GlobalSettingsOutput {
return i.ToGlobalSettingsOutputWithContext(context.Background())
}
func (i *GlobalSettings) ToGlobalSettingsOutputWithContext(ctx context.Context) GlobalSettingsOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalSettingsOutput)
}
// GlobalSettingsArrayInput is an input type that accepts GlobalSettingsArray and GlobalSettingsArrayOutput values.
// You can construct a concrete instance of `GlobalSettingsArrayInput` via:
//
// GlobalSettingsArray{ GlobalSettingsArgs{...} }
type GlobalSettingsArrayInput interface {
pulumi.Input
ToGlobalSettingsArrayOutput() GlobalSettingsArrayOutput
ToGlobalSettingsArrayOutputWithContext(context.Context) GlobalSettingsArrayOutput
}
type GlobalSettingsArray []GlobalSettingsInput
func (GlobalSettingsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GlobalSettings)(nil)).Elem()
}
func (i GlobalSettingsArray) ToGlobalSettingsArrayOutput() GlobalSettingsArrayOutput {
return i.ToGlobalSettingsArrayOutputWithContext(context.Background())
}
func (i GlobalSettingsArray) ToGlobalSettingsArrayOutputWithContext(ctx context.Context) GlobalSettingsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalSettingsArrayOutput)
}
// GlobalSettingsMapInput is an input type that accepts GlobalSettingsMap and GlobalSettingsMapOutput values.
// You can construct a concrete instance of `GlobalSettingsMapInput` via:
//
// GlobalSettingsMap{ "key": GlobalSettingsArgs{...} }
type GlobalSettingsMapInput interface {
pulumi.Input
ToGlobalSettingsMapOutput() GlobalSettingsMapOutput
ToGlobalSettingsMapOutputWithContext(context.Context) GlobalSettingsMapOutput
}
type GlobalSettingsMap map[string]GlobalSettingsInput
func (GlobalSettingsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GlobalSettings)(nil)).Elem()
}
func (i GlobalSettingsMap) ToGlobalSettingsMapOutput() GlobalSettingsMapOutput {
return i.ToGlobalSettingsMapOutputWithContext(context.Background())
}
func (i GlobalSettingsMap) ToGlobalSettingsMapOutputWithContext(ctx context.Context) GlobalSettingsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalSettingsMapOutput)
}
type GlobalSettingsOutput struct{ *pulumi.OutputState }
func (GlobalSettingsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GlobalSettings)(nil)).Elem()
}
func (o GlobalSettingsOutput) ToGlobalSettingsOutput() GlobalSettingsOutput {
return o
}
func (o GlobalSettingsOutput) ToGlobalSettingsOutputWithContext(ctx context.Context) GlobalSettingsOutput {
return o
}
type GlobalSettingsArrayOutput struct{ *pulumi.OutputState }
func (GlobalSettingsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GlobalSettings)(nil)).Elem()
}
func (o GlobalSettingsArrayOutput) ToGlobalSettingsArrayOutput() GlobalSettingsArrayOutput {
return o
}
func (o GlobalSettingsArrayOutput) ToGlobalSettingsArrayOutputWithContext(ctx context.Context) GlobalSettingsArrayOutput {
return o
}
func (o GlobalSettingsArrayOutput) Index(i pulumi.IntInput) GlobalSettingsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GlobalSettings {
return vs[0].([]*GlobalSettings)[vs[1].(int)]
}).(GlobalSettingsOutput)
}
type GlobalSettingsMapOutput struct{ *pulumi.OutputState }
func (GlobalSettingsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GlobalSettings)(nil)).Elem()
}
func (o GlobalSettingsMapOutput) ToGlobalSettingsMapOutput() GlobalSettingsMapOutput {
return o
}
func (o GlobalSettingsMapOutput) ToGlobalSettingsMapOutputWithContext(ctx context.Context) GlobalSettingsMapOutput {
return o
}
func (o GlobalSettingsMapOutput) MapIndex(k pulumi.StringInput) GlobalSettingsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GlobalSettings {
return vs[0].(map[string]*GlobalSettings)[vs[1].(string)]
}).(GlobalSettingsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GlobalSettingsInput)(nil)).Elem(), &GlobalSettings{})
pulumi.RegisterInputType(reflect.TypeOf((*GlobalSettingsArrayInput)(nil)).Elem(), GlobalSettingsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GlobalSettingsMapInput)(nil)).Elem(), GlobalSettingsMap{})
pulumi.RegisterOutputType(GlobalSettingsOutput{})
pulumi.RegisterOutputType(GlobalSettingsArrayOutput{})
pulumi.RegisterOutputType(GlobalSettingsMapOutput{})
}