1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. UserGroupMembership
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi

oci.Identity.UserGroupMembership

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi

    This resource provides the User Group Membership resource in Oracle Cloud Infrastructure Identity service.

    Adds the specified user to the specified group and returns a UserGroupMembership object with its own OCID.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testUserGroupMembership = new oci.identity.UserGroupMembership("test_user_group_membership", {
        groupId: testGroup.id,
        userId: testUser.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_user_group_membership = oci.identity.UserGroupMembership("test_user_group_membership",
        group_id=test_group["id"],
        user_id=test_user["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Identity.NewUserGroupMembership(ctx, "test_user_group_membership", &Identity.UserGroupMembershipArgs{
    			GroupId: pulumi.Any(testGroup.Id),
    			UserId:  pulumi.Any(testUser.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testUserGroupMembership = new Oci.Identity.UserGroupMembership("test_user_group_membership", new()
        {
            GroupId = testGroup.Id,
            UserId = testUser.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Identity.UserGroupMembership;
    import com.pulumi.oci.Identity.UserGroupMembershipArgs;
    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 testUserGroupMembership = new UserGroupMembership("testUserGroupMembership", UserGroupMembershipArgs.builder()
                .groupId(testGroup.id())
                .userId(testUser.id())
                .build());
    
        }
    }
    
    resources:
      testUserGroupMembership:
        type: oci:Identity:UserGroupMembership
        name: test_user_group_membership
        properties:
          groupId: ${testGroup.id}
          userId: ${testUser.id}
    

    Create UserGroupMembership Resource

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

    Constructor syntax

    new UserGroupMembership(name: string, args: UserGroupMembershipArgs, opts?: CustomResourceOptions);
    @overload
    def UserGroupMembership(resource_name: str,
                            args: UserGroupMembershipArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserGroupMembership(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            group_id: Optional[str] = None,
                            user_id: Optional[str] = None,
                            compartment_id: Optional[str] = None)
    func NewUserGroupMembership(ctx *Context, name string, args UserGroupMembershipArgs, opts ...ResourceOption) (*UserGroupMembership, error)
    public UserGroupMembership(string name, UserGroupMembershipArgs args, CustomResourceOptions? opts = null)
    public UserGroupMembership(String name, UserGroupMembershipArgs args)
    public UserGroupMembership(String name, UserGroupMembershipArgs args, CustomResourceOptions options)
    
    type: oci:Identity:UserGroupMembership
    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 UserGroupMembershipArgs
    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 UserGroupMembershipArgs
    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 UserGroupMembershipArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserGroupMembershipArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserGroupMembershipArgs
    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 userGroupMembershipResource = new Oci.Identity.UserGroupMembership("userGroupMembershipResource", new()
    {
        GroupId = "string",
        UserId = "string",
        CompartmentId = "string",
    });
    
    example, err := Identity.NewUserGroupMembership(ctx, "userGroupMembershipResource", &Identity.UserGroupMembershipArgs{
    	GroupId:       pulumi.String("string"),
    	UserId:        pulumi.String("string"),
    	CompartmentId: pulumi.String("string"),
    })
    
    var userGroupMembershipResource = new UserGroupMembership("userGroupMembershipResource", UserGroupMembershipArgs.builder()
        .groupId("string")
        .userId("string")
        .compartmentId("string")
        .build());
    
    user_group_membership_resource = oci.identity.UserGroupMembership("userGroupMembershipResource",
        group_id="string",
        user_id="string",
        compartment_id="string")
    
    const userGroupMembershipResource = new oci.identity.UserGroupMembership("userGroupMembershipResource", {
        groupId: "string",
        userId: "string",
        compartmentId: "string",
    });
    
    type: oci:Identity:UserGroupMembership
    properties:
        compartmentId: string
        groupId: string
        userId: string
    

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

    GroupId string
    The OCID of the group.
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    The OCID of the tenancy containing the user, group, and membership object.
    GroupId string
    The OCID of the group.
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    The OCID of the tenancy containing the user, group, and membership object.
    groupId String
    The OCID of the group.
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    The OCID of the tenancy containing the user, group, and membership object.
    groupId string
    The OCID of the group.
    userId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId string
    The OCID of the tenancy containing the user, group, and membership object.
    group_id str
    The OCID of the group.
    user_id str

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_id str
    The OCID of the tenancy containing the user, group, and membership object.
    groupId String
    The OCID of the group.
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    The OCID of the tenancy containing the user, group, and membership object.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    State string
    The membership's current state.
    TimeCreated string
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    State string
    The membership's current state.
    TimeCreated string
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    state String
    The membership's current state.
    timeCreated String
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    id string
    The provider-assigned unique ID for this managed resource.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    state string
    The membership's current state.
    timeCreated string
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    id str
    The provider-assigned unique ID for this managed resource.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    state str
    The membership's current state.
    time_created str
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    state String
    The membership's current state.
    timeCreated String
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

    Look up Existing UserGroupMembership Resource

    Get an existing UserGroupMembership 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?: UserGroupMembershipState, opts?: CustomResourceOptions): UserGroupMembership
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_id: Optional[str] = None,
            group_id: Optional[str] = None,
            inactive_state: Optional[str] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None,
            user_id: Optional[str] = None) -> UserGroupMembership
    func GetUserGroupMembership(ctx *Context, name string, id IDInput, state *UserGroupMembershipState, opts ...ResourceOption) (*UserGroupMembership, error)
    public static UserGroupMembership Get(string name, Input<string> id, UserGroupMembershipState? state, CustomResourceOptions? opts = null)
    public static UserGroupMembership get(String name, Output<String> id, UserGroupMembershipState 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.
    The following state arguments are supported:
    CompartmentId string
    The OCID of the tenancy containing the user, group, and membership object.
    GroupId string
    The OCID of the group.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    State string
    The membership's current state.
    TimeCreated string
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    The OCID of the tenancy containing the user, group, and membership object.
    GroupId string
    The OCID of the group.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    State string
    The membership's current state.
    TimeCreated string
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    The OCID of the tenancy containing the user, group, and membership object.
    groupId String
    The OCID of the group.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    state String
    The membership's current state.
    timeCreated String
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId string
    The OCID of the tenancy containing the user, group, and membership object.
    groupId string
    The OCID of the group.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    state string
    The membership's current state.
    timeCreated string
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    userId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_id str
    The OCID of the tenancy containing the user, group, and membership object.
    group_id str
    The OCID of the group.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    state str
    The membership's current state.
    time_created str
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    user_id str

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    The OCID of the tenancy containing the user, group, and membership object.
    groupId String
    The OCID of the group.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    state String
    The membership's current state.
    timeCreated String
    Date and time the membership was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Import

    UserGroupMemberships can be imported using the id, e.g.

    $ pulumi import oci:Identity/userGroupMembership:UserGroupMembership test_user_group_membership "id"
    

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

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi