forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
namespace.go
284 lines (245 loc) · 13 KB
/
namespace.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
// 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 eventgrid
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Namespace resource.
// Azure REST API version: 2023-06-01-preview.
//
// Other available API versions: 2023-12-15-preview, 2024-06-01-preview.
type Namespace struct {
pulumi.CustomResourceState
// Identity information for the Namespace resource.
Identity IdentityInfoResponsePtrOutput `pulumi:"identity"`
// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
InboundIpRules InboundIpRuleResponseArrayOutput `pulumi:"inboundIpRules"`
// Allows the user to specify if the service is zone-redundant. This is a required property and user needs to specify this value explicitly.
// Once specified, this property cannot be updated.
IsZoneRedundant pulumi.BoolPtrOutput `pulumi:"isZoneRedundant"`
// Location of the resource.
Location pulumi.StringOutput `pulumi:"location"`
// Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported.
MinimumTlsVersionAllowed pulumi.StringPtrOutput `pulumi:"minimumTlsVersionAllowed"`
// Name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
PrivateEndpointConnections PrivateEndpointConnectionResponseArrayOutput `pulumi:"privateEndpointConnections"`
// Provisioning state of the namespace resource.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// This determines if traffic is allowed over public network. By default it is enabled.
// You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceProperties.InboundIpRules" />
PublicNetworkAccess pulumi.StringPtrOutput `pulumi:"publicNetworkAccess"`
// Represents available Sku pricing tiers.
Sku NamespaceSkuResponsePtrOutput `pulumi:"sku"`
// The system metadata relating to the namespace resource.
SystemData SystemDataResponseOutput `pulumi:"systemData"`
// Tags of the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Topic spaces configuration information for the namespace resource
TopicSpacesConfiguration TopicSpacesConfigurationResponsePtrOutput `pulumi:"topicSpacesConfiguration"`
// Topics configuration information for the namespace resource
TopicsConfiguration TopicsConfigurationResponsePtrOutput `pulumi:"topicsConfiguration"`
// Type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewNamespace registers a new resource with the given unique name, arguments, and options.
func NewNamespace(ctx *pulumi.Context,
name string, args *NamespaceArgs, opts ...pulumi.ResourceOption) (*Namespace, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.TopicSpacesConfiguration != nil {
args.TopicSpacesConfiguration = args.TopicSpacesConfiguration.ToTopicSpacesConfigurationPtrOutput().ApplyT(func(v *TopicSpacesConfiguration) *TopicSpacesConfiguration { return v.Defaults() }).(TopicSpacesConfigurationPtrOutput)
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:eventgrid/v20230601preview:Namespace"),
},
{
Type: pulumi.String("azure-native:eventgrid/v20231215preview:Namespace"),
},
{
Type: pulumi.String("azure-native:eventgrid/v20240601preview:Namespace"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource Namespace
err := ctx.RegisterResource("azure-native:eventgrid:Namespace", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNamespace gets an existing Namespace 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 GetNamespace(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NamespaceState, opts ...pulumi.ResourceOption) (*Namespace, error) {
var resource Namespace
err := ctx.ReadResource("azure-native:eventgrid:Namespace", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Namespace resources.
type namespaceState struct {
}
type NamespaceState struct {
}
func (NamespaceState) ElementType() reflect.Type {
return reflect.TypeOf((*namespaceState)(nil)).Elem()
}
type namespaceArgs struct {
// Identity information for the Namespace resource.
Identity *IdentityInfo `pulumi:"identity"`
// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
InboundIpRules []InboundIpRule `pulumi:"inboundIpRules"`
// Allows the user to specify if the service is zone-redundant. This is a required property and user needs to specify this value explicitly.
// Once specified, this property cannot be updated.
IsZoneRedundant *bool `pulumi:"isZoneRedundant"`
// Location of the resource.
Location *string `pulumi:"location"`
// Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported.
MinimumTlsVersionAllowed *string `pulumi:"minimumTlsVersionAllowed"`
// Name of the namespace.
NamespaceName *string `pulumi:"namespaceName"`
PrivateEndpointConnections []PrivateEndpointConnectionType `pulumi:"privateEndpointConnections"`
// This determines if traffic is allowed over public network. By default it is enabled.
// You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceProperties.InboundIpRules" />
PublicNetworkAccess *string `pulumi:"publicNetworkAccess"`
// The name of the resource group within the user's subscription.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Represents available Sku pricing tiers.
Sku *NamespaceSku `pulumi:"sku"`
// Tags of the resource.
Tags map[string]string `pulumi:"tags"`
// Topic spaces configuration information for the namespace resource
TopicSpacesConfiguration *TopicSpacesConfiguration `pulumi:"topicSpacesConfiguration"`
}
// The set of arguments for constructing a Namespace resource.
type NamespaceArgs struct {
// Identity information for the Namespace resource.
Identity IdentityInfoPtrInput
// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
InboundIpRules InboundIpRuleArrayInput
// Allows the user to specify if the service is zone-redundant. This is a required property and user needs to specify this value explicitly.
// Once specified, this property cannot be updated.
IsZoneRedundant pulumi.BoolPtrInput
// Location of the resource.
Location pulumi.StringPtrInput
// Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported.
MinimumTlsVersionAllowed pulumi.StringPtrInput
// Name of the namespace.
NamespaceName pulumi.StringPtrInput
PrivateEndpointConnections PrivateEndpointConnectionTypeArrayInput
// This determines if traffic is allowed over public network. By default it is enabled.
// You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceProperties.InboundIpRules" />
PublicNetworkAccess pulumi.StringPtrInput
// The name of the resource group within the user's subscription.
ResourceGroupName pulumi.StringInput
// Represents available Sku pricing tiers.
Sku NamespaceSkuPtrInput
// Tags of the resource.
Tags pulumi.StringMapInput
// Topic spaces configuration information for the namespace resource
TopicSpacesConfiguration TopicSpacesConfigurationPtrInput
}
func (NamespaceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*namespaceArgs)(nil)).Elem()
}
type NamespaceInput interface {
pulumi.Input
ToNamespaceOutput() NamespaceOutput
ToNamespaceOutputWithContext(ctx context.Context) NamespaceOutput
}
func (*Namespace) ElementType() reflect.Type {
return reflect.TypeOf((**Namespace)(nil)).Elem()
}
func (i *Namespace) ToNamespaceOutput() NamespaceOutput {
return i.ToNamespaceOutputWithContext(context.Background())
}
func (i *Namespace) ToNamespaceOutputWithContext(ctx context.Context) NamespaceOutput {
return pulumi.ToOutputWithContext(ctx, i).(NamespaceOutput)
}
type NamespaceOutput struct{ *pulumi.OutputState }
func (NamespaceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Namespace)(nil)).Elem()
}
func (o NamespaceOutput) ToNamespaceOutput() NamespaceOutput {
return o
}
func (o NamespaceOutput) ToNamespaceOutputWithContext(ctx context.Context) NamespaceOutput {
return o
}
// Identity information for the Namespace resource.
func (o NamespaceOutput) Identity() IdentityInfoResponsePtrOutput {
return o.ApplyT(func(v *Namespace) IdentityInfoResponsePtrOutput { return v.Identity }).(IdentityInfoResponsePtrOutput)
}
// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
func (o NamespaceOutput) InboundIpRules() InboundIpRuleResponseArrayOutput {
return o.ApplyT(func(v *Namespace) InboundIpRuleResponseArrayOutput { return v.InboundIpRules }).(InboundIpRuleResponseArrayOutput)
}
// Allows the user to specify if the service is zone-redundant. This is a required property and user needs to specify this value explicitly.
// Once specified, this property cannot be updated.
func (o NamespaceOutput) IsZoneRedundant() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Namespace) pulumi.BoolPtrOutput { return v.IsZoneRedundant }).(pulumi.BoolPtrOutput)
}
// Location of the resource.
func (o NamespaceOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported.
func (o NamespaceOutput) MinimumTlsVersionAllowed() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringPtrOutput { return v.MinimumTlsVersionAllowed }).(pulumi.StringPtrOutput)
}
// Name of the resource.
func (o NamespaceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o NamespaceOutput) PrivateEndpointConnections() PrivateEndpointConnectionResponseArrayOutput {
return o.ApplyT(func(v *Namespace) PrivateEndpointConnectionResponseArrayOutput { return v.PrivateEndpointConnections }).(PrivateEndpointConnectionResponseArrayOutput)
}
// Provisioning state of the namespace resource.
func (o NamespaceOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.ProvisioningState }).(pulumi.StringOutput)
}
// This determines if traffic is allowed over public network. By default it is enabled.
// You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceProperties.InboundIpRules" />
func (o NamespaceOutput) PublicNetworkAccess() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringPtrOutput { return v.PublicNetworkAccess }).(pulumi.StringPtrOutput)
}
// Represents available Sku pricing tiers.
func (o NamespaceOutput) Sku() NamespaceSkuResponsePtrOutput {
return o.ApplyT(func(v *Namespace) NamespaceSkuResponsePtrOutput { return v.Sku }).(NamespaceSkuResponsePtrOutput)
}
// The system metadata relating to the namespace resource.
func (o NamespaceOutput) SystemData() SystemDataResponseOutput {
return o.ApplyT(func(v *Namespace) SystemDataResponseOutput { return v.SystemData }).(SystemDataResponseOutput)
}
// Tags of the resource.
func (o NamespaceOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Topic spaces configuration information for the namespace resource
func (o NamespaceOutput) TopicSpacesConfiguration() TopicSpacesConfigurationResponsePtrOutput {
return o.ApplyT(func(v *Namespace) TopicSpacesConfigurationResponsePtrOutput { return v.TopicSpacesConfiguration }).(TopicSpacesConfigurationResponsePtrOutput)
}
// Topics configuration information for the namespace resource
func (o NamespaceOutput) TopicsConfiguration() TopicsConfigurationResponsePtrOutput {
return o.ApplyT(func(v *Namespace) TopicsConfigurationResponsePtrOutput { return v.TopicsConfiguration }).(TopicsConfigurationResponsePtrOutput)
}
// Type of the resource.
func (o NamespaceOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(NamespaceOutput{})
}