/
apnsSandboxChannel.go
354 lines (308 loc) · 15.8 KB
/
apnsSandboxChannel.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
// *** 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 pinpoint
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Pinpoint APNs Sandbox Channel resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "io/ioutil"
//
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/pinpoint"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func readFileOrPanic(path string) pulumi.StringPtrInput {
// data, err := ioutil.ReadFile(path)
// if err != nil {
// panic(err.Error())
// }
// return pulumi.String(string(data))
// }
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// app, err := pinpoint.NewApp(ctx, "app", nil)
// if err != nil {
// return err
// }
// _, err = pinpoint.NewApnsSandboxChannel(ctx, "apnsSandbox", &pinpoint.ApnsSandboxChannelArgs{
// ApplicationId: app.ApplicationId,
// Certificate: readFileOrPanic("./certificate.pem"),
// PrivateKey: readFileOrPanic("./private_key.key"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Pinpoint APNs Sandbox Channel can be imported using the `application-id`, e.g.,
//
// ```sh
// $ pulumi import aws:pinpoint/apnsSandboxChannel:ApnsSandboxChannel apns_sandbox application-id
// ```
type ApnsSandboxChannel struct {
pulumi.CustomResourceState
// The application ID.
ApplicationId pulumi.StringOutput `pulumi:"applicationId"`
// The ID assigned to your iOS app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and choose your app.
BundleId pulumi.StringPtrOutput `pulumi:"bundleId"`
// The pem encoded TLS Certificate from Apple.
Certificate pulumi.StringPtrOutput `pulumi:"certificate"`
// The default authentication method used for APNs Sandbox.
// __NOTE__: Amazon Pinpoint uses this default for every APNs push notification that you send using the console.
// You can override the default when you send a message programmatically using the Amazon Pinpoint API, the AWS CLI, or an AWS SDK.
// If your default authentication type fails, Amazon Pinpoint doesn't attempt to use the other authentication type.
DefaultAuthenticationMethod pulumi.StringPtrOutput `pulumi:"defaultAuthenticationMethod"`
// Whether the channel is enabled or disabled. Defaults to `true`.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// The Certificate Private Key file (ie. `.key` file).
PrivateKey pulumi.StringPtrOutput `pulumi:"privateKey"`
// The ID assigned to your Apple developer account team. This value is provided on the Membership page.
TeamId pulumi.StringPtrOutput `pulumi:"teamId"`
// The `.p8` file that you download from your Apple developer account when you create an authentication key.
TokenKey pulumi.StringPtrOutput `pulumi:"tokenKey"`
// The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section.
TokenKeyId pulumi.StringPtrOutput `pulumi:"tokenKeyId"`
}
// NewApnsSandboxChannel registers a new resource with the given unique name, arguments, and options.
func NewApnsSandboxChannel(ctx *pulumi.Context,
name string, args *ApnsSandboxChannelArgs, opts ...pulumi.ResourceOption) (*ApnsSandboxChannel, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApplicationId == nil {
return nil, errors.New("invalid value for required argument 'ApplicationId'")
}
var resource ApnsSandboxChannel
err := ctx.RegisterResource("aws:pinpoint/apnsSandboxChannel:ApnsSandboxChannel", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApnsSandboxChannel gets an existing ApnsSandboxChannel 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 GetApnsSandboxChannel(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApnsSandboxChannelState, opts ...pulumi.ResourceOption) (*ApnsSandboxChannel, error) {
var resource ApnsSandboxChannel
err := ctx.ReadResource("aws:pinpoint/apnsSandboxChannel:ApnsSandboxChannel", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApnsSandboxChannel resources.
type apnsSandboxChannelState struct {
// The application ID.
ApplicationId *string `pulumi:"applicationId"`
// The ID assigned to your iOS app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and choose your app.
BundleId *string `pulumi:"bundleId"`
// The pem encoded TLS Certificate from Apple.
Certificate *string `pulumi:"certificate"`
// The default authentication method used for APNs Sandbox.
// __NOTE__: Amazon Pinpoint uses this default for every APNs push notification that you send using the console.
// You can override the default when you send a message programmatically using the Amazon Pinpoint API, the AWS CLI, or an AWS SDK.
// If your default authentication type fails, Amazon Pinpoint doesn't attempt to use the other authentication type.
DefaultAuthenticationMethod *string `pulumi:"defaultAuthenticationMethod"`
// Whether the channel is enabled or disabled. Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// The Certificate Private Key file (ie. `.key` file).
PrivateKey *string `pulumi:"privateKey"`
// The ID assigned to your Apple developer account team. This value is provided on the Membership page.
TeamId *string `pulumi:"teamId"`
// The `.p8` file that you download from your Apple developer account when you create an authentication key.
TokenKey *string `pulumi:"tokenKey"`
// The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section.
TokenKeyId *string `pulumi:"tokenKeyId"`
}
type ApnsSandboxChannelState struct {
// The application ID.
ApplicationId pulumi.StringPtrInput
// The ID assigned to your iOS app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and choose your app.
BundleId pulumi.StringPtrInput
// The pem encoded TLS Certificate from Apple.
Certificate pulumi.StringPtrInput
// The default authentication method used for APNs Sandbox.
// __NOTE__: Amazon Pinpoint uses this default for every APNs push notification that you send using the console.
// You can override the default when you send a message programmatically using the Amazon Pinpoint API, the AWS CLI, or an AWS SDK.
// If your default authentication type fails, Amazon Pinpoint doesn't attempt to use the other authentication type.
DefaultAuthenticationMethod pulumi.StringPtrInput
// Whether the channel is enabled or disabled. Defaults to `true`.
Enabled pulumi.BoolPtrInput
// The Certificate Private Key file (ie. `.key` file).
PrivateKey pulumi.StringPtrInput
// The ID assigned to your Apple developer account team. This value is provided on the Membership page.
TeamId pulumi.StringPtrInput
// The `.p8` file that you download from your Apple developer account when you create an authentication key.
TokenKey pulumi.StringPtrInput
// The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section.
TokenKeyId pulumi.StringPtrInput
}
func (ApnsSandboxChannelState) ElementType() reflect.Type {
return reflect.TypeOf((*apnsSandboxChannelState)(nil)).Elem()
}
type apnsSandboxChannelArgs struct {
// The application ID.
ApplicationId string `pulumi:"applicationId"`
// The ID assigned to your iOS app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and choose your app.
BundleId *string `pulumi:"bundleId"`
// The pem encoded TLS Certificate from Apple.
Certificate *string `pulumi:"certificate"`
// The default authentication method used for APNs Sandbox.
// __NOTE__: Amazon Pinpoint uses this default for every APNs push notification that you send using the console.
// You can override the default when you send a message programmatically using the Amazon Pinpoint API, the AWS CLI, or an AWS SDK.
// If your default authentication type fails, Amazon Pinpoint doesn't attempt to use the other authentication type.
DefaultAuthenticationMethod *string `pulumi:"defaultAuthenticationMethod"`
// Whether the channel is enabled or disabled. Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// The Certificate Private Key file (ie. `.key` file).
PrivateKey *string `pulumi:"privateKey"`
// The ID assigned to your Apple developer account team. This value is provided on the Membership page.
TeamId *string `pulumi:"teamId"`
// The `.p8` file that you download from your Apple developer account when you create an authentication key.
TokenKey *string `pulumi:"tokenKey"`
// The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section.
TokenKeyId *string `pulumi:"tokenKeyId"`
}
// The set of arguments for constructing a ApnsSandboxChannel resource.
type ApnsSandboxChannelArgs struct {
// The application ID.
ApplicationId pulumi.StringInput
// The ID assigned to your iOS app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and choose your app.
BundleId pulumi.StringPtrInput
// The pem encoded TLS Certificate from Apple.
Certificate pulumi.StringPtrInput
// The default authentication method used for APNs Sandbox.
// __NOTE__: Amazon Pinpoint uses this default for every APNs push notification that you send using the console.
// You can override the default when you send a message programmatically using the Amazon Pinpoint API, the AWS CLI, or an AWS SDK.
// If your default authentication type fails, Amazon Pinpoint doesn't attempt to use the other authentication type.
DefaultAuthenticationMethod pulumi.StringPtrInput
// Whether the channel is enabled or disabled. Defaults to `true`.
Enabled pulumi.BoolPtrInput
// The Certificate Private Key file (ie. `.key` file).
PrivateKey pulumi.StringPtrInput
// The ID assigned to your Apple developer account team. This value is provided on the Membership page.
TeamId pulumi.StringPtrInput
// The `.p8` file that you download from your Apple developer account when you create an authentication key.
TokenKey pulumi.StringPtrInput
// The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section.
TokenKeyId pulumi.StringPtrInput
}
func (ApnsSandboxChannelArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apnsSandboxChannelArgs)(nil)).Elem()
}
type ApnsSandboxChannelInput interface {
pulumi.Input
ToApnsSandboxChannelOutput() ApnsSandboxChannelOutput
ToApnsSandboxChannelOutputWithContext(ctx context.Context) ApnsSandboxChannelOutput
}
func (*ApnsSandboxChannel) ElementType() reflect.Type {
return reflect.TypeOf((**ApnsSandboxChannel)(nil)).Elem()
}
func (i *ApnsSandboxChannel) ToApnsSandboxChannelOutput() ApnsSandboxChannelOutput {
return i.ToApnsSandboxChannelOutputWithContext(context.Background())
}
func (i *ApnsSandboxChannel) ToApnsSandboxChannelOutputWithContext(ctx context.Context) ApnsSandboxChannelOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApnsSandboxChannelOutput)
}
// ApnsSandboxChannelArrayInput is an input type that accepts ApnsSandboxChannelArray and ApnsSandboxChannelArrayOutput values.
// You can construct a concrete instance of `ApnsSandboxChannelArrayInput` via:
//
// ApnsSandboxChannelArray{ ApnsSandboxChannelArgs{...} }
type ApnsSandboxChannelArrayInput interface {
pulumi.Input
ToApnsSandboxChannelArrayOutput() ApnsSandboxChannelArrayOutput
ToApnsSandboxChannelArrayOutputWithContext(context.Context) ApnsSandboxChannelArrayOutput
}
type ApnsSandboxChannelArray []ApnsSandboxChannelInput
func (ApnsSandboxChannelArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApnsSandboxChannel)(nil)).Elem()
}
func (i ApnsSandboxChannelArray) ToApnsSandboxChannelArrayOutput() ApnsSandboxChannelArrayOutput {
return i.ToApnsSandboxChannelArrayOutputWithContext(context.Background())
}
func (i ApnsSandboxChannelArray) ToApnsSandboxChannelArrayOutputWithContext(ctx context.Context) ApnsSandboxChannelArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApnsSandboxChannelArrayOutput)
}
// ApnsSandboxChannelMapInput is an input type that accepts ApnsSandboxChannelMap and ApnsSandboxChannelMapOutput values.
// You can construct a concrete instance of `ApnsSandboxChannelMapInput` via:
//
// ApnsSandboxChannelMap{ "key": ApnsSandboxChannelArgs{...} }
type ApnsSandboxChannelMapInput interface {
pulumi.Input
ToApnsSandboxChannelMapOutput() ApnsSandboxChannelMapOutput
ToApnsSandboxChannelMapOutputWithContext(context.Context) ApnsSandboxChannelMapOutput
}
type ApnsSandboxChannelMap map[string]ApnsSandboxChannelInput
func (ApnsSandboxChannelMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApnsSandboxChannel)(nil)).Elem()
}
func (i ApnsSandboxChannelMap) ToApnsSandboxChannelMapOutput() ApnsSandboxChannelMapOutput {
return i.ToApnsSandboxChannelMapOutputWithContext(context.Background())
}
func (i ApnsSandboxChannelMap) ToApnsSandboxChannelMapOutputWithContext(ctx context.Context) ApnsSandboxChannelMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApnsSandboxChannelMapOutput)
}
type ApnsSandboxChannelOutput struct{ *pulumi.OutputState }
func (ApnsSandboxChannelOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ApnsSandboxChannel)(nil)).Elem()
}
func (o ApnsSandboxChannelOutput) ToApnsSandboxChannelOutput() ApnsSandboxChannelOutput {
return o
}
func (o ApnsSandboxChannelOutput) ToApnsSandboxChannelOutputWithContext(ctx context.Context) ApnsSandboxChannelOutput {
return o
}
type ApnsSandboxChannelArrayOutput struct{ *pulumi.OutputState }
func (ApnsSandboxChannelArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApnsSandboxChannel)(nil)).Elem()
}
func (o ApnsSandboxChannelArrayOutput) ToApnsSandboxChannelArrayOutput() ApnsSandboxChannelArrayOutput {
return o
}
func (o ApnsSandboxChannelArrayOutput) ToApnsSandboxChannelArrayOutputWithContext(ctx context.Context) ApnsSandboxChannelArrayOutput {
return o
}
func (o ApnsSandboxChannelArrayOutput) Index(i pulumi.IntInput) ApnsSandboxChannelOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApnsSandboxChannel {
return vs[0].([]*ApnsSandboxChannel)[vs[1].(int)]
}).(ApnsSandboxChannelOutput)
}
type ApnsSandboxChannelMapOutput struct{ *pulumi.OutputState }
func (ApnsSandboxChannelMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApnsSandboxChannel)(nil)).Elem()
}
func (o ApnsSandboxChannelMapOutput) ToApnsSandboxChannelMapOutput() ApnsSandboxChannelMapOutput {
return o
}
func (o ApnsSandboxChannelMapOutput) ToApnsSandboxChannelMapOutputWithContext(ctx context.Context) ApnsSandboxChannelMapOutput {
return o
}
func (o ApnsSandboxChannelMapOutput) MapIndex(k pulumi.StringInput) ApnsSandboxChannelOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApnsSandboxChannel {
return vs[0].(map[string]*ApnsSandboxChannel)[vs[1].(string)]
}).(ApnsSandboxChannelOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApnsSandboxChannelInput)(nil)).Elem(), &ApnsSandboxChannel{})
pulumi.RegisterInputType(reflect.TypeOf((*ApnsSandboxChannelArrayInput)(nil)).Elem(), ApnsSandboxChannelArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ApnsSandboxChannelMapInput)(nil)).Elem(), ApnsSandboxChannelMap{})
pulumi.RegisterOutputType(ApnsSandboxChannelOutput{})
pulumi.RegisterOutputType(ApnsSandboxChannelArrayOutput{})
pulumi.RegisterOutputType(ApnsSandboxChannelMapOutput{})
}