1. Packages
  2. AWS
  3. API Docs
  4. iam
  5. getGroup
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.iam.getGroup

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    This data source can be used to fetch information about a specific IAM group. By using this data source, you can reference IAM group properties without having to hard code ARNs as input.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.iam.getGroup({
        groupName: "an_example_group_name",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.iam.get_group(group_name="an_example_group_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iam.LookupGroup(ctx, &iam.LookupGroupArgs{
    			GroupName: "an_example_group_name",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Iam.GetGroup.Invoke(new()
        {
            GroupName = "an_example_group_name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iam.IamFunctions;
    import com.pulumi.aws.iam.inputs.GetGroupArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = IamFunctions.getGroup(GetGroupArgs.builder()
                .groupName("an_example_group_name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:iam:getGroup
          Arguments:
            groupName: an_example_group_name
    

    Using getGroup

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getGroup(args: GetGroupArgs, opts?: InvokeOptions): Promise<GetGroupResult>
    function getGroupOutput(args: GetGroupOutputArgs, opts?: InvokeOptions): Output<GetGroupResult>
    def get_group(group_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetGroupResult
    def get_group_output(group_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetGroupResult]
    func LookupGroup(ctx *Context, args *LookupGroupArgs, opts ...InvokeOption) (*LookupGroupResult, error)
    func LookupGroupOutput(ctx *Context, args *LookupGroupOutputArgs, opts ...InvokeOption) LookupGroupResultOutput

    > Note: This function is named LookupGroup in the Go SDK.

    public static class GetGroup 
    {
        public static Task<GetGroupResult> InvokeAsync(GetGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupResult> Invoke(GetGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupResult> getGroup(GetGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:iam/getGroup:getGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    GroupName string
    Friendly IAM group name to match.
    GroupName string
    Friendly IAM group name to match.
    groupName String
    Friendly IAM group name to match.
    groupName string
    Friendly IAM group name to match.
    group_name str
    Friendly IAM group name to match.
    groupName String
    Friendly IAM group name to match.

    getGroup Result

    The following output properties are available:

    Arn string
    User ARN.
    GroupId string
    Stable and unique string identifying the group.
    GroupName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Path string
    Path to the IAM user.
    Users List<GetGroupUser>
    List of objects containing group member information. See below.
    Arn string
    User ARN.
    GroupId string
    Stable and unique string identifying the group.
    GroupName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Path string
    Path to the IAM user.
    Users []GetGroupUser
    List of objects containing group member information. See below.
    arn String
    User ARN.
    groupId String
    Stable and unique string identifying the group.
    groupName String
    id String
    The provider-assigned unique ID for this managed resource.
    path String
    Path to the IAM user.
    users List<GetGroupUser>
    List of objects containing group member information. See below.
    arn string
    User ARN.
    groupId string
    Stable and unique string identifying the group.
    groupName string
    id string
    The provider-assigned unique ID for this managed resource.
    path string
    Path to the IAM user.
    users GetGroupUser[]
    List of objects containing group member information. See below.
    arn str
    User ARN.
    group_id str
    Stable and unique string identifying the group.
    group_name str
    id str
    The provider-assigned unique ID for this managed resource.
    path str
    Path to the IAM user.
    users Sequence[GetGroupUser]
    List of objects containing group member information. See below.
    arn String
    User ARN.
    groupId String
    Stable and unique string identifying the group.
    groupName String
    id String
    The provider-assigned unique ID for this managed resource.
    path String
    Path to the IAM user.
    users List<Property Map>
    List of objects containing group member information. See below.

    Supporting Types

    GetGroupUser

    Arn string
    User ARN.
    Path string
    Path to the IAM user.
    UserId string
    Stable and unique string identifying the IAM user.
    UserName string
    Name of the IAM user.
    Arn string
    User ARN.
    Path string
    Path to the IAM user.
    UserId string
    Stable and unique string identifying the IAM user.
    UserName string
    Name of the IAM user.
    arn String
    User ARN.
    path String
    Path to the IAM user.
    userId String
    Stable and unique string identifying the IAM user.
    userName String
    Name of the IAM user.
    arn string
    User ARN.
    path string
    Path to the IAM user.
    userId string
    Stable and unique string identifying the IAM user.
    userName string
    Name of the IAM user.
    arn str
    User ARN.
    path str
    Path to the IAM user.
    user_id str
    Stable and unique string identifying the IAM user.
    user_name str
    Name of the IAM user.
    arn String
    User ARN.
    path String
    Path to the IAM user.
    userId String
    Stable and unique string identifying the IAM user.
    userName String
    Name of the IAM user.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi