package awsiam import ( _init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii" _jsii_ "github.com/aws/jsii-runtime-go/runtime" "github.com/aws/aws-cdk-go/awscdk/v2" "github.com/aws/aws-cdk-go/awscdk/v2/awsiam/internal" "github.com/aws/constructs-go/constructs/v10" ) // An IAM Group (collection of IAM users) lets you specify permissions for multiple users, which can make it easier to manage permissions for those users. // // Example: // user := iam.NewUser(this, jsii.String("MyUser")) // or User.fromUserName(this, 'User', 'johnsmith'); // group := iam.NewGroup(this, jsii.String("MyGroup")) // or Group.fromGroupArn(this, 'Group', 'arn:aws:iam::account-id:group/group-name'); // // user.AddToGroup(group) // // or // group.addUser(user) // // See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html // type Group interface { awscdk.Resource IGroup // When this Principal is used in an AssumeRole policy, the action to use. AssumeRoleAction() *string // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The principal to grant permissions to. GrantPrincipal() IPrincipal // Returns the IAM Group ARN. GroupArn() *string // Returns the IAM Group Name. GroupName() *string // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // Return the policy fragment that identifies this principal in a Policy. PolicyFragment() PrincipalPolicyFragment // The AWS account ID of this principal. // // Can be undefined when the account is not known // (for example, for service principals). // Can be a Token - in that case, // it's assumed to be AWS::AccountId. PrincipalAccount() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Attaches a managed policy to this group. // // See [IAM and AWS STS quotas, name requirements, and character limits] // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entities) // for quota of managed policies attached to an IAM group. AddManagedPolicy(policy IManagedPolicy) // Add to the policy of this principal. AddToPolicy(statement PolicyStatement) *bool // Adds an IAM statement to the default policy. AddToPrincipalPolicy(statement PolicyStatement) *AddToPrincipalPolicyResult // Adds a user to this group. AddUser(user IUser) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Attaches a policy to this group. AttachInlinePolicy(policy Policy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string } // The jsii proxy struct for Group type jsiiProxy_Group struct { internal.Type__awscdkResource jsiiProxy_IGroup } func (j *jsiiProxy_Group) AssumeRoleAction() *string { var returns *string _jsii_.Get( j, "assumeRoleAction", &returns, ) return returns } func (j *jsiiProxy_Group) Env() *awscdk.ResourceEnvironment { var returns *awscdk.ResourceEnvironment _jsii_.Get( j, "env", &returns, ) return returns } func (j *jsiiProxy_Group) GrantPrincipal() IPrincipal { var returns IPrincipal _jsii_.Get( j, "grantPrincipal", &returns, ) return returns } func (j *jsiiProxy_Group) GroupArn() *string { var returns *string _jsii_.Get( j, "groupArn", &returns, ) return returns } func (j *jsiiProxy_Group) GroupName() *string { var returns *string _jsii_.Get( j, "groupName", &returns, ) return returns } func (j *jsiiProxy_Group) Node() constructs.Node { var returns constructs.Node _jsii_.Get( j, "node", &returns, ) return returns } func (j *jsiiProxy_Group) PhysicalName() *string { var returns *string _jsii_.Get( j, "physicalName", &returns, ) return returns } func (j *jsiiProxy_Group) PolicyFragment() PrincipalPolicyFragment { var returns PrincipalPolicyFragment _jsii_.Get( j, "policyFragment", &returns, ) return returns } func (j *jsiiProxy_Group) PrincipalAccount() *string { var returns *string _jsii_.Get( j, "principalAccount", &returns, ) return returns } func (j *jsiiProxy_Group) Stack() awscdk.Stack { var returns awscdk.Stack _jsii_.Get( j, "stack", &returns, ) return returns } func NewGroup(scope constructs.Construct, id *string, props *GroupProps) Group { _init_.Initialize() if err := validateNewGroupParameters(scope, id, props); err != nil { panic(err) } j := jsiiProxy_Group{} _jsii_.Create( "aws-cdk-lib.aws_iam.Group", []interface{}{scope, id, props}, &j, ) return &j } func NewGroup_Override(g Group, scope constructs.Construct, id *string, props *GroupProps) { _init_.Initialize() _jsii_.Create( "aws-cdk-lib.aws_iam.Group", []interface{}{scope, id, props}, g, ) } // Import an external group by ARN. // // If the imported Group ARN is a Token (such as a // `CfnParameter.valueAsString` or a `Fn.importValue()`) *and* the referenced // group has a `path` (like `arn:...:group/AdminGroup/NetworkAdmin`), the // `groupName` property will not resolve to the correct value. Instead it // will resolve to the first path component. We unfortunately cannot express // the correct calculation of the full path name as a CloudFormation // expression. In this scenario the Group ARN should be supplied without the // `path` in order to resolve the correct group resource. func Group_FromGroupArn(scope constructs.Construct, id *string, groupArn *string) IGroup { _init_.Initialize() if err := validateGroup_FromGroupArnParameters(scope, id, groupArn); err != nil { panic(err) } var returns IGroup _jsii_.StaticInvoke( "aws-cdk-lib.aws_iam.Group", "fromGroupArn", []interface{}{scope, id, groupArn}, &returns, ) return returns } // Import an existing group by given name (with path). // // This method has same caveats of `fromGroupArn`. func Group_FromGroupName(scope constructs.Construct, id *string, groupName *string) IGroup { _init_.Initialize() if err := validateGroup_FromGroupNameParameters(scope, id, groupName); err != nil { panic(err) } var returns IGroup _jsii_.StaticInvoke( "aws-cdk-lib.aws_iam.Group", "fromGroupName", []interface{}{scope, id, groupName}, &returns, ) return returns } // Checks if `x` is a construct. // // Use this method instead of `instanceof` to properly detect `Construct` // instances, even when the construct library is symlinked. // // Explanation: in JavaScript, multiple copies of the `constructs` library on // disk are seen as independent, completely different libraries. As a // consequence, the class `Construct` in each copy of the `constructs` library // is seen as a different class, and an instance of one class will not test as // `instanceof` the other class. `npm install` will not create installations // like this, but users may manually symlink construct libraries together or // use a monorepo tool: in those cases, multiple copies of the `constructs` // library can be accidentally installed, and `instanceof` will behave // unpredictably. It is safest to avoid using `instanceof`, and using // this type-testing method instead. // // Returns: true if `x` is an object created from a class which extends `Construct`. func Group_IsConstruct(x interface{}) *bool { _init_.Initialize() if err := validateGroup_IsConstructParameters(x); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "aws-cdk-lib.aws_iam.Group", "isConstruct", []interface{}{x}, &returns, ) return returns } // Returns true if the construct was created by CDK, and false otherwise. func Group_IsOwnedResource(construct constructs.IConstruct) *bool { _init_.Initialize() if err := validateGroup_IsOwnedResourceParameters(construct); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "aws-cdk-lib.aws_iam.Group", "isOwnedResource", []interface{}{construct}, &returns, ) return returns } // Check whether the given construct is a Resource. func Group_IsResource(construct constructs.IConstruct) *bool { _init_.Initialize() if err := validateGroup_IsResourceParameters(construct); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "aws-cdk-lib.aws_iam.Group", "isResource", []interface{}{construct}, &returns, ) return returns } func (g *jsiiProxy_Group) AddManagedPolicy(policy IManagedPolicy) { if err := g.validateAddManagedPolicyParameters(policy); err != nil { panic(err) } _jsii_.InvokeVoid( g, "addManagedPolicy", []interface{}{policy}, ) } func (g *jsiiProxy_Group) AddToPolicy(statement PolicyStatement) *bool { if err := g.validateAddToPolicyParameters(statement); err != nil { panic(err) } var returns *bool _jsii_.Invoke( g, "addToPolicy", []interface{}{statement}, &returns, ) return returns } func (g *jsiiProxy_Group) AddToPrincipalPolicy(statement PolicyStatement) *AddToPrincipalPolicyResult { if err := g.validateAddToPrincipalPolicyParameters(statement); err != nil { panic(err) } var returns *AddToPrincipalPolicyResult _jsii_.Invoke( g, "addToPrincipalPolicy", []interface{}{statement}, &returns, ) return returns } func (g *jsiiProxy_Group) AddUser(user IUser) { if err := g.validateAddUserParameters(user); err != nil { panic(err) } _jsii_.InvokeVoid( g, "addUser", []interface{}{user}, ) } func (g *jsiiProxy_Group) ApplyRemovalPolicy(policy awscdk.RemovalPolicy) { if err := g.validateApplyRemovalPolicyParameters(policy); err != nil { panic(err) } _jsii_.InvokeVoid( g, "applyRemovalPolicy", []interface{}{policy}, ) } func (g *jsiiProxy_Group) AttachInlinePolicy(policy Policy) { if err := g.validateAttachInlinePolicyParameters(policy); err != nil { panic(err) } _jsii_.InvokeVoid( g, "attachInlinePolicy", []interface{}{policy}, ) } func (g *jsiiProxy_Group) GeneratePhysicalName() *string { var returns *string _jsii_.Invoke( g, "generatePhysicalName", nil, // no parameters &returns, ) return returns } func (g *jsiiProxy_Group) GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string { if err := g.validateGetResourceArnAttributeParameters(arnAttr, arnComponents); err != nil { panic(err) } var returns *string _jsii_.Invoke( g, "getResourceArnAttribute", []interface{}{arnAttr, arnComponents}, &returns, ) return returns } func (g *jsiiProxy_Group) GetResourceNameAttribute(nameAttr *string) *string { if err := g.validateGetResourceNameAttributeParameters(nameAttr); err != nil { panic(err) } var returns *string _jsii_.Invoke( g, "getResourceNameAttribute", []interface{}{nameAttr}, &returns, ) return returns } func (g *jsiiProxy_Group) ToString() *string { var returns *string _jsii_.Invoke( g, "toString", nil, // no parameters &returns, ) return returns }