/
table.go
194 lines (162 loc) · 7.48 KB
/
table.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
// 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 timestream
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The AWS::Timestream::Table resource creates a Timestream Table.
type Table struct {
pulumi.CustomResourceState
Arn pulumi.StringOutput `pulumi:"arn"`
// The name for the database which the table to be created belongs to.
DatabaseName pulumi.StringOutput `pulumi:"databaseName"`
// The properties that determine whether magnetic store writes are enabled.
MagneticStoreWriteProperties MagneticStoreWritePropertiesPropertiesPtrOutput `pulumi:"magneticStoreWriteProperties"`
// The table name exposed as a read-only attribute.
Name pulumi.StringOutput `pulumi:"name"`
// The retention duration of the memory store and the magnetic store.
RetentionProperties RetentionPropertiesPropertiesPtrOutput `pulumi:"retentionProperties"`
// A Schema specifies the expected data model of the table.
Schema SchemaPropertiesPtrOutput `pulumi:"schema"`
// The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.
TableName pulumi.StringPtrOutput `pulumi:"tableName"`
// An array of key-value pairs to apply to this resource.
Tags aws.TagArrayOutput `pulumi:"tags"`
}
// NewTable registers a new resource with the given unique name, arguments, and options.
func NewTable(ctx *pulumi.Context,
name string, args *TableArgs, opts ...pulumi.ResourceOption) (*Table, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DatabaseName == nil {
return nil, errors.New("invalid value for required argument 'DatabaseName'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"databaseName",
"tableName",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Table
err := ctx.RegisterResource("aws-native:timestream:Table", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTable gets an existing Table 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 GetTable(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TableState, opts ...pulumi.ResourceOption) (*Table, error) {
var resource Table
err := ctx.ReadResource("aws-native:timestream:Table", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Table resources.
type tableState struct {
}
type TableState struct {
}
func (TableState) ElementType() reflect.Type {
return reflect.TypeOf((*tableState)(nil)).Elem()
}
type tableArgs struct {
// The name for the database which the table to be created belongs to.
DatabaseName string `pulumi:"databaseName"`
// The properties that determine whether magnetic store writes are enabled.
MagneticStoreWriteProperties *MagneticStoreWritePropertiesProperties `pulumi:"magneticStoreWriteProperties"`
// The retention duration of the memory store and the magnetic store.
RetentionProperties *RetentionPropertiesProperties `pulumi:"retentionProperties"`
// A Schema specifies the expected data model of the table.
Schema *SchemaProperties `pulumi:"schema"`
// The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.
TableName *string `pulumi:"tableName"`
// An array of key-value pairs to apply to this resource.
Tags []aws.Tag `pulumi:"tags"`
}
// The set of arguments for constructing a Table resource.
type TableArgs struct {
// The name for the database which the table to be created belongs to.
DatabaseName pulumi.StringInput
// The properties that determine whether magnetic store writes are enabled.
MagneticStoreWriteProperties MagneticStoreWritePropertiesPropertiesPtrInput
// The retention duration of the memory store and the magnetic store.
RetentionProperties RetentionPropertiesPropertiesPtrInput
// A Schema specifies the expected data model of the table.
Schema SchemaPropertiesPtrInput
// The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.
TableName pulumi.StringPtrInput
// An array of key-value pairs to apply to this resource.
Tags aws.TagArrayInput
}
func (TableArgs) ElementType() reflect.Type {
return reflect.TypeOf((*tableArgs)(nil)).Elem()
}
type TableInput interface {
pulumi.Input
ToTableOutput() TableOutput
ToTableOutputWithContext(ctx context.Context) TableOutput
}
func (*Table) ElementType() reflect.Type {
return reflect.TypeOf((**Table)(nil)).Elem()
}
func (i *Table) ToTableOutput() TableOutput {
return i.ToTableOutputWithContext(context.Background())
}
func (i *Table) ToTableOutputWithContext(ctx context.Context) TableOutput {
return pulumi.ToOutputWithContext(ctx, i).(TableOutput)
}
type TableOutput struct{ *pulumi.OutputState }
func (TableOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Table)(nil)).Elem()
}
func (o TableOutput) ToTableOutput() TableOutput {
return o
}
func (o TableOutput) ToTableOutputWithContext(ctx context.Context) TableOutput {
return o
}
func (o TableOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *Table) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The name for the database which the table to be created belongs to.
func (o TableOutput) DatabaseName() pulumi.StringOutput {
return o.ApplyT(func(v *Table) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput)
}
// The properties that determine whether magnetic store writes are enabled.
func (o TableOutput) MagneticStoreWriteProperties() MagneticStoreWritePropertiesPropertiesPtrOutput {
return o.ApplyT(func(v *Table) MagneticStoreWritePropertiesPropertiesPtrOutput { return v.MagneticStoreWriteProperties }).(MagneticStoreWritePropertiesPropertiesPtrOutput)
}
// The table name exposed as a read-only attribute.
func (o TableOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Table) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The retention duration of the memory store and the magnetic store.
func (o TableOutput) RetentionProperties() RetentionPropertiesPropertiesPtrOutput {
return o.ApplyT(func(v *Table) RetentionPropertiesPropertiesPtrOutput { return v.RetentionProperties }).(RetentionPropertiesPropertiesPtrOutput)
}
// A Schema specifies the expected data model of the table.
func (o TableOutput) Schema() SchemaPropertiesPtrOutput {
return o.ApplyT(func(v *Table) SchemaPropertiesPtrOutput { return v.Schema }).(SchemaPropertiesPtrOutput)
}
// The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.
func (o TableOutput) TableName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Table) pulumi.StringPtrOutput { return v.TableName }).(pulumi.StringPtrOutput)
}
// An array of key-value pairs to apply to this resource.
func (o TableOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *Table) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TableInput)(nil)).Elem(), &Table{})
pulumi.RegisterOutputType(TableOutput{})
}