/
app.go
222 lines (187 loc) · 7.98 KB
/
app.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
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package resiliencehub
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type Definition for AWS::ResilienceHub::App.
type App struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN) of the App.
AppArn pulumi.StringOutput `pulumi:"appArn"`
// Assessment execution schedule.
AppAssessmentSchedule AppAssessmentSchedulePtrOutput `pulumi:"appAssessmentSchedule"`
// A string containing full ResilienceHub app template body.
AppTemplateBody pulumi.StringOutput `pulumi:"appTemplateBody"`
// App description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Indicates if compliance drifts (deviations) were detected while running an assessment for your application.
DriftStatus AppDriftStatusOutput `pulumi:"driftStatus"`
// The list of events you would like to subscribe and get notification for.
EventSubscriptions AppEventSubscriptionArrayOutput `pulumi:"eventSubscriptions"`
// Name of the app.
Name pulumi.StringOutput `pulumi:"name"`
PermissionModel AppPermissionModelPtrOutput `pulumi:"permissionModel"`
// Amazon Resource Name (ARN) of the Resiliency Policy.
ResiliencyPolicyArn pulumi.StringPtrOutput `pulumi:"resiliencyPolicyArn"`
// An array of ResourceMapping objects.
ResourceMappings AppResourceMappingArrayOutput `pulumi:"resourceMappings"`
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewApp registers a new resource with the given unique name, arguments, and options.
func NewApp(ctx *pulumi.Context,
name string, args *AppArgs, opts ...pulumi.ResourceOption) (*App, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AppTemplateBody == nil {
return nil, errors.New("invalid value for required argument 'AppTemplateBody'")
}
if args.ResourceMappings == nil {
return nil, errors.New("invalid value for required argument 'ResourceMappings'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"name",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource App
err := ctx.RegisterResource("aws-native:resiliencehub:App", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApp gets an existing App 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 GetApp(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppState, opts ...pulumi.ResourceOption) (*App, error) {
var resource App
err := ctx.ReadResource("aws-native:resiliencehub:App", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering App resources.
type appState struct {
}
type AppState struct {
}
func (AppState) ElementType() reflect.Type {
return reflect.TypeOf((*appState)(nil)).Elem()
}
type appArgs struct {
// Assessment execution schedule.
AppAssessmentSchedule *AppAssessmentSchedule `pulumi:"appAssessmentSchedule"`
// A string containing full ResilienceHub app template body.
AppTemplateBody string `pulumi:"appTemplateBody"`
// App description.
Description *string `pulumi:"description"`
// The list of events you would like to subscribe and get notification for.
EventSubscriptions []AppEventSubscription `pulumi:"eventSubscriptions"`
// Name of the app.
Name *string `pulumi:"name"`
PermissionModel *AppPermissionModel `pulumi:"permissionModel"`
// Amazon Resource Name (ARN) of the Resiliency Policy.
ResiliencyPolicyArn *string `pulumi:"resiliencyPolicyArn"`
// An array of ResourceMapping objects.
ResourceMappings []AppResourceMapping `pulumi:"resourceMappings"`
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a App resource.
type AppArgs struct {
// Assessment execution schedule.
AppAssessmentSchedule AppAssessmentSchedulePtrInput
// A string containing full ResilienceHub app template body.
AppTemplateBody pulumi.StringInput
// App description.
Description pulumi.StringPtrInput
// The list of events you would like to subscribe and get notification for.
EventSubscriptions AppEventSubscriptionArrayInput
// Name of the app.
Name pulumi.StringPtrInput
PermissionModel AppPermissionModelPtrInput
// Amazon Resource Name (ARN) of the Resiliency Policy.
ResiliencyPolicyArn pulumi.StringPtrInput
// An array of ResourceMapping objects.
ResourceMappings AppResourceMappingArrayInput
Tags pulumi.StringMapInput
}
func (AppArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appArgs)(nil)).Elem()
}
type AppInput interface {
pulumi.Input
ToAppOutput() AppOutput
ToAppOutputWithContext(ctx context.Context) AppOutput
}
func (*App) ElementType() reflect.Type {
return reflect.TypeOf((**App)(nil)).Elem()
}
func (i *App) ToAppOutput() AppOutput {
return i.ToAppOutputWithContext(context.Background())
}
func (i *App) ToAppOutputWithContext(ctx context.Context) AppOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppOutput)
}
type AppOutput struct{ *pulumi.OutputState }
func (AppOutput) ElementType() reflect.Type {
return reflect.TypeOf((**App)(nil)).Elem()
}
func (o AppOutput) ToAppOutput() AppOutput {
return o
}
func (o AppOutput) ToAppOutputWithContext(ctx context.Context) AppOutput {
return o
}
// Amazon Resource Name (ARN) of the App.
func (o AppOutput) AppArn() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.AppArn }).(pulumi.StringOutput)
}
// Assessment execution schedule.
func (o AppOutput) AppAssessmentSchedule() AppAssessmentSchedulePtrOutput {
return o.ApplyT(func(v *App) AppAssessmentSchedulePtrOutput { return v.AppAssessmentSchedule }).(AppAssessmentSchedulePtrOutput)
}
// A string containing full ResilienceHub app template body.
func (o AppOutput) AppTemplateBody() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.AppTemplateBody }).(pulumi.StringOutput)
}
// App description.
func (o AppOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *App) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Indicates if compliance drifts (deviations) were detected while running an assessment for your application.
func (o AppOutput) DriftStatus() AppDriftStatusOutput {
return o.ApplyT(func(v *App) AppDriftStatusOutput { return v.DriftStatus }).(AppDriftStatusOutput)
}
// The list of events you would like to subscribe and get notification for.
func (o AppOutput) EventSubscriptions() AppEventSubscriptionArrayOutput {
return o.ApplyT(func(v *App) AppEventSubscriptionArrayOutput { return v.EventSubscriptions }).(AppEventSubscriptionArrayOutput)
}
// Name of the app.
func (o AppOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o AppOutput) PermissionModel() AppPermissionModelPtrOutput {
return o.ApplyT(func(v *App) AppPermissionModelPtrOutput { return v.PermissionModel }).(AppPermissionModelPtrOutput)
}
// Amazon Resource Name (ARN) of the Resiliency Policy.
func (o AppOutput) ResiliencyPolicyArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *App) pulumi.StringPtrOutput { return v.ResiliencyPolicyArn }).(pulumi.StringPtrOutput)
}
// An array of ResourceMapping objects.
func (o AppOutput) ResourceMappings() AppResourceMappingArrayOutput {
return o.ApplyT(func(v *App) AppResourceMappingArrayOutput { return v.ResourceMappings }).(AppResourceMappingArrayOutput)
}
func (o AppOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *App) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppInput)(nil)).Elem(), &App{})
pulumi.RegisterOutputType(AppOutput{})
}