Try AWS Native preview for resources not in the classic version.
aws.iam.getGroup
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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:
- Group
Name string - Friendly IAM group name to match.
- Group
Name string - Friendly IAM group name to match.
- group
Name String - Friendly IAM group name to match.
- group
Name string - Friendly IAM group name to match.
- group_
name str - Friendly IAM group name to match.
- group
Name String - Friendly IAM group name to match.
getGroup Result
The following output properties are available:
- 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[Get
Group User] - List of objects containing group member information. See below.
Supporting Types
GetGroupUser
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.