generated from pulumi/pulumi-tf-provider-boilerplate
/
getCustomRole.go
167 lines (145 loc) · 5.33 KB
/
getCustomRole.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package iam
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get the ID of an IAM **custom policy**.
//
// > You *must* have IAM read privileges to use this data source.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Iam"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Iam"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Iam.GetCustomRole(ctx, &iam.GetCustomRoleArgs{
// Name: pulumi.StringRef("custom_role"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetCustomRole(ctx *pulumi.Context, args *GetCustomRoleArgs, opts ...pulumi.InvokeOption) (*GetCustomRoleResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetCustomRoleResult
err := ctx.Invoke("huaweicloud:Iam/getCustomRole:getCustomRole", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCustomRole.
type GetCustomRoleArgs struct {
// Description of the custom policy.
Description *string `pulumi:"description"`
// The domain the policy belongs to.
DomainId *string `pulumi:"domainId"`
// ID of the custom policy.
Id *string `pulumi:"id"`
// Name of the custom policy.
Name *string `pulumi:"name"`
// The number of citations for the custom policy.
References *int `pulumi:"references"`
// Display mode. Valid options are *AX*: Account level and *XA*: Project level.
Type *string `pulumi:"type"`
}
// A collection of values returned by getCustomRole.
type GetCustomRoleResult struct {
// The catalog of the custom policy.
Catalog string `pulumi:"catalog"`
Description string `pulumi:"description"`
DomainId string `pulumi:"domainId"`
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// Document of the custom policy.
Policy string `pulumi:"policy"`
References int `pulumi:"references"`
Type string `pulumi:"type"`
}
func GetCustomRoleOutput(ctx *pulumi.Context, args GetCustomRoleOutputArgs, opts ...pulumi.InvokeOption) GetCustomRoleResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetCustomRoleResult, error) {
args := v.(GetCustomRoleArgs)
r, err := GetCustomRole(ctx, &args, opts...)
var s GetCustomRoleResult
if r != nil {
s = *r
}
return s, err
}).(GetCustomRoleResultOutput)
}
// A collection of arguments for invoking getCustomRole.
type GetCustomRoleOutputArgs struct {
// Description of the custom policy.
Description pulumi.StringPtrInput `pulumi:"description"`
// The domain the policy belongs to.
DomainId pulumi.StringPtrInput `pulumi:"domainId"`
// ID of the custom policy.
Id pulumi.StringPtrInput `pulumi:"id"`
// Name of the custom policy.
Name pulumi.StringPtrInput `pulumi:"name"`
// The number of citations for the custom policy.
References pulumi.IntPtrInput `pulumi:"references"`
// Display mode. Valid options are *AX*: Account level and *XA*: Project level.
Type pulumi.StringPtrInput `pulumi:"type"`
}
func (GetCustomRoleOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetCustomRoleArgs)(nil)).Elem()
}
// A collection of values returned by getCustomRole.
type GetCustomRoleResultOutput struct{ *pulumi.OutputState }
func (GetCustomRoleResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetCustomRoleResult)(nil)).Elem()
}
func (o GetCustomRoleResultOutput) ToGetCustomRoleResultOutput() GetCustomRoleResultOutput {
return o
}
func (o GetCustomRoleResultOutput) ToGetCustomRoleResultOutputWithContext(ctx context.Context) GetCustomRoleResultOutput {
return o
}
// The catalog of the custom policy.
func (o GetCustomRoleResultOutput) Catalog() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.Catalog }).(pulumi.StringOutput)
}
func (o GetCustomRoleResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.Description }).(pulumi.StringOutput)
}
func (o GetCustomRoleResultOutput) DomainId() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.DomainId }).(pulumi.StringOutput)
}
func (o GetCustomRoleResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetCustomRoleResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.Name }).(pulumi.StringOutput)
}
// Document of the custom policy.
func (o GetCustomRoleResultOutput) Policy() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.Policy }).(pulumi.StringOutput)
}
func (o GetCustomRoleResultOutput) References() pulumi.IntOutput {
return o.ApplyT(func(v GetCustomRoleResult) int { return v.References }).(pulumi.IntOutput)
}
func (o GetCustomRoleResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v GetCustomRoleResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetCustomRoleResultOutput{})
}