published on Friday, Nov 13, 2026 by Pulumi
published on Friday, Nov 13, 2026 by Pulumi
Manages a group in an AWS Directory Service directory.
Example Usage
Basic Usage
The following example assumes an existing Directory Service directory with Directory Service Data access enabled.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.directoryservicedata.Group("example", {
directoryId: "d-1234567890",
samAccountName: "examplegroup",
groupScope: "Global",
groupType: "Security",
});
import pulumi
import pulumi_aws as aws
example = aws.directoryservicedata.Group("example",
directory_id="d-1234567890",
sam_account_name="examplegroup",
group_scope="Global",
group_type="Security")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/directoryservicedata"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := directoryservicedata.NewGroup(ctx, "example", &directoryservicedata.GroupArgs{
DirectoryId: pulumi.String("d-1234567890"),
SamAccountName: pulumi.String("examplegroup"),
GroupScope: pulumi.String("Global"),
GroupType: pulumi.String("Security"),
})
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 = new Aws.DirectoryServiceData.Group("example", new()
{
DirectoryId = "d-1234567890",
SamAccountName = "examplegroup",
GroupScope = "Global",
GroupType = "Security",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.directoryservicedata.Group;
import com.pulumi.aws.directoryservicedata.GroupArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var example = new Group("example", GroupArgs.builder()
.directoryId("d-1234567890")
.samAccountName("examplegroup")
.groupScope("Global")
.groupType("Security")
.build());
}
}
resources:
example:
type: aws:directoryservicedata:Group
properties:
directoryId: d-1234567890
samAccountName: examplegroup
groupScope: Global
groupType: Security
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_directoryservicedata_group" "example" {
lifecycle {
create_before_destroy = true
}
directory_id = "d-1234567890"
sam_account_name = "examplegroup"
group_scope = "Global"
group_type = "Security"
}
Create Group Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Group(name: string, args: GroupArgs, opts?: CustomResourceOptions);@overload
def Group(resource_name: str,
args: GroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Group(resource_name: str,
opts: Optional[ResourceOptions] = None,
directory_id: Optional[str] = None,
sam_account_name: Optional[str] = None,
group_scope: Optional[str] = None,
group_type: Optional[str] = None,
region: Optional[str] = None)func NewGroup(ctx *Context, name string, args GroupArgs, opts ...ResourceOption) (*Group, error)public Group(string name, GroupArgs args, CustomResourceOptions? opts = null)type: aws:directoryservicedata:Group
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws_directoryservicedata_group" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsGroupResource = new Aws.DirectoryServiceData.Group("awsGroupResource", new()
{
DirectoryId = "string",
SamAccountName = "string",
GroupScope = "string",
GroupType = "string",
Region = "string",
});
example, err := directoryservicedata.NewGroup(ctx, "awsGroupResource", &directoryservicedata.GroupArgs{
DirectoryId: pulumi.String("string"),
SamAccountName: pulumi.String("string"),
GroupScope: pulumi.String("string"),
GroupType: pulumi.String("string"),
Region: pulumi.String("string"),
})
resource "aws_directoryservicedata_group" "awsGroupResource" {
lifecycle {
create_before_destroy = true
}
directory_id = "string"
sam_account_name = "string"
group_scope = "string"
group_type = "string"
region = "string"
}
var awsGroupResource = new com.pulumi.aws.directoryservicedata.Group("awsGroupResource", com.pulumi.aws.directoryservicedata.GroupArgs.builder()
.directoryId("string")
.samAccountName("string")
.groupScope("string")
.groupType("string")
.region("string")
.build());
aws_group_resource = aws.directoryservicedata.Group("awsGroupResource",
directory_id="string",
sam_account_name="string",
group_scope="string",
group_type="string",
region="string")
const awsGroupResource = new aws.directoryservicedata.Group("awsGroupResource", {
directoryId: "string",
samAccountName: "string",
groupScope: "string",
groupType: "string",
region: "string",
});
type: aws:directoryservicedata:Group
properties:
directoryId: string
groupScope: string
groupType: string
region: string
samAccountName: string
Group Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Group resource accepts the following input properties:
- Directory
Id string - ID of the Directory that's associated with the group.
- Sam
Account stringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- Group
Scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - Group
Type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - Region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
- Directory
Id string - ID of the Directory that's associated with the group.
- Sam
Account stringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- Group
Scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - Group
Type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - Region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
- directory_
id string - ID of the Directory that's associated with the group.
- sam_
account_ stringname SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- group_
scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group_
type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
- directory
Id String - ID of the Directory that's associated with the group.
- sam
Account StringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- group
Scope String - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group
Type String - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region String
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
- directory
Id string - ID of the Directory that's associated with the group.
- sam
Account stringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- group
Scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group
Type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
- directory_
id str - ID of the Directory that's associated with the group.
- sam_
account_ strname SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- group_
scope str - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group_
type str - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region str
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
- directory
Id String - ID of the Directory that's associated with the group.
- sam
Account StringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- group
Scope String - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group
Type String - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region String
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.
Outputs
All input properties are implicitly available as output properties. Additionally, the Group resource produces the following output properties:
- Distinguished
Name string - Distinguished name of the group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Sid string
- Unique Security identifier (SID) of the group.
- Distinguished
Name string - Distinguished name of the group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Sid string
- Unique Security identifier (SID) of the group.
- distinguished_
name string - Distinguished name of the group.
- id string
- The provider-assigned unique ID for this managed resource.
- sid string
- Unique Security identifier (SID) of the group.
- distinguished
Name String - Distinguished name of the group.
- id String
- The provider-assigned unique ID for this managed resource.
- sid String
- Unique Security identifier (SID) of the group.
- distinguished
Name string - Distinguished name of the group.
- id string
- The provider-assigned unique ID for this managed resource.
- sid string
- Unique Security identifier (SID) of the group.
- distinguished_
name str - Distinguished name of the group.
- id str
- The provider-assigned unique ID for this managed resource.
- sid str
- Unique Security identifier (SID) of the group.
- distinguished
Name String - Distinguished name of the group.
- id String
- The provider-assigned unique ID for this managed resource.
- sid String
- Unique Security identifier (SID) of the group.
Look up Existing Group Resource
Get an existing Group resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GroupState, opts?: CustomResourceOptions): Group@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
directory_id: Optional[str] = None,
distinguished_name: Optional[str] = None,
group_scope: Optional[str] = None,
group_type: Optional[str] = None,
region: Optional[str] = None,
sam_account_name: Optional[str] = None,
sid: Optional[str] = None) -> Groupfunc GetGroup(ctx *Context, name string, id IDInput, state *GroupState, opts ...ResourceOption) (*Group, error)public static Group Get(string name, Input<string> id, GroupState? state, CustomResourceOptions? opts = null)public static Group get(String name, Output<String> id, GroupState state, CustomResourceOptions options)resources: existingGroup: type: aws:directoryservicedata:Group get: id: ${id}import {
to = aws_directoryservicedata_group.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state GroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state GroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state GroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state GroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Directory
Id string - ID of the Directory that's associated with the group.
- Distinguished
Name string - Distinguished name of the group.
- Group
Scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - Group
Type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - Region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- Sam
Account stringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- Sid string
- Unique Security identifier (SID) of the group.
- Directory
Id string - ID of the Directory that's associated with the group.
- Distinguished
Name string - Distinguished name of the group.
- Group
Scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - Group
Type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - Region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- Sam
Account stringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- Sid string
- Unique Security identifier (SID) of the group.
- directory_
id string - ID of the Directory that's associated with the group.
- distinguished_
name string - Distinguished name of the group.
- group_
scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group_
type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- sam_
account_ stringname SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- sid string
- Unique Security identifier (SID) of the group.
- directory
Id String - ID of the Directory that's associated with the group.
- distinguished
Name String - Distinguished name of the group.
- group
Scope String - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group
Type String - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region String
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- sam
Account StringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- sid String
- Unique Security identifier (SID) of the group.
- directory
Id string - ID of the Directory that's associated with the group.
- distinguished
Name string - Distinguished name of the group.
- group
Scope string - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group
Type string - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region string
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- sam
Account stringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- sid string
- Unique Security identifier (SID) of the group.
- directory_
id str - ID of the Directory that's associated with the group.
- distinguished_
name str - Distinguished name of the group.
- group_
scope str - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group_
type str - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region str
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- sam_
account_ strname SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- sid str
- Unique Security identifier (SID) of the group.
- directory
Id String - ID of the Directory that's associated with the group.
- distinguished
Name String - Distinguished name of the group.
- group
Scope String - Scope of the AD group. Valid values are
DomainLocal,Global,Universal, andBuiltinLocal. If omitted, the value is read from AWS. See AD group scopes for scope restrictions. - group
Type String - Type of the AD group. Valid values are
DistributionandSecurity. If omitted, the value is read from AWS. See AD group types. - region String
Region where the group is managed. Defaults to the provider region.
Changes to
groupScopeandgroupTypein the same apply are sent to AWS as separate requests, with the scope updated first.- sam
Account StringName SAM account name of the group. Must be between 1 and 64 characters and must not contain any of the following characters:
: ; | = + " * ? < > / \ , [ ] @.The following arguments are optional:
- sid String
- Unique Security identifier (SID) of the group.
Import
Identity Schema
Required
directoryId(String) ID of the Directory Service directory where the group is managed.samAccountName(String) SAM account name of the group.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import Directory Service Data Group using the directory ID and SAM account name separated by a comma. For example:
$ pulumi import aws:directoryservicedata/group:Group example d-1234567890,example-group
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Friday, Nov 13, 2026 by Pulumi