1. Packages
  2. Okta
  3. API Docs
  4. UserGroupMemberships
Okta v4.8.0 published on Saturday, Mar 2, 2024 by Pulumi

okta.UserGroupMemberships

Explore with Pulumi AI

okta logo
Okta v4.8.0 published on Saturday, Mar 2, 2024 by Pulumi

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var testUser = new Okta.User.User("testUser", new()
        {
            FirstName = "TestAcc",
            LastName = "Smith",
            Login = "testAcc-replace_with_uuid@example.com",
            Email = "testAcc-replace_with_uuid@example.com",
        });
    
        var testUserGroupMemberships = new Okta.UserGroupMemberships("testUserGroupMemberships", new()
        {
            UserId = testUser.Id,
            Groups = new[]
            {
                okta_group.Test_1.Id,
                okta_group.Test_2.Id,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/user"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testUser, err := user.NewUser(ctx, "testUser", &user.UserArgs{
    			FirstName: pulumi.String("TestAcc"),
    			LastName:  pulumi.String("Smith"),
    			Login:     pulumi.String("testAcc-replace_with_uuid@example.com"),
    			Email:     pulumi.String("testAcc-replace_with_uuid@example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = okta.NewUserGroupMemberships(ctx, "testUserGroupMemberships", &okta.UserGroupMembershipsArgs{
    			UserId: testUser.ID(),
    			Groups: pulumi.StringArray{
    				okta_group.Test_1.Id,
    				okta_group.Test_2.Id,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.user.User;
    import com.pulumi.okta.user.UserArgs;
    import com.pulumi.okta.UserGroupMemberships;
    import com.pulumi.okta.UserGroupMembershipsArgs;
    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 testUser = new User("testUser", UserArgs.builder()        
                .firstName("TestAcc")
                .lastName("Smith")
                .login("testAcc-replace_with_uuid@example.com")
                .email("testAcc-replace_with_uuid@example.com")
                .build());
    
            var testUserGroupMemberships = new UserGroupMemberships("testUserGroupMemberships", UserGroupMembershipsArgs.builder()        
                .userId(testUser.id())
                .groups(            
                    okta_group.test_1().id(),
                    okta_group.test_2().id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_okta as okta
    
    test_user = okta.user.User("testUser",
        first_name="TestAcc",
        last_name="Smith",
        login="testAcc-replace_with_uuid@example.com",
        email="testAcc-replace_with_uuid@example.com")
    test_user_group_memberships = okta.UserGroupMemberships("testUserGroupMemberships",
        user_id=test_user.id,
        groups=[
            okta_group["test_1"]["id"],
            okta_group["test_2"]["id"],
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const testUser = new okta.user.User("testUser", {
        firstName: "TestAcc",
        lastName: "Smith",
        login: "testAcc-replace_with_uuid@example.com",
        email: "testAcc-replace_with_uuid@example.com",
    });
    const testUserGroupMemberships = new okta.UserGroupMemberships("testUserGroupMemberships", {
        userId: testUser.id,
        groups: [
            okta_group.test_1.id,
            okta_group.test_2.id,
        ],
    });
    
    resources:
      testUser:
        type: okta:user:User
        properties:
          firstName: TestAcc
          lastName: Smith
          login: testAcc-replace_with_uuid@example.com
          email: testAcc-replace_with_uuid@example.com
      testUserGroupMemberships:
        type: okta:UserGroupMemberships
        properties:
          userId: ${testUser.id}
          groups:
            - ${okta_group.test_1.id}
            - ${okta_group.test_2.id}
    

    Create UserGroupMemberships Resource

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

    Constructor syntax

    new UserGroupMemberships(name: string, args: UserGroupMembershipsArgs, opts?: CustomResourceOptions);
    @overload
    def UserGroupMemberships(resource_name: str,
                             args: UserGroupMembershipsArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserGroupMemberships(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             groups: Optional[Sequence[str]] = None,
                             user_id: Optional[str] = None)
    func NewUserGroupMemberships(ctx *Context, name string, args UserGroupMembershipsArgs, opts ...ResourceOption) (*UserGroupMemberships, error)
    public UserGroupMemberships(string name, UserGroupMembershipsArgs args, CustomResourceOptions? opts = null)
    public UserGroupMemberships(String name, UserGroupMembershipsArgs args)
    public UserGroupMemberships(String name, UserGroupMembershipsArgs args, CustomResourceOptions options)
    
    type: okta:UserGroupMemberships
    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 UserGroupMembershipsArgs
    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 UserGroupMembershipsArgs
    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 UserGroupMembershipsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserGroupMembershipsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserGroupMembershipsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var userGroupMembershipsResource = new Okta.UserGroupMemberships("userGroupMembershipsResource", new()
    {
        Groups = new[]
        {
            "string",
        },
        UserId = "string",
    });
    
    example, err := okta.NewUserGroupMemberships(ctx, "userGroupMembershipsResource", &okta.UserGroupMembershipsArgs{
    	Groups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UserId: pulumi.String("string"),
    })
    
    var userGroupMembershipsResource = new UserGroupMemberships("userGroupMembershipsResource", UserGroupMembershipsArgs.builder()        
        .groups("string")
        .userId("string")
        .build());
    
    user_group_memberships_resource = okta.UserGroupMemberships("userGroupMembershipsResource",
        groups=["string"],
        user_id="string")
    
    const userGroupMembershipsResource = new okta.UserGroupMemberships("userGroupMembershipsResource", {
        groups: ["string"],
        userId: "string",
    });
    
    type: okta:UserGroupMemberships
    properties:
        groups:
            - string
        userId: string
    

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

    Groups List<string>
    The list of Okta group IDs which the user should have membership managed for.
    UserId string
    Okta user ID.
    Groups []string
    The list of Okta group IDs which the user should have membership managed for.
    UserId string
    Okta user ID.
    groups List<String>
    The list of Okta group IDs which the user should have membership managed for.
    userId String
    Okta user ID.
    groups string[]
    The list of Okta group IDs which the user should have membership managed for.
    userId string
    Okta user ID.
    groups Sequence[str]
    The list of Okta group IDs which the user should have membership managed for.
    user_id str
    Okta user ID.
    groups List<String>
    The list of Okta group IDs which the user should have membership managed for.
    userId String
    Okta user ID.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing UserGroupMemberships Resource

    Get an existing UserGroupMemberships 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?: UserGroupMembershipsState, opts?: CustomResourceOptions): UserGroupMemberships
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            groups: Optional[Sequence[str]] = None,
            user_id: Optional[str] = None) -> UserGroupMemberships
    func GetUserGroupMemberships(ctx *Context, name string, id IDInput, state *UserGroupMembershipsState, opts ...ResourceOption) (*UserGroupMemberships, error)
    public static UserGroupMemberships Get(string name, Input<string> id, UserGroupMembershipsState? state, CustomResourceOptions? opts = null)
    public static UserGroupMemberships get(String name, Output<String> id, UserGroupMembershipsState 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:
    Groups List<string>
    The list of Okta group IDs which the user should have membership managed for.
    UserId string
    Okta user ID.
    Groups []string
    The list of Okta group IDs which the user should have membership managed for.
    UserId string
    Okta user ID.
    groups List<String>
    The list of Okta group IDs which the user should have membership managed for.
    userId String
    Okta user ID.
    groups string[]
    The list of Okta group IDs which the user should have membership managed for.
    userId string
    Okta user ID.
    groups Sequence[str]
    The list of Okta group IDs which the user should have membership managed for.
    user_id str
    Okta user ID.
    groups List<String>
    The list of Okta group IDs which the user should have membership managed for.
    userId String
    Okta user ID.

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Okta v4.8.0 published on Saturday, Mar 2, 2024 by Pulumi