AWS Classic

v5.16.0 published on Saturday, Sep 24, 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 System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Iam.GetGroup.Invoke(new()
    {
        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 com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.alb.inputs.GetTargetGroupArgs;
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(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

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<Pulumi.Aws.Iam.Outputs.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
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.