/
managementPolicy.go
91 lines (78 loc) · 3.33 KB
/
managementPolicy.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
// *** 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! ***
// nolint: lll
package storage
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Azure Storage Account Management Policy.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/storage_management_policy.html.markdown.
type ManagementPolicy struct {
pulumi.CustomResourceState
// A `rule` block as documented below.
Rules ManagementPolicyRuleArrayOutput `pulumi:"rules"`
// Specifies the id of the storage account to apply the management policy to.
StorageAccountId pulumi.StringOutput `pulumi:"storageAccountId"`
}
// NewManagementPolicy registers a new resource with the given unique name, arguments, and options.
func NewManagementPolicy(ctx *pulumi.Context,
name string, args *ManagementPolicyArgs, opts ...pulumi.ResourceOption) (*ManagementPolicy, error) {
if args == nil || args.StorageAccountId == nil {
return nil, errors.New("missing required argument 'StorageAccountId'")
}
if args == nil {
args = &ManagementPolicyArgs{}
}
var resource ManagementPolicy
err := ctx.RegisterResource("azure:storage/managementPolicy:ManagementPolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetManagementPolicy gets an existing ManagementPolicy 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 GetManagementPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ManagementPolicyState, opts ...pulumi.ResourceOption) (*ManagementPolicy, error) {
var resource ManagementPolicy
err := ctx.ReadResource("azure:storage/managementPolicy:ManagementPolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ManagementPolicy resources.
type managementPolicyState struct {
// A `rule` block as documented below.
Rules []ManagementPolicyRule `pulumi:"rules"`
// Specifies the id of the storage account to apply the management policy to.
StorageAccountId *string `pulumi:"storageAccountId"`
}
type ManagementPolicyState struct {
// A `rule` block as documented below.
Rules ManagementPolicyRuleArrayInput
// Specifies the id of the storage account to apply the management policy to.
StorageAccountId pulumi.StringPtrInput
}
func (ManagementPolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*managementPolicyState)(nil)).Elem()
}
type managementPolicyArgs struct {
// A `rule` block as documented below.
Rules []ManagementPolicyRule `pulumi:"rules"`
// Specifies the id of the storage account to apply the management policy to.
StorageAccountId string `pulumi:"storageAccountId"`
}
// The set of arguments for constructing a ManagementPolicy resource.
type ManagementPolicyArgs struct {
// A `rule` block as documented below.
Rules ManagementPolicyRuleArrayInput
// Specifies the id of the storage account to apply the management policy to.
StorageAccountId pulumi.StringInput
}
func (ManagementPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*managementPolicyArgs)(nil)).Elem()
}