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
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const project1 = new openstack.identity.Project("project_1", {name: "project_1"});
const user1 = new openstack.identity.User("user_1", {
name: "user_1",
defaultProjectId: project1.id,
});
const group1 = new openstack.identity.GroupV3("group_1", {
name: "group_1",
description: "group 1",
});
const role1 = new openstack.identity.Role("role_1", {name: "role_1"});
const userMembership1 = new openstack.identity.UserMembershipV3("user_membership_1", {
userId: user1.id,
groupId: group1.id,
});
const roleAssignment1 = new openstack.identity.RoleAssignment("role_assignment_1", {
groupId: group1.id,
projectId: project1.id,
roleId: role1.id,
});
import pulumi
import pulumi_openstack as openstack
project1 = openstack.identity.Project("project_1", name="project_1")
user1 = openstack.identity.User("user_1",
name="user_1",
default_project_id=project1.id)
group1 = openstack.identity.GroupV3("group_1",
name="group_1",
description="group 1")
role1 = openstack.identity.Role("role_1", name="role_1")
user_membership1 = openstack.identity.UserMembershipV3("user_membership_1",
user_id=user1.id,
group_id=group1.id)
role_assignment1 = openstack.identity.RoleAssignment("role_assignment_1",
group_id=group1.id,
project_id=project1.id,
role_id=role1.id)
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v4/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, "project_1", &identity.ProjectArgs{
Name: pulumi.String("project_1"),
})
if err != nil {
return err
}
user1, err := identity.NewUser(ctx, "user_1", &identity.UserArgs{
Name: pulumi.String("user_1"),
DefaultProjectId: project1.ID(),
})
if err != nil {
return err
}
group1, err := identity.NewGroupV3(ctx, "group_1", &identity.GroupV3Args{
Name: pulumi.String("group_1"),
Description: pulumi.String("group 1"),
})
if err != nil {
return err
}
role1, err := identity.NewRole(ctx, "role_1", &identity.RoleArgs{
Name: pulumi.String("role_1"),
})
if err != nil {
return err
}
_, err = identity.NewUserMembershipV3(ctx, "user_membership_1", &identity.UserMembershipV3Args{
UserId: user1.ID(),
GroupId: group1.ID(),
})
if err != nil {
return err
}
_, err = identity.NewRoleAssignment(ctx, "role_assignment_1", &identity.RoleAssignmentArgs{
GroupId: group1.ID(),
ProjectId: project1.ID(),
RoleId: role1.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var project1 = new OpenStack.Identity.Project("project_1", new()
{
Name = "project_1",
});
var user1 = new OpenStack.Identity.User("user_1", new()
{
Name = "user_1",
DefaultProjectId = project1.Id,
});
var group1 = new OpenStack.Identity.GroupV3("group_1", new()
{
Name = "group_1",
Description = "group 1",
});
var role1 = new OpenStack.Identity.Role("role_1", new()
{
Name = "role_1",
});
var userMembership1 = new OpenStack.Identity.UserMembershipV3("user_membership_1", new()
{
UserId = user1.Id,
GroupId = group1.Id,
});
var roleAssignment1 = new OpenStack.Identity.RoleAssignment("role_assignment_1", new()
{
GroupId = group1.Id,
ProjectId = project1.Id,
RoleId = role1.Id,
});
});
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.ProjectArgs;
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.RoleArgs;
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", ProjectArgs.builder()
.name("project_1")
.build());
var user1 = new User("user1", UserArgs.builder()
.name("user_1")
.defaultProjectId(project1.id())
.build());
var group1 = new GroupV3("group1", GroupV3Args.builder()
.name("group_1")
.description("group 1")
.build());
var role1 = new Role("role1", RoleArgs.builder()
.name("role_1")
.build());
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());
}
}
resources:
project1:
type: openstack:identity:Project
name: project_1
properties:
name: project_1
user1:
type: openstack:identity:User
name: user_1
properties:
name: user_1
defaultProjectId: ${project1.id}
group1:
type: openstack:identity:GroupV3
name: group_1
properties:
name: group_1
description: group 1
role1:
type: openstack:identity:Role
name: role_1
properties:
name: role_1
userMembership1:
type: openstack:identity:UserMembershipV3
name: user_membership_1
properties:
userId: ${user1.id}
groupId: ${group1.id}
roleAssignment1:
type: openstack:identity:RoleAssignment
name: role_assignment_1
properties:
groupId: ${group1.id}
projectId: ${project1.id}
roleId: ${role1.id}
Create UserMembershipV3 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserMembershipV3(name: string, args: UserMembershipV3Args, opts?: CustomResourceOptions);
@overload
def UserMembershipV3(resource_name: str,
args: UserMembershipV3Args,
opts: Optional[ResourceOptions] = None)
@overload
def UserMembershipV3(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
user_id: Optional[str] = None,
region: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var userMembershipV3Resource = new OpenStack.Identity.UserMembershipV3("userMembershipV3Resource", new()
{
GroupId = "string",
UserId = "string",
Region = "string",
});
example, err := identity.NewUserMembershipV3(ctx, "userMembershipV3Resource", &identity.UserMembershipV3Args{
GroupId: pulumi.String("string"),
UserId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var userMembershipV3Resource = new UserMembershipV3("userMembershipV3Resource", UserMembershipV3Args.builder()
.groupId("string")
.userId("string")
.region("string")
.build());
user_membership_v3_resource = openstack.identity.UserMembershipV3("userMembershipV3Resource",
group_id="string",
user_id="string",
region="string")
const userMembershipV3Resource = new openstack.identity.UserMembershipV3("userMembershipV3Resource", {
groupId: "string",
userId: "string",
region: "string",
});
type: openstack:identity:UserMembershipV3
properties:
groupId: string
region: string
userId: string
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.