/
getGroupPolicy.go
104 lines (89 loc) · 6.27 KB
/
getGroupPolicy.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
// 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 iam
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Adds or updates an inline policy document that is embedded in the specified IAM group.
//
// A group can also have managed policies attached to it. To attach a managed policy to a group, use [AWS::IAM::Group](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html). To create a new managed policy, use [AWS::IAM::ManagedPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-managedpolicy.html). For information about policies, see [Managed policies and inline policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the *IAM User Guide*.
// For information about the maximum number of inline policies that you can embed in a group, see [IAM and quotas](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) in the *IAM User Guide*.
func LookupGroupPolicy(ctx *pulumi.Context, args *LookupGroupPolicyArgs, opts ...pulumi.InvokeOption) (*LookupGroupPolicyResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupGroupPolicyResult
err := ctx.Invoke("aws-native:iam:getGroupPolicy", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupGroupPolicyArgs struct {
// The name of the group to associate the policy with.
// This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-.
GroupName string `pulumi:"groupName"`
// The name of the policy document.
// This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
PolicyName string `pulumi:"policyName"`
}
type LookupGroupPolicyResult struct {
// The policy document.
// You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM.
// The [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) used to validate this parameter is a string of characters consisting of the following:
// + Any printable ASCII character ranging from the space character (``\u0020``) through the end of the ASCII character range
// + The printable characters in the Basic Latin and Latin-1 Supplement character set (through ``\u00FF``)
// + The special characters tab (``\u0009``), line feed (``\u000A``), and carriage return (``\u000D``)
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::IAM::GroupPolicy` for more information about the expected schema for this property.
PolicyDocument interface{} `pulumi:"policyDocument"`
}
func LookupGroupPolicyOutput(ctx *pulumi.Context, args LookupGroupPolicyOutputArgs, opts ...pulumi.InvokeOption) LookupGroupPolicyResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupGroupPolicyResult, error) {
args := v.(LookupGroupPolicyArgs)
r, err := LookupGroupPolicy(ctx, &args, opts...)
var s LookupGroupPolicyResult
if r != nil {
s = *r
}
return s, err
}).(LookupGroupPolicyResultOutput)
}
type LookupGroupPolicyOutputArgs struct {
// The name of the group to associate the policy with.
// This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-.
GroupName pulumi.StringInput `pulumi:"groupName"`
// The name of the policy document.
// This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
PolicyName pulumi.StringInput `pulumi:"policyName"`
}
func (LookupGroupPolicyOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGroupPolicyArgs)(nil)).Elem()
}
type LookupGroupPolicyResultOutput struct{ *pulumi.OutputState }
func (LookupGroupPolicyResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGroupPolicyResult)(nil)).Elem()
}
func (o LookupGroupPolicyResultOutput) ToLookupGroupPolicyResultOutput() LookupGroupPolicyResultOutput {
return o
}
func (o LookupGroupPolicyResultOutput) ToLookupGroupPolicyResultOutputWithContext(ctx context.Context) LookupGroupPolicyResultOutput {
return o
}
// The policy document.
//
// You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM.
// The [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) used to validate this parameter is a string of characters consisting of the following:
// + Any printable ASCII character ranging from the space character (``\u0020``) through the end of the ASCII character range
// + The printable characters in the Basic Latin and Latin-1 Supplement character set (through ``\u00FF``)
// + The special characters tab (``\u0009``), line feed (``\u000A``), and carriage return (``\u000D``)
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::IAM::GroupPolicy` for more information about the expected schema for this property.
func (o LookupGroupPolicyResultOutput) PolicyDocument() pulumi.AnyOutput {
return o.ApplyT(func(v LookupGroupPolicyResult) interface{} { return v.PolicyDocument }).(pulumi.AnyOutput)
}
func init() {
pulumi.RegisterOutputType(LookupGroupPolicyResultOutput{})
}