OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi
openstack.identity.UserMembershipV3
Explore with Pulumi AI
Manages a user membership to group V3 resource within OpenStack.
Note: You must have admin privileges in your OpenStack cloud to use this resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var project1 = new OpenStack.Identity.Project("project1");
var user1 = new OpenStack.Identity.User("user1", new()
{
DefaultProjectId = project1.Id,
});
var group1 = new OpenStack.Identity.GroupV3("group1", new()
{
Description = "group 1",
});
var role1 = new OpenStack.Identity.Role("role1");
var userMembership1 = new OpenStack.Identity.UserMembershipV3("userMembership1", new()
{
UserId = user1.Id,
GroupId = group1.Id,
});
var roleAssignment1 = new OpenStack.Identity.RoleAssignment("roleAssignment1", new()
{
GroupId = group1.Id,
ProjectId = project1.Id,
RoleId = role1.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/identity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
project1, err := identity.NewProject(ctx, "project1", nil)
if err != nil {
return err
}
user1, err := identity.NewUser(ctx, "user1", &identity.UserArgs{
DefaultProjectId: project1.ID(),
})
if err != nil {
return err
}
group1, err := identity.NewGroupV3(ctx, "group1", &identity.GroupV3Args{
Description: pulumi.String("group 1"),
})
if err != nil {
return err
}
role1, err := identity.NewRole(ctx, "role1", nil)
if err != nil {
return err
}
_, err = identity.NewUserMembershipV3(ctx, "userMembership1", &identity.UserMembershipV3Args{
UserId: user1.ID(),
GroupId: group1.ID(),
})
if err != nil {
return err
}
_, err = identity.NewRoleAssignment(ctx, "roleAssignment1", &identity.RoleAssignmentArgs{
GroupId: group1.ID(),
ProjectId: project1.ID(),
RoleId: role1.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.openstack.identity.Project;
import com.pulumi.openstack.identity.User;
import com.pulumi.openstack.identity.UserArgs;
import com.pulumi.openstack.identity.GroupV3;
import com.pulumi.openstack.identity.GroupV3Args;
import com.pulumi.openstack.identity.Role;
import com.pulumi.openstack.identity.UserMembershipV3;
import com.pulumi.openstack.identity.UserMembershipV3Args;
import com.pulumi.openstack.identity.RoleAssignment;
import com.pulumi.openstack.identity.RoleAssignmentArgs;
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 project1 = new Project("project1");
var user1 = new User("user1", UserArgs.builder()
.defaultProjectId(project1.id())
.build());
var group1 = new GroupV3("group1", GroupV3Args.builder()
.description("group 1")
.build());
var role1 = new Role("role1");
var userMembership1 = new UserMembershipV3("userMembership1", UserMembershipV3Args.builder()
.userId(user1.id())
.groupId(group1.id())
.build());
var roleAssignment1 = new RoleAssignment("roleAssignment1", RoleAssignmentArgs.builder()
.groupId(group1.id())
.projectId(project1.id())
.roleId(role1.id())
.build());
}
}
import pulumi
import pulumi_openstack as openstack
project1 = openstack.identity.Project("project1")
user1 = openstack.identity.User("user1", default_project_id=project1.id)
group1 = openstack.identity.GroupV3("group1", description="group 1")
role1 = openstack.identity.Role("role1")
user_membership1 = openstack.identity.UserMembershipV3("userMembership1",
user_id=user1.id,
group_id=group1.id)
role_assignment1 = openstack.identity.RoleAssignment("roleAssignment1",
group_id=group1.id,
project_id=project1.id,
role_id=role1.id)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const project1 = new openstack.identity.Project("project1", {});
const user1 = new openstack.identity.User("user1", {defaultProjectId: project1.id});
const group1 = new openstack.identity.GroupV3("group1", {description: "group 1"});
const role1 = new openstack.identity.Role("role1", {});
const userMembership1 = new openstack.identity.UserMembershipV3("userMembership1", {
userId: user1.id,
groupId: group1.id,
});
const roleAssignment1 = new openstack.identity.RoleAssignment("roleAssignment1", {
groupId: group1.id,
projectId: project1.id,
roleId: role1.id,
});
resources:
project1:
type: openstack:identity:Project
user1:
type: openstack:identity:User
properties:
defaultProjectId: ${project1.id}
group1:
type: openstack:identity:GroupV3
properties:
description: group 1
role1:
type: openstack:identity:Role
userMembership1:
type: openstack:identity:UserMembershipV3
properties:
userId: ${user1.id}
groupId: ${group1.id}
roleAssignment1:
type: openstack:identity:RoleAssignment
properties:
groupId: ${group1.id}
projectId: ${project1.id}
roleId: ${role1.id}
Create UserMembershipV3 Resource
new UserMembershipV3(name: string, args: UserMembershipV3Args, opts?: CustomResourceOptions);
@overload
def UserMembershipV3(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
region: Optional[str] = None,
user_id: Optional[str] = None)
@overload
def UserMembershipV3(resource_name: str,
args: UserMembershipV3Args,
opts: Optional[ResourceOptions] = None)
func NewUserMembershipV3(ctx *Context, name string, args UserMembershipV3Args, opts ...ResourceOption) (*UserMembershipV3, error)
public UserMembershipV3(string name, UserMembershipV3Args args, CustomResourceOptions? opts = null)
public UserMembershipV3(String name, UserMembershipV3Args args)
public UserMembershipV3(String name, UserMembershipV3Args args, CustomResourceOptions options)
type: openstack:identity:UserMembershipV3
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserMembershipV3Args
- 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 UserMembershipV3Args
- 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 UserMembershipV3Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserMembershipV3Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserMembershipV3Args
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
UserMembershipV3 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 UserMembershipV3 resource accepts the following input properties:
- Group
Id string - The UUID of group to which the user will be added. Changing this creates a new user membership.
- User
Id string - The UUID of user to use. Changing this creates a new user membership.
- Region string
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership.
- Group
Id string - The UUID of group to which the user will be added. Changing this creates a new user membership.
- User
Id string - The UUID of user to use. Changing this creates a new user membership.
- Region string
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership.
- group
Id String - The UUID of group to which the user will be added. Changing this creates a new user membership.
- user
Id String - The UUID of user to use. Changing this creates a new user membership.
- region String
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership.
- group
Id string - The UUID of group to which the user will be added. Changing this creates a new user membership.
- user
Id string - The UUID of user to use. Changing this creates a new user membership.
- region string
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership.
- group_
id str - The UUID of group to which the user will be added. Changing this creates a new user membership.
- user_
id str - The UUID of user to use. Changing this creates a new user membership.
- region str
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership.
- group
Id String - The UUID of group to which the user will be added. Changing this creates a new user membership.
- user
Id String - The UUID of user to use. Changing this creates a new user membership.
- region String
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership.
Outputs
All input properties are implicitly available as output properties. Additionally, the UserMembershipV3 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 UserMembershipV3 Resource
Get an existing UserMembershipV3 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?: UserMembershipV3State, opts?: CustomResourceOptions): UserMembershipV3
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
region: Optional[str] = None,
user_id: Optional[str] = None) -> UserMembershipV3
func GetUserMembershipV3(ctx *Context, name string, id IDInput, state *UserMembershipV3State, opts ...ResourceOption) (*UserMembershipV3, error)
public static UserMembershipV3 Get(string name, Input<string> id, UserMembershipV3State? state, CustomResourceOptions? opts = null)
public static UserMembershipV3 get(String name, Output<String> id, UserMembershipV3State 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 UUID of group to which the user will be added. Changing this creates a new user membership.
- Region string
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership. - User
Id string - The UUID of user to use. Changing this creates a new user membership.
- Group
Id string - The UUID of group to which the user will be added. Changing this creates a new user membership.
- Region string
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership. - User
Id string - The UUID of user to use. Changing this creates a new user membership.
- group
Id String - The UUID of group to which the user will be added. Changing this creates a new user membership.
- region String
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership. - user
Id String - The UUID of user to use. Changing this creates a new user membership.
- group
Id string - The UUID of group to which the user will be added. Changing this creates a new user membership.
- region string
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership. - user
Id string - The UUID of user to use. Changing this creates a new user membership.
- group_
id str - The UUID of group to which the user will be added. Changing this creates a new user membership.
- region str
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership. - user_
id str - The UUID of user to use. Changing this creates a new user membership.
- group
Id String - The UUID of group to which the user will be added. Changing this creates a new user membership.
- region String
- The region in which to obtain the V3 Identity client.
If omitted, the
region
argument of the provider is used. Changing this creates a new user membership. - user
Id String - The UUID of user to use. Changing this creates a new user membership.
Import
This resource can be imported by specifying all two arguments, separated by a forward slash:
$ pulumi import openstack:identity/userMembershipV3:UserMembershipV3 user_membership_1 user_id/group_id
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.