/
resourcePolicy.go
161 lines (133 loc) · 5.63 KB
/
resourcePolicy.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
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ssm
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for AWS::SSM::ResourcePolicy
type ResourcePolicy struct {
pulumi.CustomResourceState
// Actual policy statement.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::SSM::ResourcePolicy` for more information about the expected schema for this property.
Policy pulumi.AnyOutput `pulumi:"policy"`
// A snapshot identifier for the policy over time.
PolicyHash pulumi.StringOutput `pulumi:"policyHash"`
// An unique identifier within the policies of a resource.
PolicyId pulumi.StringOutput `pulumi:"policyId"`
// Arn of OpsItemGroup etc.
ResourceArn pulumi.StringOutput `pulumi:"resourceArn"`
}
// NewResourcePolicy registers a new resource with the given unique name, arguments, and options.
func NewResourcePolicy(ctx *pulumi.Context,
name string, args *ResourcePolicyArgs, opts ...pulumi.ResourceOption) (*ResourcePolicy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Policy == nil {
return nil, errors.New("invalid value for required argument 'Policy'")
}
if args.ResourceArn == nil {
return nil, errors.New("invalid value for required argument 'ResourceArn'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"resourceArn",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource ResourcePolicy
err := ctx.RegisterResource("aws-native:ssm:ResourcePolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetResourcePolicy gets an existing ResourcePolicy 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 GetResourcePolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ResourcePolicyState, opts ...pulumi.ResourceOption) (*ResourcePolicy, error) {
var resource ResourcePolicy
err := ctx.ReadResource("aws-native:ssm:ResourcePolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ResourcePolicy resources.
type resourcePolicyState struct {
}
type ResourcePolicyState struct {
}
func (ResourcePolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*resourcePolicyState)(nil)).Elem()
}
type resourcePolicyArgs struct {
// Actual policy statement.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::SSM::ResourcePolicy` for more information about the expected schema for this property.
Policy interface{} `pulumi:"policy"`
// Arn of OpsItemGroup etc.
ResourceArn string `pulumi:"resourceArn"`
}
// The set of arguments for constructing a ResourcePolicy resource.
type ResourcePolicyArgs struct {
// Actual policy statement.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::SSM::ResourcePolicy` for more information about the expected schema for this property.
Policy pulumi.Input
// Arn of OpsItemGroup etc.
ResourceArn pulumi.StringInput
}
func (ResourcePolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*resourcePolicyArgs)(nil)).Elem()
}
type ResourcePolicyInput interface {
pulumi.Input
ToResourcePolicyOutput() ResourcePolicyOutput
ToResourcePolicyOutputWithContext(ctx context.Context) ResourcePolicyOutput
}
func (*ResourcePolicy) ElementType() reflect.Type {
return reflect.TypeOf((**ResourcePolicy)(nil)).Elem()
}
func (i *ResourcePolicy) ToResourcePolicyOutput() ResourcePolicyOutput {
return i.ToResourcePolicyOutputWithContext(context.Background())
}
func (i *ResourcePolicy) ToResourcePolicyOutputWithContext(ctx context.Context) ResourcePolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourcePolicyOutput)
}
type ResourcePolicyOutput struct{ *pulumi.OutputState }
func (ResourcePolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ResourcePolicy)(nil)).Elem()
}
func (o ResourcePolicyOutput) ToResourcePolicyOutput() ResourcePolicyOutput {
return o
}
func (o ResourcePolicyOutput) ToResourcePolicyOutputWithContext(ctx context.Context) ResourcePolicyOutput {
return o
}
// Actual policy statement.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::SSM::ResourcePolicy` for more information about the expected schema for this property.
func (o ResourcePolicyOutput) Policy() pulumi.AnyOutput {
return o.ApplyT(func(v *ResourcePolicy) pulumi.AnyOutput { return v.Policy }).(pulumi.AnyOutput)
}
// A snapshot identifier for the policy over time.
func (o ResourcePolicyOutput) PolicyHash() pulumi.StringOutput {
return o.ApplyT(func(v *ResourcePolicy) pulumi.StringOutput { return v.PolicyHash }).(pulumi.StringOutput)
}
// An unique identifier within the policies of a resource.
func (o ResourcePolicyOutput) PolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *ResourcePolicy) pulumi.StringOutput { return v.PolicyId }).(pulumi.StringOutput)
}
// Arn of OpsItemGroup etc.
func (o ResourcePolicyOutput) ResourceArn() pulumi.StringOutput {
return o.ApplyT(func(v *ResourcePolicy) pulumi.StringOutput { return v.ResourceArn }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ResourcePolicyInput)(nil)).Elem(), &ResourcePolicy{})
pulumi.RegisterOutputType(ResourcePolicyOutput{})
}