-
Notifications
You must be signed in to change notification settings - Fork 17
/
apiKey.go
146 lines (116 loc) · 4.37 KB
/
apiKey.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package appsync
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for AWS::AppSync::ApiKey
//
// Deprecated: ApiKey is not yet supported by AWS Native, so its creation will currently fail. Please use the classic AWS provider, if possible.
type ApiKey struct {
pulumi.CustomResourceState
ApiId pulumi.StringOutput `pulumi:"apiId"`
ApiKey pulumi.StringOutput `pulumi:"apiKey"`
ApiKeyId pulumi.StringOutput `pulumi:"apiKeyId"`
Arn pulumi.StringOutput `pulumi:"arn"`
Description pulumi.StringPtrOutput `pulumi:"description"`
Expires pulumi.Float64PtrOutput `pulumi:"expires"`
}
// NewApiKey registers a new resource with the given unique name, arguments, and options.
func NewApiKey(ctx *pulumi.Context,
name string, args *ApiKeyArgs, opts ...pulumi.ResourceOption) (*ApiKey, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiId == nil {
return nil, errors.New("invalid value for required argument 'ApiId'")
}
var resource ApiKey
err := ctx.RegisterResource("aws-native:appsync:ApiKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApiKey gets an existing ApiKey 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 GetApiKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiKeyState, opts ...pulumi.ResourceOption) (*ApiKey, error) {
var resource ApiKey
err := ctx.ReadResource("aws-native:appsync:ApiKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApiKey resources.
type apiKeyState struct {
}
type ApiKeyState struct {
}
func (ApiKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*apiKeyState)(nil)).Elem()
}
type apiKeyArgs struct {
ApiId string `pulumi:"apiId"`
Description *string `pulumi:"description"`
Expires *float64 `pulumi:"expires"`
}
// The set of arguments for constructing a ApiKey resource.
type ApiKeyArgs struct {
ApiId pulumi.StringInput
Description pulumi.StringPtrInput
Expires pulumi.Float64PtrInput
}
func (ApiKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiKeyArgs)(nil)).Elem()
}
type ApiKeyInput interface {
pulumi.Input
ToApiKeyOutput() ApiKeyOutput
ToApiKeyOutputWithContext(ctx context.Context) ApiKeyOutput
}
func (*ApiKey) ElementType() reflect.Type {
return reflect.TypeOf((**ApiKey)(nil)).Elem()
}
func (i *ApiKey) ToApiKeyOutput() ApiKeyOutput {
return i.ToApiKeyOutputWithContext(context.Background())
}
func (i *ApiKey) ToApiKeyOutputWithContext(ctx context.Context) ApiKeyOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiKeyOutput)
}
type ApiKeyOutput struct{ *pulumi.OutputState }
func (ApiKeyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ApiKey)(nil)).Elem()
}
func (o ApiKeyOutput) ToApiKeyOutput() ApiKeyOutput {
return o
}
func (o ApiKeyOutput) ToApiKeyOutputWithContext(ctx context.Context) ApiKeyOutput {
return o
}
func (o ApiKeyOutput) ApiId() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.ApiId }).(pulumi.StringOutput)
}
func (o ApiKeyOutput) ApiKey() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.ApiKey }).(pulumi.StringOutput)
}
func (o ApiKeyOutput) ApiKeyId() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.ApiKeyId }).(pulumi.StringOutput)
}
func (o ApiKeyOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
func (o ApiKeyOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
func (o ApiKeyOutput) Expires() pulumi.Float64PtrOutput {
return o.ApplyT(func(v *ApiKey) pulumi.Float64PtrOutput { return v.Expires }).(pulumi.Float64PtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApiKeyInput)(nil)).Elem(), &ApiKey{})
pulumi.RegisterOutputType(ApiKeyOutput{})
}