-
Notifications
You must be signed in to change notification settings - Fork 51
/
endpointStorageContainer.go
239 lines (226 loc) · 13 KB
/
endpointStorageContainer.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
// *** 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 iot
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages an IotHub Storage Container Endpoint
//
// > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/iot"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/storage"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
// Location: pulumi.String("West US"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// AccountTier: pulumi.String("Standard"),
// AccountReplicationType: pulumi.String("LRS"),
// })
// if err != nil {
// return err
// }
// _, err = storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{
// StorageAccountName: exampleAccount.Name,
// ContainerAccessType: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// Sku: &iot.IoTHubSkuArgs{
// Name: pulumi.String("S1"),
// Capacity: pulumi.Int(1),
// },
// })
// if err != nil {
// return err
// }
// _, err = iot.NewEndpointStorageContainer(ctx, "exampleEndpointStorageContainer", &iot.EndpointStorageContainerArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// IothubName: exampleIoTHub.Name,
// ContainerName: pulumi.String("acctestcont"),
// ConnectionString: exampleAccount.PrimaryBlobConnectionString,
// FileNameFormat: pulumi.String("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"),
// BatchFrequencyInSeconds: pulumi.Int(60),
// MaxChunkSizeInBytes: pulumi.Int(10485760),
// Encoding: pulumi.String("JSON"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type EndpointStorageContainer struct {
pulumi.CustomResourceState
// Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.
BatchFrequencyInSeconds pulumi.IntPtrOutput `pulumi:"batchFrequencyInSeconds"`
// The connection string for the endpoint.
ConnectionString pulumi.StringOutput `pulumi:"connectionString"`
// The name of storage container in the storage account.
// *
ContainerName pulumi.StringOutput `pulumi:"containerName"`
// Encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'.
Encoding pulumi.StringPtrOutput `pulumi:"encoding"`
// File name format for the blob. Default format is ``{iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}``. All parameters are mandatory but can be reordered.
FileNameFormat pulumi.StringPtrOutput `pulumi:"fileNameFormat"`
// The name of the IoTHub to which this Storage Container Endpoint belongs. Changing this forces a new resource to be created.
IothubName pulumi.StringOutput `pulumi:"iothubName"`
// Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
MaxChunkSizeInBytes pulumi.IntPtrOutput `pulumi:"maxChunkSizeInBytes"`
// The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewEndpointStorageContainer registers a new resource with the given unique name, arguments, and options.
func NewEndpointStorageContainer(ctx *pulumi.Context,
name string, args *EndpointStorageContainerArgs, opts ...pulumi.ResourceOption) (*EndpointStorageContainer, error) {
if args == nil || args.ConnectionString == nil {
return nil, errors.New("missing required argument 'ConnectionString'")
}
if args == nil || args.ContainerName == nil {
return nil, errors.New("missing required argument 'ContainerName'")
}
if args == nil || args.IothubName == nil {
return nil, errors.New("missing required argument 'IothubName'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil {
args = &EndpointStorageContainerArgs{}
}
var resource EndpointStorageContainer
err := ctx.RegisterResource("azure:iot/endpointStorageContainer:EndpointStorageContainer", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEndpointStorageContainer gets an existing EndpointStorageContainer 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 GetEndpointStorageContainer(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EndpointStorageContainerState, opts ...pulumi.ResourceOption) (*EndpointStorageContainer, error) {
var resource EndpointStorageContainer
err := ctx.ReadResource("azure:iot/endpointStorageContainer:EndpointStorageContainer", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EndpointStorageContainer resources.
type endpointStorageContainerState struct {
// Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.
BatchFrequencyInSeconds *int `pulumi:"batchFrequencyInSeconds"`
// The connection string for the endpoint.
ConnectionString *string `pulumi:"connectionString"`
// The name of storage container in the storage account.
// *
ContainerName *string `pulumi:"containerName"`
// Encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'.
Encoding *string `pulumi:"encoding"`
// File name format for the blob. Default format is ``{iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}``. All parameters are mandatory but can be reordered.
FileNameFormat *string `pulumi:"fileNameFormat"`
// The name of the IoTHub to which this Storage Container Endpoint belongs. Changing this forces a new resource to be created.
IothubName *string `pulumi:"iothubName"`
// Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
MaxChunkSizeInBytes *int `pulumi:"maxChunkSizeInBytes"`
// The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`.
Name *string `pulumi:"name"`
// The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type EndpointStorageContainerState struct {
// Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.
BatchFrequencyInSeconds pulumi.IntPtrInput
// The connection string for the endpoint.
ConnectionString pulumi.StringPtrInput
// The name of storage container in the storage account.
// *
ContainerName pulumi.StringPtrInput
// Encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'.
Encoding pulumi.StringPtrInput
// File name format for the blob. Default format is ``{iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}``. All parameters are mandatory but can be reordered.
FileNameFormat pulumi.StringPtrInput
// The name of the IoTHub to which this Storage Container Endpoint belongs. Changing this forces a new resource to be created.
IothubName pulumi.StringPtrInput
// Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
MaxChunkSizeInBytes pulumi.IntPtrInput
// The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`.
Name pulumi.StringPtrInput
// The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
}
func (EndpointStorageContainerState) ElementType() reflect.Type {
return reflect.TypeOf((*endpointStorageContainerState)(nil)).Elem()
}
type endpointStorageContainerArgs struct {
// Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.
BatchFrequencyInSeconds *int `pulumi:"batchFrequencyInSeconds"`
// The connection string for the endpoint.
ConnectionString string `pulumi:"connectionString"`
// The name of storage container in the storage account.
// *
ContainerName string `pulumi:"containerName"`
// Encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'.
Encoding *string `pulumi:"encoding"`
// File name format for the blob. Default format is ``{iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}``. All parameters are mandatory but can be reordered.
FileNameFormat *string `pulumi:"fileNameFormat"`
// The name of the IoTHub to which this Storage Container Endpoint belongs. Changing this forces a new resource to be created.
IothubName string `pulumi:"iothubName"`
// Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
MaxChunkSizeInBytes *int `pulumi:"maxChunkSizeInBytes"`
// The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`.
Name *string `pulumi:"name"`
// The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a EndpointStorageContainer resource.
type EndpointStorageContainerArgs struct {
// Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.
BatchFrequencyInSeconds pulumi.IntPtrInput
// The connection string for the endpoint.
ConnectionString pulumi.StringInput
// The name of storage container in the storage account.
// *
ContainerName pulumi.StringInput
// Encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'.
Encoding pulumi.StringPtrInput
// File name format for the blob. Default format is ``{iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}``. All parameters are mandatory but can be reordered.
FileNameFormat pulumi.StringPtrInput
// The name of the IoTHub to which this Storage Container Endpoint belongs. Changing this forces a new resource to be created.
IothubName pulumi.StringInput
// Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
MaxChunkSizeInBytes pulumi.IntPtrInput
// The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`.
Name pulumi.StringPtrInput
// The name of the resource group under which the IotHub Storage Container Endpoint resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
}
func (EndpointStorageContainerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*endpointStorageContainerArgs)(nil)).Elem()
}