okta.UserGroupMemberships
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";
const test = new okta.user.User("test", {
firstName: "TestAcc",
lastName: "Smith",
login: "testAcc-replace_with_uuid@example.com",
email: "testAcc-replace_with_uuid@example.com",
});
const testUserGroupMemberships = new okta.UserGroupMemberships("test", {
userId: test.id,
groups: [
test1.id,
test2.id,
],
});
import pulumi
import pulumi_okta as okta
test = okta.user.User("test",
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("test",
user_id=test.id,
groups=[
test1["id"],
test2["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 {
test, err := user.NewUser(ctx, "test", &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, "test", &okta.UserGroupMembershipsArgs{
UserId: test.ID(),
Groups: pulumi.StringArray{
test1.Id,
test2.Id,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;
return await Deployment.RunAsync(() =>
{
var test = new Okta.User.User("test", new()
{
FirstName = "TestAcc",
LastName = "Smith",
Login = "testAcc-replace_with_uuid@example.com",
Email = "testAcc-replace_with_uuid@example.com",
});
var testUserGroupMemberships = new Okta.UserGroupMemberships("test", new()
{
UserId = test.Id,
Groups = new[]
{
test1.Id,
test2.Id,
},
});
});
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 test = new User("test", 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(test.id())
.groups(
test1.id(),
test2.id())
.build());
}
}
resources:
test:
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
name: test
properties:
userId: ${test.id}
groups:
- ${test1.id}
- ${test2.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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The UserGroupMemberships resource accepts the following input properties:
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.
Package Details
- Repository
- Okta pulumi/pulumi-okta
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
okta
Terraform Provider.