/
groupPolicyAttachment.go
93 lines (80 loc) · 3.24 KB
/
groupPolicyAttachment.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
// *** 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"
)
// Attaches a Managed IAM Policy to an IAM group
//
// > **NOTE:** The usage of this resource conflicts with the `iam.PolicyAttachment` resource and will permanently show a difference if both are defined.
type GroupPolicyAttachment struct {
pulumi.CustomResourceState
// The group the policy should be applied to
Group pulumi.StringOutput `pulumi:"group"`
// The ARN of the policy you want to apply
PolicyArn pulumi.StringOutput `pulumi:"policyArn"`
}
// NewGroupPolicyAttachment registers a new resource with the given unique name, arguments, and options.
func NewGroupPolicyAttachment(ctx *pulumi.Context,
name string, args *GroupPolicyAttachmentArgs, opts ...pulumi.ResourceOption) (*GroupPolicyAttachment, error) {
if args == nil || args.Group == nil {
return nil, errors.New("missing required argument 'Group'")
}
if args == nil || args.PolicyArn == nil {
return nil, errors.New("missing required argument 'PolicyArn'")
}
if args == nil {
args = &GroupPolicyAttachmentArgs{}
}
var resource GroupPolicyAttachment
err := ctx.RegisterResource("aws:iam/groupPolicyAttachment:GroupPolicyAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGroupPolicyAttachment gets an existing GroupPolicyAttachment 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 GetGroupPolicyAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GroupPolicyAttachmentState, opts ...pulumi.ResourceOption) (*GroupPolicyAttachment, error) {
var resource GroupPolicyAttachment
err := ctx.ReadResource("aws:iam/groupPolicyAttachment:GroupPolicyAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GroupPolicyAttachment resources.
type groupPolicyAttachmentState struct {
// The group the policy should be applied to
Group *string `pulumi:"group"`
// The ARN of the policy you want to apply
PolicyArn *string `pulumi:"policyArn"`
}
type GroupPolicyAttachmentState struct {
// The group the policy should be applied to
Group pulumi.StringPtrInput
// The ARN of the policy you want to apply
PolicyArn pulumi.StringPtrInput
}
func (GroupPolicyAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*groupPolicyAttachmentState)(nil)).Elem()
}
type groupPolicyAttachmentArgs struct {
// The group the policy should be applied to
Group interface{} `pulumi:"group"`
// The ARN of the policy you want to apply
PolicyArn string `pulumi:"policyArn"`
}
// The set of arguments for constructing a GroupPolicyAttachment resource.
type GroupPolicyAttachmentArgs struct {
// The group the policy should be applied to
Group pulumi.Input
// The ARN of the policy you want to apply
PolicyArn pulumi.StringInput
}
func (GroupPolicyAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*groupPolicyAttachmentArgs)(nil)).Elem()
}