-
Notifications
You must be signed in to change notification settings - Fork 17
/
awsiam_PrincipalPolicyFragment.go
104 lines (91 loc) · 2.87 KB
/
awsiam_PrincipalPolicyFragment.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
package awsiam
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// A collection of the fields in a PolicyStatement that can be used to identify a principal.
//
// This consists of the JSON used in the "Principal" field, and optionally a
// set of "Condition"s that need to be applied to the policy.
//
// Generally, a principal looks like:
//
// { '<TYPE>': ['ID', 'ID', ...] }
//
// And this is also the type of the field `principalJson`. However, there is a
// special type of principal that is just the string '*', which is treated
// differently by some services. To represent that principal, `principalJson`
// should contain `{ 'LiteralString': ['*'] }`.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var conditions interface{}
//
// principalPolicyFragment := awscdk.Aws_iam.NewPrincipalPolicyFragment(map[string][]*string{
// "principalJsonKey": []*string{
// jsii.String("principalJson"),
// },
// }, map[string]interface{}{
// "conditionsKey": conditions,
// })
//
// Experimental.
type PrincipalPolicyFragment interface {
// The conditions under which the policy is in effect.
//
// See [the IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html).
// conditions that need to be applied to this policy.
// Experimental.
Conditions() *map[string]interface{}
// JSON of the "Principal" section in a policy statement.
// Experimental.
PrincipalJson() *map[string]*[]*string
}
// The jsii proxy struct for PrincipalPolicyFragment
type jsiiProxy_PrincipalPolicyFragment struct {
_ byte // padding
}
func (j *jsiiProxy_PrincipalPolicyFragment) Conditions() *map[string]interface{} {
var returns *map[string]interface{}
_jsii_.Get(
j,
"conditions",
&returns,
)
return returns
}
func (j *jsiiProxy_PrincipalPolicyFragment) PrincipalJson() *map[string]*[]*string {
var returns *map[string]*[]*string
_jsii_.Get(
j,
"principalJson",
&returns,
)
return returns
}
// Experimental.
func NewPrincipalPolicyFragment(principalJson *map[string]*[]*string, conditions *map[string]interface{}) PrincipalPolicyFragment {
_init_.Initialize()
if err := validateNewPrincipalPolicyFragmentParameters(principalJson); err != nil {
panic(err)
}
j := jsiiProxy_PrincipalPolicyFragment{}
_jsii_.Create(
"monocdk.aws_iam.PrincipalPolicyFragment",
[]interface{}{principalJson, conditions},
&j,
)
return &j
}
// Experimental.
func NewPrincipalPolicyFragment_Override(p PrincipalPolicyFragment, principalJson *map[string]*[]*string, conditions *map[string]interface{}) {
_init_.Initialize()
_jsii_.Create(
"monocdk.aws_iam.PrincipalPolicyFragment",
[]interface{}{principalJson, conditions},
p,
)
}