/
getPolicyDefintion.go
78 lines (73 loc) · 2.73 KB
/
getPolicyDefintion.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
// *** 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 policy
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/policy"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "Allowed resource types"
// example, err := policy.GetPolicyDefintion(ctx, &policy.GetPolicyDefintionArgs{
// DisplayName: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
// ```
func GetPolicyDefintion(ctx *pulumi.Context, args *GetPolicyDefintionArgs, opts ...pulumi.InvokeOption) (*GetPolicyDefintionResult, error) {
var rv GetPolicyDefintionResult
err := ctx.Invoke("azure:policy/getPolicyDefintion:getPolicyDefintion", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getPolicyDefintion.
type GetPolicyDefintionArgs struct {
// Specifies the display name of the Policy Definition. Conflicts with `name`.
DisplayName *string `pulumi:"displayName"`
// Deprecated: Deprecated in favour of `management_group_name`
ManagementGroupId *string `pulumi:"managementGroupId"`
// Only retrieve Policy Definitions from this Management Group.
ManagementGroupName *string `pulumi:"managementGroupName"`
// Specifies the name of the Policy Definition. Conflicts with `displayName`.
Name *string `pulumi:"name"`
}
// A collection of values returned by getPolicyDefintion.
type GetPolicyDefintionResult struct {
// The Description of the Policy.
Description string `pulumi:"description"`
DisplayName string `pulumi:"displayName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Deprecated: Deprecated in favour of `management_group_name`
ManagementGroupId *string `pulumi:"managementGroupId"`
ManagementGroupName *string `pulumi:"managementGroupName"`
// Any Metadata defined in the Policy.
Metadata string `pulumi:"metadata"`
Name string `pulumi:"name"`
// Any Parameters defined in the Policy.
Parameters string `pulumi:"parameters"`
// The Rule as defined (in JSON) in the Policy.
PolicyRule string `pulumi:"policyRule"`
// The Type of the Policy. Possible values are "BuiltIn", "Custom" and "NotSpecified".
PolicyType string `pulumi:"policyType"`
// The Type of Policy.
Type string `pulumi:"type"`
}