-
Notifications
You must be signed in to change notification settings - Fork 8
/
role.go
128 lines (115 loc) · 3.72 KB
/
role.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
// *** 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 Role resource within OpenStack Keystone.
//
// Note: You _must_ have admin privileges in your OpenStack cloud to use
// this resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-openstack/sdk/v2/go/openstack/identity"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := identity.NewRole(ctx, "role1", nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type Role struct {
pulumi.CustomResourceState
// The domain the role belongs to.
DomainId pulumi.StringOutput `pulumi:"domainId"`
// The name of the role.
Name pulumi.StringOutput `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 Role.
Region pulumi.StringOutput `pulumi:"region"`
}
// NewRole registers a new resource with the given unique name, arguments, and options.
func NewRole(ctx *pulumi.Context,
name string, args *RoleArgs, opts ...pulumi.ResourceOption) (*Role, error) {
if args == nil {
args = &RoleArgs{}
}
var resource Role
err := ctx.RegisterResource("openstack:identity/role:Role", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRole gets an existing Role 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 GetRole(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RoleState, opts ...pulumi.ResourceOption) (*Role, error) {
var resource Role
err := ctx.ReadResource("openstack:identity/role:Role", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Role resources.
type roleState struct {
// The domain the role belongs to.
DomainId *string `pulumi:"domainId"`
// The name of the role.
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 Role.
Region *string `pulumi:"region"`
}
type RoleState struct {
// The domain the role belongs to.
DomainId pulumi.StringPtrInput
// The name of the role.
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 Role.
Region pulumi.StringPtrInput
}
func (RoleState) ElementType() reflect.Type {
return reflect.TypeOf((*roleState)(nil)).Elem()
}
type roleArgs struct {
// The domain the role belongs to.
DomainId *string `pulumi:"domainId"`
// The name of the role.
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 Role.
Region *string `pulumi:"region"`
}
// The set of arguments for constructing a Role resource.
type RoleArgs struct {
// The domain the role belongs to.
DomainId pulumi.StringPtrInput
// The name of the role.
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 Role.
Region pulumi.StringPtrInput
}
func (RoleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*roleArgs)(nil)).Elem()
}