1. Packages
  2. AWS
  3. API Docs
  4. iam
  5. getGroup
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.iam.getGroup

Explore with Pulumi AI

AWS v6.76.0 published on Tuesday, Apr 8, 2025 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",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.iam.get_group(group_name="an_example_group_name")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:iam:getGroup
      arguments:
        groupName: an_example_group_name
Copy

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>
Copy
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]
Copy
func LookupGroup(ctx *Context, args *LookupGroupArgs, opts ...InvokeOption) (*LookupGroupResult, error)
func LookupGroupOutput(ctx *Context, args *LookupGroupOutputArgs, opts ...InvokeOption) LookupGroupResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetGroupResult> getGroup(GetGroupArgs args, InvokeOptions options)
public static Output<GetGroupResult> getGroup(GetGroupArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:iam/getGroup:getGroup
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

GroupName This property is required. string
Friendly IAM group name to match.
GroupName This property is required. string
Friendly IAM group name to match.
groupName This property is required. String
Friendly IAM group name to match.
groupName This property is required. string
Friendly IAM group name to match.
group_name This property is required. str
Friendly IAM group name to match.
groupName This property is required. 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 This property is required. string
User ARN.
Path This property is required. string
Path to the IAM user.
UserId This property is required. string
Stable and unique string identifying the IAM user.
UserName This property is required. string
Name of the IAM user.
Arn This property is required. string
User ARN.
Path This property is required. string
Path to the IAM user.
UserId This property is required. string
Stable and unique string identifying the IAM user.
UserName This property is required. string
Name of the IAM user.
arn This property is required. String
User ARN.
path This property is required. String
Path to the IAM user.
userId This property is required. String
Stable and unique string identifying the IAM user.
userName This property is required. String
Name of the IAM user.
arn This property is required. string
User ARN.
path This property is required. string
Path to the IAM user.
userId This property is required. string
Stable and unique string identifying the IAM user.
userName This property is required. string
Name of the IAM user.
arn This property is required. str
User ARN.
path This property is required. str
Path to the IAM user.
user_id This property is required. str
Stable and unique string identifying the IAM user.
user_name This property is required. str
Name of the IAM user.
arn This property is required. String
User ARN.
path This property is required. String
Path to the IAM user.
userId This property is required. String
Stable and unique string identifying the IAM user.
userName This property is required. 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 v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi