aws.identitystore.GroupMembership
Explore with Pulumi AI
Resource for managing an AWS IdentityStore Group Membership.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ssoadmin.getInstances({});
const exampleUser = new aws.identitystore.User("example", {
identityStoreId: example.then(example => example.identityStoreIds?.[0]),
displayName: "John Doe",
userName: "john.doe@example.com",
name: {
familyName: "Doe",
givenName: "John",
},
});
const exampleGroup = new aws.identitystore.Group("example", {
identityStoreId: example.then(example => example.identityStoreIds?.[0]),
displayName: "MyGroup",
description: "Some group name",
});
const exampleGroupMembership = new aws.identitystore.GroupMembership("example", {
identityStoreId: example.then(example => example.identityStoreIds?.[0]),
groupId: exampleGroup.groupId,
memberId: exampleUser.userId,
});
import pulumi
import pulumi_aws as aws
example = aws.ssoadmin.get_instances()
example_user = aws.identitystore.User("example",
identity_store_id=example.identity_store_ids[0],
display_name="John Doe",
user_name="john.doe@example.com",
name={
"family_name": "Doe",
"given_name": "John",
})
example_group = aws.identitystore.Group("example",
identity_store_id=example.identity_store_ids[0],
display_name="MyGroup",
description="Some group name")
example_group_membership = aws.identitystore.GroupMembership("example",
identity_store_id=example.identity_store_ids[0],
group_id=example_group.group_id,
member_id=example_user.user_id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/identitystore"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssoadmin"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ssoadmin.GetInstances(ctx, nil, nil)
if err != nil {
return err
}
exampleUser, err := identitystore.NewUser(ctx, "example", &identitystore.UserArgs{
IdentityStoreId: pulumi.String(example.IdentityStoreIds[0]),
DisplayName: pulumi.String("John Doe"),
UserName: pulumi.String("john.doe@example.com"),
Name: &identitystore.UserNameArgs{
FamilyName: pulumi.String("Doe"),
GivenName: pulumi.String("John"),
},
})
if err != nil {
return err
}
exampleGroup, err := identitystore.NewGroup(ctx, "example", &identitystore.GroupArgs{
IdentityStoreId: pulumi.String(example.IdentityStoreIds[0]),
DisplayName: pulumi.String("MyGroup"),
Description: pulumi.String("Some group name"),
})
if err != nil {
return err
}
_, err = identitystore.NewGroupMembership(ctx, "example", &identitystore.GroupMembershipArgs{
IdentityStoreId: pulumi.String(example.IdentityStoreIds[0]),
GroupId: exampleGroup.GroupId,
MemberId: exampleUser.UserId,
})
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.SsoAdmin.GetInstances.Invoke();
var exampleUser = new Aws.IdentityStore.User("example", new()
{
IdentityStoreId = example.Apply(getInstancesResult => getInstancesResult.IdentityStoreIds[0]),
DisplayName = "John Doe",
UserName = "john.doe@example.com",
Name = new Aws.IdentityStore.Inputs.UserNameArgs
{
FamilyName = "Doe",
GivenName = "John",
},
});
var exampleGroup = new Aws.IdentityStore.Group("example", new()
{
IdentityStoreId = example.Apply(getInstancesResult => getInstancesResult.IdentityStoreIds[0]),
DisplayName = "MyGroup",
Description = "Some group name",
});
var exampleGroupMembership = new Aws.IdentityStore.GroupMembership("example", new()
{
IdentityStoreId = example.Apply(getInstancesResult => getInstancesResult.IdentityStoreIds[0]),
GroupId = exampleGroup.GroupId,
MemberId = exampleUser.UserId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ssoadmin.SsoadminFunctions;
import com.pulumi.aws.identitystore.User;
import com.pulumi.aws.identitystore.UserArgs;
import com.pulumi.aws.identitystore.inputs.UserNameArgs;
import com.pulumi.aws.identitystore.Group;
import com.pulumi.aws.identitystore.GroupArgs;
import com.pulumi.aws.identitystore.GroupMembership;
import com.pulumi.aws.identitystore.GroupMembershipArgs;
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 = SsoadminFunctions.getInstances();
var exampleUser = new User("exampleUser", UserArgs.builder()
.identityStoreId(example.applyValue(getInstancesResult -> getInstancesResult.identityStoreIds()[0]))
.displayName("John Doe")
.userName("john.doe@example.com")
.name(UserNameArgs.builder()
.familyName("Doe")
.givenName("John")
.build())
.build());
var exampleGroup = new Group("exampleGroup", GroupArgs.builder()
.identityStoreId(example.applyValue(getInstancesResult -> getInstancesResult.identityStoreIds()[0]))
.displayName("MyGroup")
.description("Some group name")
.build());
var exampleGroupMembership = new GroupMembership("exampleGroupMembership", GroupMembershipArgs.builder()
.identityStoreId(example.applyValue(getInstancesResult -> getInstancesResult.identityStoreIds()[0]))
.groupId(exampleGroup.groupId())
.memberId(exampleUser.userId())
.build());
}
}
resources:
exampleUser:
type: aws:identitystore:User
name: example
properties:
identityStoreId: ${example.identityStoreIds[0]}
displayName: John Doe
userName: john.doe@example.com
name:
familyName: Doe
givenName: John
exampleGroup:
type: aws:identitystore:Group
name: example
properties:
identityStoreId: ${example.identityStoreIds[0]}
displayName: MyGroup
description: Some group name
exampleGroupMembership:
type: aws:identitystore:GroupMembership
name: example
properties:
identityStoreId: ${example.identityStoreIds[0]}
groupId: ${exampleGroup.groupId}
memberId: ${exampleUser.userId}
variables:
example:
fn::invoke:
Function: aws:ssoadmin:getInstances
Arguments: {}
Create GroupMembership Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GroupMembership(name: string, args: GroupMembershipArgs, opts?: CustomResourceOptions);
@overload
def GroupMembership(resource_name: str,
args: GroupMembershipArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GroupMembership(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
identity_store_id: Optional[str] = None,
member_id: Optional[str] = None)
func NewGroupMembership(ctx *Context, name string, args GroupMembershipArgs, opts ...ResourceOption) (*GroupMembership, error)
public GroupMembership(string name, GroupMembershipArgs args, CustomResourceOptions? opts = null)
public GroupMembership(String name, GroupMembershipArgs args)
public GroupMembership(String name, GroupMembershipArgs args, CustomResourceOptions options)
type: aws:identitystore:GroupMembership
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args GroupMembershipArgs
- 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 GroupMembershipArgs
- 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 GroupMembershipArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupMembershipArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupMembershipArgs
- 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 awsGroupMembershipResource = new Aws.IdentityStore.GroupMembership("awsGroupMembershipResource", new()
{
GroupId = "string",
IdentityStoreId = "string",
MemberId = "string",
});
example, err := identitystore.NewGroupMembership(ctx, "awsGroupMembershipResource", &identitystore.GroupMembershipArgs{
GroupId: pulumi.String("string"),
IdentityStoreId: pulumi.String("string"),
MemberId: pulumi.String("string"),
})
var awsGroupMembershipResource = new GroupMembership("awsGroupMembershipResource", GroupMembershipArgs.builder()
.groupId("string")
.identityStoreId("string")
.memberId("string")
.build());
aws_group_membership_resource = aws.identitystore.GroupMembership("awsGroupMembershipResource",
group_id="string",
identity_store_id="string",
member_id="string")
const awsGroupMembershipResource = new aws.identitystore.GroupMembership("awsGroupMembershipResource", {
groupId: "string",
identityStoreId: "string",
memberId: "string",
});
type: aws:identitystore:GroupMembership
properties:
groupId: string
identityStoreId: string
memberId: string
GroupMembership Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The GroupMembership resource accepts the following input properties:
- Group
Id string - The identifier for a group in the Identity Store.
- Identity
Store stringId - Identity Store ID associated with the Single Sign-On Instance.
- Member
Id string - The identifier for a user in the Identity Store.
- Group
Id string - The identifier for a group in the Identity Store.
- Identity
Store stringId - Identity Store ID associated with the Single Sign-On Instance.
- Member
Id string - The identifier for a user in the Identity Store.
- group
Id String - The identifier for a group in the Identity Store.
- identity
Store StringId - Identity Store ID associated with the Single Sign-On Instance.
- member
Id String - The identifier for a user in the Identity Store.
- group
Id string - The identifier for a group in the Identity Store.
- identity
Store stringId - Identity Store ID associated with the Single Sign-On Instance.
- member
Id string - The identifier for a user in the Identity Store.
- group_
id str - The identifier for a group in the Identity Store.
- identity_
store_ strid - Identity Store ID associated with the Single Sign-On Instance.
- member_
id str - The identifier for a user in the Identity Store.
- group
Id String - The identifier for a group in the Identity Store.
- identity
Store StringId - Identity Store ID associated with the Single Sign-On Instance.
- member
Id String - The identifier for a user in the Identity Store.
Outputs
All input properties are implicitly available as output properties. Additionally, the GroupMembership resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Membership
Id string - The identifier of the newly created group membership in the Identity Store.
- Id string
- The provider-assigned unique ID for this managed resource.
- Membership
Id string - The identifier of the newly created group membership in the Identity Store.
- id String
- The provider-assigned unique ID for this managed resource.
- membership
Id String - The identifier of the newly created group membership in the Identity Store.
- id string
- The provider-assigned unique ID for this managed resource.
- membership
Id string - The identifier of the newly created group membership in the Identity Store.
- id str
- The provider-assigned unique ID for this managed resource.
- membership_
id str - The identifier of the newly created group membership in the Identity Store.
- id String
- The provider-assigned unique ID for this managed resource.
- membership
Id String - The identifier of the newly created group membership in the Identity Store.
Look up Existing GroupMembership Resource
Get an existing GroupMembership 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?: GroupMembershipState, opts?: CustomResourceOptions): GroupMembership
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
identity_store_id: Optional[str] = None,
member_id: Optional[str] = None,
membership_id: Optional[str] = None) -> GroupMembership
func GetGroupMembership(ctx *Context, name string, id IDInput, state *GroupMembershipState, opts ...ResourceOption) (*GroupMembership, error)
public static GroupMembership Get(string name, Input<string> id, GroupMembershipState? state, CustomResourceOptions? opts = null)
public static GroupMembership get(String name, Output<String> id, GroupMembershipState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Group
Id string - The identifier for a group in the Identity Store.
- Identity
Store stringId - Identity Store ID associated with the Single Sign-On Instance.
- Member
Id string - The identifier for a user in the Identity Store.
- Membership
Id string - The identifier of the newly created group membership in the Identity Store.
- Group
Id string - The identifier for a group in the Identity Store.
- Identity
Store stringId - Identity Store ID associated with the Single Sign-On Instance.
- Member
Id string - The identifier for a user in the Identity Store.
- Membership
Id string - The identifier of the newly created group membership in the Identity Store.
- group
Id String - The identifier for a group in the Identity Store.
- identity
Store StringId - Identity Store ID associated with the Single Sign-On Instance.
- member
Id String - The identifier for a user in the Identity Store.
- membership
Id String - The identifier of the newly created group membership in the Identity Store.
- group
Id string - The identifier for a group in the Identity Store.
- identity
Store stringId - Identity Store ID associated with the Single Sign-On Instance.
- member
Id string - The identifier for a user in the Identity Store.
- membership
Id string - The identifier of the newly created group membership in the Identity Store.
- group_
id str - The identifier for a group in the Identity Store.
- identity_
store_ strid - Identity Store ID associated with the Single Sign-On Instance.
- member_
id str - The identifier for a user in the Identity Store.
- membership_
id str - The identifier of the newly created group membership in the Identity Store.
- group
Id String - The identifier for a group in the Identity Store.
- identity
Store StringId - Identity Store ID associated with the Single Sign-On Instance.
- member
Id String - The identifier for a user in the Identity Store.
- membership
Id String - The identifier of the newly created group membership in the Identity Store.
Import
Using pulumi import
, import aws_identitystore_group_membership
using the identity_store_id/membership_id
. For example:
$ pulumi import aws:identitystore/groupMembership:GroupMembership example d-0000000000/00000000-0000-0000-0000-000000000000
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
aws
Terraform Provider.