AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getGroup

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Iam.GetGroup.InvokeAsync(new Aws.Iam.GetGroupArgs
        {
            GroupName = "an_example_group_name",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(IamFunctions.getGroup(GetTargetGroupArgs.builder()
            .groupName("an_example_group_name")
            .build()));

        }
}
import pulumi
import pulumi_aws as aws

example = aws.iam.get_group(group_name="an_example_group_name")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.iam.getGroup({
    groupName: "an_example_group_name",
}));
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

The friendly IAM group name to match.

GroupName string

The friendly IAM group name to match.

groupName String

The friendly IAM group name to match.

groupName string

The friendly IAM group name to match.

group_name str

The friendly IAM group name to match.

groupName String

The friendly IAM group name to match.

getGroup Result

The following output properties are available:

Arn string

The Amazon Resource Name (ARN) specifying the iam user.

GroupId string

The stable and unique string identifying the group.

GroupName string
Id string

The provider-assigned unique ID for this managed resource.

Path string

The path to the iam user.

Users List<Pulumi.Aws.Iam.Outputs.GetGroupUser>

List of objects containing group member information. See supported fields below.

Arn string

The Amazon Resource Name (ARN) specifying the iam user.

GroupId string

The stable and unique string identifying the group.

GroupName string
Id string

The provider-assigned unique ID for this managed resource.

Path string

The path to the iam user.

Users []GetGroupUser

List of objects containing group member information. See supported fields below.

arn String

The Amazon Resource Name (ARN) specifying the iam user.

groupId String

The stable and unique string identifying the group.

groupName String
id String

The provider-assigned unique ID for this managed resource.

path String

The path to the iam user.

users ListGroupUser>

List of objects containing group member information. See supported fields below.

arn string

The Amazon Resource Name (ARN) specifying the iam user.

groupId string

The stable and unique string identifying the group.

groupName string
id string

The provider-assigned unique ID for this managed resource.

path string

The path to the iam user.

users GetGroupUser[]

List of objects containing group member information. See supported fields below.

arn str

The Amazon Resource Name (ARN) specifying the iam user.

group_id str

The stable and unique string identifying the group.

group_name str
id str

The provider-assigned unique ID for this managed resource.

path str

The path to the iam user.

users Sequence[GetGroupUser]

List of objects containing group member information. See supported fields below.

arn String

The Amazon Resource Name (ARN) specifying the iam user.

groupId String

The stable and unique string identifying the group.

groupName String
id String

The provider-assigned unique ID for this managed resource.

path String

The path to the iam user.

users List

List of objects containing group member information. See supported fields below.

Supporting Types

GetGroupUser

Arn string

The Amazon Resource Name (ARN) specifying the iam user.

Path string

The path to the iam user.

UserId string

The stable and unique string identifying the iam user.

UserName string

The name of the iam user.

Arn string

The Amazon Resource Name (ARN) specifying the iam user.

Path string

The path to the iam user.

UserId string

The stable and unique string identifying the iam user.

UserName string

The name of the iam user.

arn String

The Amazon Resource Name (ARN) specifying the iam user.

path String

The path to the iam user.

userId String

The stable and unique string identifying the iam user.

userName String

The name of the iam user.

arn string

The Amazon Resource Name (ARN) specifying the iam user.

path string

The path to the iam user.

userId string

The stable and unique string identifying the iam user.

userName string

The name of the iam user.

arn str

The Amazon Resource Name (ARN) specifying the iam user.

path str

The path to the iam user.

user_id str

The stable and unique string identifying the iam user.

user_name str

The name of the iam user.

arn String

The Amazon Resource Name (ARN) specifying the iam user.

path String

The path to the iam user.

userId String

The stable and unique string identifying the iam user.

userName String

The name of the iam user.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.