/
groupPolicy.go
121 lines (108 loc) · 4.1 KB
/
groupPolicy.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
// *** 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 iam
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides an IAM policy attached to a group.
type GroupPolicy struct {
pulumi.CustomResourceState
// The IAM group to attach to the policy.
Group pulumi.StringOutput `pulumi:"group"`
// The name of the policy. If omitted, this provider will
// assign a random, unique name.
Name pulumi.StringOutput `pulumi:"name"`
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrOutput `pulumi:"namePrefix"`
// The policy document. This is a JSON formatted string.
Policy pulumi.StringOutput `pulumi:"policy"`
}
// NewGroupPolicy registers a new resource with the given unique name, arguments, and options.
func NewGroupPolicy(ctx *pulumi.Context,
name string, args *GroupPolicyArgs, opts ...pulumi.ResourceOption) (*GroupPolicy, error) {
if args == nil || args.Group == nil {
return nil, errors.New("missing required argument 'Group'")
}
if args == nil || args.Policy == nil {
return nil, errors.New("missing required argument 'Policy'")
}
if args == nil {
args = &GroupPolicyArgs{}
}
var resource GroupPolicy
err := ctx.RegisterResource("aws:iam/groupPolicy:GroupPolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGroupPolicy gets an existing GroupPolicy 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 GetGroupPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GroupPolicyState, opts ...pulumi.ResourceOption) (*GroupPolicy, error) {
var resource GroupPolicy
err := ctx.ReadResource("aws:iam/groupPolicy:GroupPolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GroupPolicy resources.
type groupPolicyState struct {
// The IAM group to attach to the policy.
Group *string `pulumi:"group"`
// The name of the policy. If omitted, this provider will
// assign a random, unique name.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// The policy document. This is a JSON formatted string.
Policy *string `pulumi:"policy"`
}
type GroupPolicyState struct {
// The IAM group to attach to the policy.
Group pulumi.StringPtrInput
// The name of the policy. If omitted, this provider will
// assign a random, unique name.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// The policy document. This is a JSON formatted string.
Policy pulumi.StringPtrInput
}
func (GroupPolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*groupPolicyState)(nil)).Elem()
}
type groupPolicyArgs struct {
// The IAM group to attach to the policy.
Group string `pulumi:"group"`
// The name of the policy. If omitted, this provider will
// assign a random, unique name.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// The policy document. This is a JSON formatted string.
Policy interface{} `pulumi:"policy"`
}
// The set of arguments for constructing a GroupPolicy resource.
type GroupPolicyArgs struct {
// The IAM group to attach to the policy.
Group pulumi.StringInput
// The name of the policy. If omitted, this provider will
// assign a random, unique name.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// The policy document. This is a JSON formatted string.
Policy pulumi.Input
}
func (GroupPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*groupPolicyArgs)(nil)).Elem()
}