1. Packages
  2. Ibm Provider
  3. API Docs
  4. IamAccessGroupMembers
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.IamAccessGroupMembers

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    WARNING: Multiple ibm.IamAccessGroupMembers resources with the same group name produce inconsistent behavior!

    Add, update, or remove users from an IAM access group members. For more information, about IAM access group members, see managing public access to resources.

    Example Usage

    The following example creates an IAM access group, a service ID and a trusted profile ID. Then, the service ID, profile ID and a user with the ID user@ibm.com is added to the access group.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const accgroup = new ibm.IamAccessGroup("accgroup", {});
    const serviceID = new ibm.IamServiceId("serviceID", {});
    const profileID = new ibm.IamTrustedProfile("profileID", {});
    const accgroupmem = new ibm.IamAccessGroupMembers("accgroupmem", {
        accessGroupId: accgroup.iamAccessGroupId,
        ibmIds: ["user@ibm.com"],
        iamServiceIds: [serviceID.iamServiceIdId],
        iamProfileIds: [profileID.iamTrustedProfileId],
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    accgroup = ibm.IamAccessGroup("accgroup")
    service_id = ibm.IamServiceId("serviceID")
    profile_id = ibm.IamTrustedProfile("profileID")
    accgroupmem = ibm.IamAccessGroupMembers("accgroupmem",
        access_group_id=accgroup.iam_access_group_id,
        ibm_ids=["user@ibm.com"],
        iam_service_ids=[service_id.iam_service_id_id],
        iam_profile_ids=[profile_id.iam_trusted_profile_id])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		accgroup, err := ibm.NewIamAccessGroup(ctx, "accgroup", nil)
    		if err != nil {
    			return err
    		}
    		serviceID, err := ibm.NewIamServiceId(ctx, "serviceID", nil)
    		if err != nil {
    			return err
    		}
    		profileID, err := ibm.NewIamTrustedProfile(ctx, "profileID", nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewIamAccessGroupMembers(ctx, "accgroupmem", &ibm.IamAccessGroupMembersArgs{
    			AccessGroupId: accgroup.IamAccessGroupId,
    			IbmIds: pulumi.StringArray{
    				pulumi.String("user@ibm.com"),
    			},
    			IamServiceIds: pulumi.StringArray{
    				serviceID.IamServiceIdId,
    			},
    			IamProfileIds: pulumi.StringArray{
    				profileID.IamTrustedProfileId,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var accgroup = new Ibm.IamAccessGroup("accgroup");
    
        var serviceID = new Ibm.IamServiceId("serviceID");
    
        var profileID = new Ibm.IamTrustedProfile("profileID");
    
        var accgroupmem = new Ibm.IamAccessGroupMembers("accgroupmem", new()
        {
            AccessGroupId = accgroup.IamAccessGroupId,
            IbmIds = new[]
            {
                "user@ibm.com",
            },
            IamServiceIds = new[]
            {
                serviceID.IamServiceIdId,
            },
            IamProfileIds = new[]
            {
                profileID.IamTrustedProfileId,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IamAccessGroup;
    import com.pulumi.ibm.IamServiceId;
    import com.pulumi.ibm.IamTrustedProfile;
    import com.pulumi.ibm.IamAccessGroupMembers;
    import com.pulumi.ibm.IamAccessGroupMembersArgs;
    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) {
            var accgroup = new IamAccessGroup("accgroup");
    
            var serviceID = new IamServiceId("serviceID");
    
            var profileID = new IamTrustedProfile("profileID");
    
            var accgroupmem = new IamAccessGroupMembers("accgroupmem", IamAccessGroupMembersArgs.builder()
                .accessGroupId(accgroup.iamAccessGroupId())
                .ibmIds("user@ibm.com")
                .iamServiceIds(serviceID.iamServiceIdId())
                .iamProfileIds(profileID.iamTrustedProfileId())
                .build());
    
        }
    }
    
    resources:
      accgroup:
        type: ibm:IamAccessGroup
      serviceID:
        type: ibm:IamServiceId
      profileID:
        type: ibm:IamTrustedProfile
      accgroupmem:
        type: ibm:IamAccessGroupMembers
        properties:
          accessGroupId: ${accgroup.iamAccessGroupId}
          ibmIds:
            - user@ibm.com
          iamServiceIds:
            - ${serviceID.iamServiceIdId}
          iamProfileIds:
            - ${profileID.iamTrustedProfileId}
    

    Create IamAccessGroupMembers Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new IamAccessGroupMembers(name: string, args: IamAccessGroupMembersArgs, opts?: CustomResourceOptions);
    @overload
    def IamAccessGroupMembers(resource_name: str,
                              args: IamAccessGroupMembersArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamAccessGroupMembers(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              access_group_id: Optional[str] = None,
                              iam_access_group_members_id: Optional[str] = None,
                              iam_profile_ids: Optional[Sequence[str]] = None,
                              iam_service_ids: Optional[Sequence[str]] = None,
                              ibm_ids: Optional[Sequence[str]] = None)
    func NewIamAccessGroupMembers(ctx *Context, name string, args IamAccessGroupMembersArgs, opts ...ResourceOption) (*IamAccessGroupMembers, error)
    public IamAccessGroupMembers(string name, IamAccessGroupMembersArgs args, CustomResourceOptions? opts = null)
    public IamAccessGroupMembers(String name, IamAccessGroupMembersArgs args)
    public IamAccessGroupMembers(String name, IamAccessGroupMembersArgs args, CustomResourceOptions options)
    
    type: ibm:IamAccessGroupMembers
    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 IamAccessGroupMembersArgs
    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 IamAccessGroupMembersArgs
    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 IamAccessGroupMembersArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamAccessGroupMembersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamAccessGroupMembersArgs
    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 iamAccessGroupMembersResource = new Ibm.IamAccessGroupMembers("iamAccessGroupMembersResource", new()
    {
        AccessGroupId = "string",
        IamAccessGroupMembersId = "string",
        IamProfileIds = new[]
        {
            "string",
        },
        IamServiceIds = new[]
        {
            "string",
        },
        IbmIds = new[]
        {
            "string",
        },
    });
    
    example, err := ibm.NewIamAccessGroupMembers(ctx, "iamAccessGroupMembersResource", &ibm.IamAccessGroupMembersArgs{
    	AccessGroupId:           pulumi.String("string"),
    	IamAccessGroupMembersId: pulumi.String("string"),
    	IamProfileIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	IamServiceIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	IbmIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var iamAccessGroupMembersResource = new IamAccessGroupMembers("iamAccessGroupMembersResource", IamAccessGroupMembersArgs.builder()
        .accessGroupId("string")
        .iamAccessGroupMembersId("string")
        .iamProfileIds("string")
        .iamServiceIds("string")
        .ibmIds("string")
        .build());
    
    iam_access_group_members_resource = ibm.IamAccessGroupMembers("iamAccessGroupMembersResource",
        access_group_id="string",
        iam_access_group_members_id="string",
        iam_profile_ids=["string"],
        iam_service_ids=["string"],
        ibm_ids=["string"])
    
    const iamAccessGroupMembersResource = new ibm.IamAccessGroupMembers("iamAccessGroupMembersResource", {
        accessGroupId: "string",
        iamAccessGroupMembersId: "string",
        iamProfileIds: ["string"],
        iamServiceIds: ["string"],
        ibmIds: ["string"],
    });
    
    type: ibm:IamAccessGroupMembers
    properties:
        accessGroupId: string
        iamAccessGroupMembersId: string
        iamProfileIds:
            - string
        iamServiceIds:
            - string
        ibmIds:
            - string
    

    IamAccessGroupMembers 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 IamAccessGroupMembers resource accepts the following input properties:

    AccessGroupId string
    The ID of the access group.
    IamAccessGroupMembersId string
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    IamProfileIds List<string>
    A list of trusted profile IDS that you want to add to or remove from the access group.
    IamServiceIds List<string>
    A list of service IDS that you want to add to or remove from the access group.
    IbmIds List<string>
    A list of IBM IDs that you want to add to or remove from the access group.
    AccessGroupId string
    The ID of the access group.
    IamAccessGroupMembersId string
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    IamProfileIds []string
    A list of trusted profile IDS that you want to add to or remove from the access group.
    IamServiceIds []string
    A list of service IDS that you want to add to or remove from the access group.
    IbmIds []string
    A list of IBM IDs that you want to add to or remove from the access group.
    accessGroupId String
    The ID of the access group.
    iamAccessGroupMembersId String
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iamProfileIds List<String>
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iamServiceIds List<String>
    A list of service IDS that you want to add to or remove from the access group.
    ibmIds List<String>
    A list of IBM IDs that you want to add to or remove from the access group.
    accessGroupId string
    The ID of the access group.
    iamAccessGroupMembersId string
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iamProfileIds string[]
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iamServiceIds string[]
    A list of service IDS that you want to add to or remove from the access group.
    ibmIds string[]
    A list of IBM IDs that you want to add to or remove from the access group.
    access_group_id str
    The ID of the access group.
    iam_access_group_members_id str
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iam_profile_ids Sequence[str]
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iam_service_ids Sequence[str]
    A list of service IDS that you want to add to or remove from the access group.
    ibm_ids Sequence[str]
    A list of IBM IDs that you want to add to or remove from the access group.
    accessGroupId String
    The ID of the access group.
    iamAccessGroupMembersId String
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iamProfileIds List<String>
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iamServiceIds List<String>
    A list of service IDS that you want to add to or remove from the access group.
    ibmIds List<String>
    A list of IBM IDs that you want to add to or remove from the access group.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the IamAccessGroupMembers resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Members List<IamAccessGroupMembersMember>
    (Array of objects) A list of members that are included in the access group.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members []IamAccessGroupMembersMember
    (Array of objects) A list of members that are included in the access group.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<IamAccessGroupMembersMember>
    (Array of objects) A list of members that are included in the access group.
    id string
    The provider-assigned unique ID for this managed resource.
    members IamAccessGroupMembersMember[]
    (Array of objects) A list of members that are included in the access group.
    id str
    The provider-assigned unique ID for this managed resource.
    members Sequence[IamAccessGroupMembersMember]
    (Array of objects) A list of members that are included in the access group.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<Property Map>
    (Array of objects) A list of members that are included in the access group.

    Look up Existing IamAccessGroupMembers Resource

    Get an existing IamAccessGroupMembers 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?: IamAccessGroupMembersState, opts?: CustomResourceOptions): IamAccessGroupMembers
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_group_id: Optional[str] = None,
            iam_access_group_members_id: Optional[str] = None,
            iam_profile_ids: Optional[Sequence[str]] = None,
            iam_service_ids: Optional[Sequence[str]] = None,
            ibm_ids: Optional[Sequence[str]] = None,
            members: Optional[Sequence[IamAccessGroupMembersMemberArgs]] = None) -> IamAccessGroupMembers
    func GetIamAccessGroupMembers(ctx *Context, name string, id IDInput, state *IamAccessGroupMembersState, opts ...ResourceOption) (*IamAccessGroupMembers, error)
    public static IamAccessGroupMembers Get(string name, Input<string> id, IamAccessGroupMembersState? state, CustomResourceOptions? opts = null)
    public static IamAccessGroupMembers get(String name, Output<String> id, IamAccessGroupMembersState state, CustomResourceOptions options)
    resources:  _:    type: ibm:IamAccessGroupMembers    get:      id: ${id}
    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.
    The following state arguments are supported:
    AccessGroupId string
    The ID of the access group.
    IamAccessGroupMembersId string
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    IamProfileIds List<string>
    A list of trusted profile IDS that you want to add to or remove from the access group.
    IamServiceIds List<string>
    A list of service IDS that you want to add to or remove from the access group.
    IbmIds List<string>
    A list of IBM IDs that you want to add to or remove from the access group.
    Members List<IamAccessGroupMembersMember>
    (Array of objects) A list of members that are included in the access group.
    AccessGroupId string
    The ID of the access group.
    IamAccessGroupMembersId string
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    IamProfileIds []string
    A list of trusted profile IDS that you want to add to or remove from the access group.
    IamServiceIds []string
    A list of service IDS that you want to add to or remove from the access group.
    IbmIds []string
    A list of IBM IDs that you want to add to or remove from the access group.
    Members []IamAccessGroupMembersMemberArgs
    (Array of objects) A list of members that are included in the access group.
    accessGroupId String
    The ID of the access group.
    iamAccessGroupMembersId String
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iamProfileIds List<String>
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iamServiceIds List<String>
    A list of service IDS that you want to add to or remove from the access group.
    ibmIds List<String>
    A list of IBM IDs that you want to add to or remove from the access group.
    members List<IamAccessGroupMembersMember>
    (Array of objects) A list of members that are included in the access group.
    accessGroupId string
    The ID of the access group.
    iamAccessGroupMembersId string
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iamProfileIds string[]
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iamServiceIds string[]
    A list of service IDS that you want to add to or remove from the access group.
    ibmIds string[]
    A list of IBM IDs that you want to add to or remove from the access group.
    members IamAccessGroupMembersMember[]
    (Array of objects) A list of members that are included in the access group.
    access_group_id str
    The ID of the access group.
    iam_access_group_members_id str
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iam_profile_ids Sequence[str]
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iam_service_ids Sequence[str]
    A list of service IDS that you want to add to or remove from the access group.
    ibm_ids Sequence[str]
    A list of IBM IDs that you want to add to or remove from the access group.
    members Sequence[IamAccessGroupMembersMemberArgs]
    (Array of objects) A list of members that are included in the access group.
    accessGroupId String
    The ID of the access group.
    iamAccessGroupMembersId String
    (String) The unique identifier of the access group members. The ID is returned in the format <iam_access_group_ID>/<random_ID>.
    iamProfileIds List<String>
    A list of trusted profile IDS that you want to add to or remove from the access group.
    iamServiceIds List<String>
    A list of service IDS that you want to add to or remove from the access group.
    ibmIds List<String>
    A list of IBM IDs that you want to add to or remove from the access group.
    members List<Property Map>
    (Array of objects) A list of members that are included in the access group.

    Supporting Types

    IamAccessGroupMembersMember, IamAccessGroupMembersMemberArgs

    IamId string
    (String) The IBM ID or service ID or profile ID of the member.
    Type string
    (String) The type of member. Supported values are user or service or profile.
    IamId string
    (String) The IBM ID or service ID or profile ID of the member.
    Type string
    (String) The type of member. Supported values are user or service or profile.
    iamId String
    (String) The IBM ID or service ID or profile ID of the member.
    type String
    (String) The type of member. Supported values are user or service or profile.
    iamId string
    (String) The IBM ID or service ID or profile ID of the member.
    type string
    (String) The type of member. Supported values are user or service or profile.
    iam_id str
    (String) The IBM ID or service ID or profile ID of the member.
    type str
    (String) The type of member. Supported values are user or service or profile.
    iamId String
    (String) The IBM ID or service ID or profile ID of the member.
    type String
    (String) The type of member. Supported values are user or service or profile.

    Import

    The ibm_iam_access_group_members can be imported by using access group ID and random ID.

    Syntax

    $ pulumi import ibm:index/iamAccessGroupMembers:IamAccessGroupMembers example <accessgroupID>/<random_ID>
    

    Example

    $ pulumi import ibm:index/iamAccessGroupMembers:IamAccessGroupMembers example AccessGroupId-5391772e-1207-45e8-b032-2a21941c11ab/2018-10-04 06:27:40.041599641 +0000 UTC
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud