-
Notifications
You must be signed in to change notification settings - Fork 8
/
applicationCredential.go
250 lines (237 loc) · 12 KB
/
applicationCredential.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
// *** 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 identity
import (
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages a V3 Application Credential resource within OpenStack Keystone.
//
// > **Note:** All arguments including the application credential name and secret
// will be stored in the raw state as plain-text. [Read more about sensitive data
// in state](https://www.terraform.io/docs/state/sensitive-data.html).
//
// > **Note:** An Application Credential is created within the authenticated user
// project scope and is not visible by an admin or other accounts.
// The Application Credential visibility is similar to
// `compute.Keypair`.
type ApplicationCredential struct {
pulumi.CustomResourceState
// A collection of one or more access rules, which
// this application credential allows to follow. The structure is described
// below. Changing this creates a new application credential.
AccessRules ApplicationCredentialAccessRuleArrayOutput `pulumi:"accessRules"`
// A description of the application credential.
// Changing this creates a new application credential.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The expiration time of the application credential
// in the RFC3339 timestamp format (e.g. `2019-03-09T12:58:49Z`). If omitted,
// an application credential will never expire. Changing this creates a new
// application credential.
ExpiresAt pulumi.StringPtrOutput `pulumi:"expiresAt"`
// A name of the application credential. Changing this
// creates a new application credential.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the project the application credential was created
// for and that authentication requests using this application credential will
// be scoped to.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new application credential.
Region pulumi.StringOutput `pulumi:"region"`
// A collection of one or more role names, which this
// application credential has to be associated with its project. If omitted,
// all the current user's roles within the scoped project will be inherited by
// a new application credential. Changing this creates a new application
// credential.
Roles pulumi.StringArrayOutput `pulumi:"roles"`
// The secret for the application credential. If omitted,
// it will be generated by the server. Changing this creates a new application
// credential.
Secret pulumi.StringOutput `pulumi:"secret"`
// A flag indicating whether the application
// credential may be used for creation or destruction of other application
// credentials or trusts. Changing this creates a new application credential.
Unrestricted pulumi.BoolPtrOutput `pulumi:"unrestricted"`
}
// NewApplicationCredential registers a new resource with the given unique name, arguments, and options.
func NewApplicationCredential(ctx *pulumi.Context,
name string, args *ApplicationCredentialArgs, opts ...pulumi.ResourceOption) (*ApplicationCredential, error) {
if args == nil {
args = &ApplicationCredentialArgs{}
}
var resource ApplicationCredential
err := ctx.RegisterResource("openstack:identity/applicationCredential:ApplicationCredential", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApplicationCredential gets an existing ApplicationCredential 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 GetApplicationCredential(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApplicationCredentialState, opts ...pulumi.ResourceOption) (*ApplicationCredential, error) {
var resource ApplicationCredential
err := ctx.ReadResource("openstack:identity/applicationCredential:ApplicationCredential", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApplicationCredential resources.
type applicationCredentialState struct {
// A collection of one or more access rules, which
// this application credential allows to follow. The structure is described
// below. Changing this creates a new application credential.
AccessRules []ApplicationCredentialAccessRule `pulumi:"accessRules"`
// A description of the application credential.
// Changing this creates a new application credential.
Description *string `pulumi:"description"`
// The expiration time of the application credential
// in the RFC3339 timestamp format (e.g. `2019-03-09T12:58:49Z`). If omitted,
// an application credential will never expire. Changing this creates a new
// application credential.
ExpiresAt *string `pulumi:"expiresAt"`
// A name of the application credential. Changing this
// creates a new application credential.
Name *string `pulumi:"name"`
// The ID of the project the application credential was created
// for and that authentication requests using this application credential will
// be scoped to.
ProjectId *string `pulumi:"projectId"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new application credential.
Region *string `pulumi:"region"`
// A collection of one or more role names, which this
// application credential has to be associated with its project. If omitted,
// all the current user's roles within the scoped project will be inherited by
// a new application credential. Changing this creates a new application
// credential.
Roles []string `pulumi:"roles"`
// The secret for the application credential. If omitted,
// it will be generated by the server. Changing this creates a new application
// credential.
Secret *string `pulumi:"secret"`
// A flag indicating whether the application
// credential may be used for creation or destruction of other application
// credentials or trusts. Changing this creates a new application credential.
Unrestricted *bool `pulumi:"unrestricted"`
}
type ApplicationCredentialState struct {
// A collection of one or more access rules, which
// this application credential allows to follow. The structure is described
// below. Changing this creates a new application credential.
AccessRules ApplicationCredentialAccessRuleArrayInput
// A description of the application credential.
// Changing this creates a new application credential.
Description pulumi.StringPtrInput
// The expiration time of the application credential
// in the RFC3339 timestamp format (e.g. `2019-03-09T12:58:49Z`). If omitted,
// an application credential will never expire. Changing this creates a new
// application credential.
ExpiresAt pulumi.StringPtrInput
// A name of the application credential. Changing this
// creates a new application credential.
Name pulumi.StringPtrInput
// The ID of the project the application credential was created
// for and that authentication requests using this application credential will
// be scoped to.
ProjectId pulumi.StringPtrInput
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new application credential.
Region pulumi.StringPtrInput
// A collection of one or more role names, which this
// application credential has to be associated with its project. If omitted,
// all the current user's roles within the scoped project will be inherited by
// a new application credential. Changing this creates a new application
// credential.
Roles pulumi.StringArrayInput
// The secret for the application credential. If omitted,
// it will be generated by the server. Changing this creates a new application
// credential.
Secret pulumi.StringPtrInput
// A flag indicating whether the application
// credential may be used for creation or destruction of other application
// credentials or trusts. Changing this creates a new application credential.
Unrestricted pulumi.BoolPtrInput
}
func (ApplicationCredentialState) ElementType() reflect.Type {
return reflect.TypeOf((*applicationCredentialState)(nil)).Elem()
}
type applicationCredentialArgs struct {
// A collection of one or more access rules, which
// this application credential allows to follow. The structure is described
// below. Changing this creates a new application credential.
AccessRules []ApplicationCredentialAccessRule `pulumi:"accessRules"`
// A description of the application credential.
// Changing this creates a new application credential.
Description *string `pulumi:"description"`
// The expiration time of the application credential
// in the RFC3339 timestamp format (e.g. `2019-03-09T12:58:49Z`). If omitted,
// an application credential will never expire. Changing this creates a new
// application credential.
ExpiresAt *string `pulumi:"expiresAt"`
// A name of the application credential. Changing this
// creates a new application credential.
Name *string `pulumi:"name"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new application credential.
Region *string `pulumi:"region"`
// A collection of one or more role names, which this
// application credential has to be associated with its project. If omitted,
// all the current user's roles within the scoped project will be inherited by
// a new application credential. Changing this creates a new application
// credential.
Roles []string `pulumi:"roles"`
// The secret for the application credential. If omitted,
// it will be generated by the server. Changing this creates a new application
// credential.
Secret *string `pulumi:"secret"`
// A flag indicating whether the application
// credential may be used for creation or destruction of other application
// credentials or trusts. Changing this creates a new application credential.
Unrestricted *bool `pulumi:"unrestricted"`
}
// The set of arguments for constructing a ApplicationCredential resource.
type ApplicationCredentialArgs struct {
// A collection of one or more access rules, which
// this application credential allows to follow. The structure is described
// below. Changing this creates a new application credential.
AccessRules ApplicationCredentialAccessRuleArrayInput
// A description of the application credential.
// Changing this creates a new application credential.
Description pulumi.StringPtrInput
// The expiration time of the application credential
// in the RFC3339 timestamp format (e.g. `2019-03-09T12:58:49Z`). If omitted,
// an application credential will never expire. Changing this creates a new
// application credential.
ExpiresAt pulumi.StringPtrInput
// A name of the application credential. Changing this
// creates a new application credential.
Name pulumi.StringPtrInput
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new application credential.
Region pulumi.StringPtrInput
// A collection of one or more role names, which this
// application credential has to be associated with its project. If omitted,
// all the current user's roles within the scoped project will be inherited by
// a new application credential. Changing this creates a new application
// credential.
Roles pulumi.StringArrayInput
// The secret for the application credential. If omitted,
// it will be generated by the server. Changing this creates a new application
// credential.
Secret pulumi.StringPtrInput
// A flag indicating whether the application
// credential may be used for creation or destruction of other application
// credentials or trusts. Changing this creates a new application credential.
Unrestricted pulumi.BoolPtrInput
}
func (ApplicationCredentialArgs) ElementType() reflect.Type {
return reflect.TypeOf((*applicationCredentialArgs)(nil)).Elem()
}