-
Notifications
You must be signed in to change notification settings - Fork 51
/
namespace.go
174 lines (155 loc) · 6.36 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
// *** 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 relay
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Azure Relay Namespace.
type Namespace struct {
s *pulumi.ResourceState
}
// NewNamespace registers a new resource with the given unique name, arguments, and options.
func NewNamespace(ctx *pulumi.Context,
name string, args *NamespaceArgs, opts ...pulumi.ResourceOpt) (*Namespace, error) {
if args == nil || args.Location == nil {
return nil, errors.New("missing required argument 'Location'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Sku == nil {
return nil, errors.New("missing required argument 'Sku'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["location"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["sku"] = nil
inputs["tags"] = nil
} else {
inputs["location"] = args.Location
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["sku"] = args.Sku
inputs["tags"] = args.Tags
}
inputs["metricId"] = nil
inputs["primaryConnectionString"] = nil
inputs["primaryKey"] = nil
inputs["secondaryConnectionString"] = nil
inputs["secondaryKey"] = nil
s, err := ctx.RegisterResource("azure:relay/namespace:Namespace", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &Namespace{s: s}, 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.ID, state *NamespaceState, opts ...pulumi.ResourceOpt) (*Namespace, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["location"] = state.Location
inputs["metricId"] = state.MetricId
inputs["name"] = state.Name
inputs["primaryConnectionString"] = state.PrimaryConnectionString
inputs["primaryKey"] = state.PrimaryKey
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["secondaryConnectionString"] = state.SecondaryConnectionString
inputs["secondaryKey"] = state.SecondaryKey
inputs["sku"] = state.Sku
inputs["tags"] = state.Tags
}
s, err := ctx.ReadResource("azure:relay/namespace:Namespace", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &Namespace{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *Namespace) URN() *pulumi.URNOutput {
return r.s.URN
}
// ID is this resource's unique identifier assigned by its provider.
func (r *Namespace) ID() *pulumi.IDOutput {
return r.s.ID
}
// Specifies the supported Azure location where the Azure Relay Namespace exists. Changing this forces a new resource to be created.
func (r *Namespace) Location() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["location"])
}
// The Identifier for Azure Insights metrics.
func (r *Namespace) MetricId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["metricId"])
}
// The name of the SKU to use. At this time the only supported value is `Standard`.
func (r *Namespace) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// The primary connection string for the authorization rule `RootManageSharedAccessKey`.
func (r *Namespace) PrimaryConnectionString() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryConnectionString"])
}
// The primary access key for the authorization rule `RootManageSharedAccessKey`.
func (r *Namespace) PrimaryKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryKey"])
}
// The name of the resource group in which to create the Azure Relay Namespace.
func (r *Namespace) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// The secondary connection string for the authorization rule `RootManageSharedAccessKey`.
func (r *Namespace) SecondaryConnectionString() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryConnectionString"])
}
// The secondary access key for the authorization rule `RootManageSharedAccessKey`.
func (r *Namespace) SecondaryKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryKey"])
}
// A `sku` block as defined below.
func (r *Namespace) Sku() *pulumi.Output {
return r.s.State["sku"]
}
// A mapping of tags to assign to the resource.
func (r *Namespace) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
// Input properties used for looking up and filtering Namespace resources.
type NamespaceState struct {
// Specifies the supported Azure location where the Azure Relay Namespace exists. Changing this forces a new resource to be created.
Location interface{}
// The Identifier for Azure Insights metrics.
MetricId interface{}
// The name of the SKU to use. At this time the only supported value is `Standard`.
Name interface{}
// The primary connection string for the authorization rule `RootManageSharedAccessKey`.
PrimaryConnectionString interface{}
// The primary access key for the authorization rule `RootManageSharedAccessKey`.
PrimaryKey interface{}
// The name of the resource group in which to create the Azure Relay Namespace.
ResourceGroupName interface{}
// The secondary connection string for the authorization rule `RootManageSharedAccessKey`.
SecondaryConnectionString interface{}
// The secondary access key for the authorization rule `RootManageSharedAccessKey`.
SecondaryKey interface{}
// A `sku` block as defined below.
Sku interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}
// The set of arguments for constructing a Namespace resource.
type NamespaceArgs struct {
// Specifies the supported Azure location where the Azure Relay Namespace exists. Changing this forces a new resource to be created.
Location interface{}
// The name of the SKU to use. At this time the only supported value is `Standard`.
Name interface{}
// The name of the resource group in which to create the Azure Relay Namespace.
ResourceGroupName interface{}
// A `sku` block as defined below.
Sku interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}