discord.MemberRoles
Explore with Pulumi AI
A resource to manage member roles for a server.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as discord from "@pulumi/discord";
const jake = new discord.MemberRoles("jake", {
userId: _var.user_id,
serverId: _var.server_id,
roles: [
{
roleId: _var.role_id_to_add,
},
{
roleId: _var.role_id_to_always_remove,
hasRole: false,
},
],
});
import pulumi
import pulumi_discord as discord
jake = discord.MemberRoles("jake",
user_id=var["user_id"],
server_id=var["server_id"],
roles=[
{
"role_id": var["role_id_to_add"],
},
{
"role_id": var["role_id_to_always_remove"],
"has_role": False,
},
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/discord/v2/discord"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := discord.NewMemberRoles(ctx, "jake", &discord.MemberRolesArgs{
UserId: pulumi.Any(_var.User_id),
ServerId: pulumi.Any(_var.Server_id),
Roles: discord.MemberRolesRoleArray{
&discord.MemberRolesRoleArgs{
RoleId: pulumi.Any(_var.Role_id_to_add),
},
&discord.MemberRolesRoleArgs{
RoleId: pulumi.Any(_var.Role_id_to_always_remove),
HasRole: pulumi.Bool(false),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Discord = Pulumi.Discord;
return await Deployment.RunAsync(() =>
{
var jake = new Discord.MemberRoles("jake", new()
{
UserId = @var.User_id,
ServerId = @var.Server_id,
Roles = new[]
{
new Discord.Inputs.MemberRolesRoleArgs
{
RoleId = @var.Role_id_to_add,
},
new Discord.Inputs.MemberRolesRoleArgs
{
RoleId = @var.Role_id_to_always_remove,
HasRole = false,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.discord.MemberRoles;
import com.pulumi.discord.MemberRolesArgs;
import com.pulumi.discord.inputs.MemberRolesRoleArgs;
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 jake = new MemberRoles("jake", MemberRolesArgs.builder()
.userId(var_.user_id())
.serverId(var_.server_id())
.roles(
MemberRolesRoleArgs.builder()
.roleId(var_.role_id_to_add())
.build(),
MemberRolesRoleArgs.builder()
.roleId(var_.role_id_to_always_remove())
.hasRole(false)
.build())
.build());
}
}
resources:
jake:
type: discord:MemberRoles
properties:
userId: ${var.user_id}
serverId: ${var.server_id}
roles:
- roleId: ${var.role_id_to_add}
- roleId: ${var.role_id_to_always_remove}
hasRole: false
Create MemberRoles Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MemberRoles(name: string, args: MemberRolesArgs, opts?: CustomResourceOptions);
@overload
def MemberRoles(resource_name: str,
args: MemberRolesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MemberRoles(resource_name: str,
opts: Optional[ResourceOptions] = None,
roles: Optional[Sequence[MemberRolesRoleArgs]] = None,
server_id: Optional[str] = None,
user_id: Optional[str] = None,
member_roles_id: Optional[str] = None)
func NewMemberRoles(ctx *Context, name string, args MemberRolesArgs, opts ...ResourceOption) (*MemberRoles, error)
public MemberRoles(string name, MemberRolesArgs args, CustomResourceOptions? opts = null)
public MemberRoles(String name, MemberRolesArgs args)
public MemberRoles(String name, MemberRolesArgs args, CustomResourceOptions options)
type: discord:MemberRoles
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 MemberRolesArgs
- 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 MemberRolesArgs
- 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 MemberRolesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MemberRolesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MemberRolesArgs
- 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 memberRolesResource = new Discord.MemberRoles("memberRolesResource", new()
{
Roles = new[]
{
new Discord.Inputs.MemberRolesRoleArgs
{
RoleId = "string",
HasRole = false,
},
},
ServerId = "string",
UserId = "string",
MemberRolesId = "string",
});
example, err := discord.NewMemberRoles(ctx, "memberRolesResource", &discord.MemberRolesArgs{
Roles: .MemberRolesRoleArray{
&.MemberRolesRoleArgs{
RoleId: pulumi.String("string"),
HasRole: pulumi.Bool(false),
},
},
ServerId: pulumi.String("string"),
UserId: pulumi.String("string"),
MemberRolesId: pulumi.String("string"),
})
var memberRolesResource = new MemberRoles("memberRolesResource", MemberRolesArgs.builder()
.roles(MemberRolesRoleArgs.builder()
.roleId("string")
.hasRole(false)
.build())
.serverId("string")
.userId("string")
.memberRolesId("string")
.build());
member_roles_resource = discord.MemberRoles("memberRolesResource",
roles=[{
"role_id": "string",
"has_role": False,
}],
server_id="string",
user_id="string",
member_roles_id="string")
const memberRolesResource = new discord.MemberRoles("memberRolesResource", {
roles: [{
roleId: "string",
hasRole: false,
}],
serverId: "string",
userId: "string",
memberRolesId: "string",
});
type: discord:MemberRoles
properties:
memberRolesId: string
roles:
- hasRole: false
roleId: string
serverId: string
userId: string
MemberRoles 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 MemberRoles resource accepts the following input properties:
- Roles
List<Member
Roles Role> - Roles to manage.
- Server
Id string - ID of the server to manage roles in.
- User
Id string - ID of the user to manage roles for.
- Member
Roles stringId - The ID of this resource.
- Roles
[]Member
Roles Role Args - Roles to manage.
- Server
Id string - ID of the server to manage roles in.
- User
Id string - ID of the user to manage roles for.
- Member
Roles stringId - The ID of this resource.
- roles
List<Member
Roles Role> - Roles to manage.
- server
Id String - ID of the server to manage roles in.
- user
Id String - ID of the user to manage roles for.
- member
Roles StringId - The ID of this resource.
- roles
Member
Roles Role[] - Roles to manage.
- server
Id string - ID of the server to manage roles in.
- user
Id string - ID of the user to manage roles for.
- member
Roles stringId - The ID of this resource.
- roles
Sequence[Member
Roles Role Args] - Roles to manage.
- server_
id str - ID of the server to manage roles in.
- user_
id str - ID of the user to manage roles for.
- member_
roles_ strid - The ID of this resource.
- roles List<Property Map>
- Roles to manage.
- server
Id String - ID of the server to manage roles in.
- user
Id String - ID of the user to manage roles for.
- member
Roles StringId - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the MemberRoles 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 MemberRoles Resource
Get an existing MemberRoles 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?: MemberRolesState, opts?: CustomResourceOptions): MemberRoles
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
member_roles_id: Optional[str] = None,
roles: Optional[Sequence[MemberRolesRoleArgs]] = None,
server_id: Optional[str] = None,
user_id: Optional[str] = None) -> MemberRoles
func GetMemberRoles(ctx *Context, name string, id IDInput, state *MemberRolesState, opts ...ResourceOption) (*MemberRoles, error)
public static MemberRoles Get(string name, Input<string> id, MemberRolesState? state, CustomResourceOptions? opts = null)
public static MemberRoles get(String name, Output<String> id, MemberRolesState state, CustomResourceOptions options)
resources: _: type: discord:MemberRoles get: id: ${id}
- 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.
- Member
Roles stringId - The ID of this resource.
- Roles
List<Member
Roles Role> - Roles to manage.
- Server
Id string - ID of the server to manage roles in.
- User
Id string - ID of the user to manage roles for.
- Member
Roles stringId - The ID of this resource.
- Roles
[]Member
Roles Role Args - Roles to manage.
- Server
Id string - ID of the server to manage roles in.
- User
Id string - ID of the user to manage roles for.
- member
Roles StringId - The ID of this resource.
- roles
List<Member
Roles Role> - Roles to manage.
- server
Id String - ID of the server to manage roles in.
- user
Id String - ID of the user to manage roles for.
- member
Roles stringId - The ID of this resource.
- roles
Member
Roles Role[] - Roles to manage.
- server
Id string - ID of the server to manage roles in.
- user
Id string - ID of the user to manage roles for.
- member_
roles_ strid - The ID of this resource.
- roles
Sequence[Member
Roles Role Args] - Roles to manage.
- server_
id str - ID of the server to manage roles in.
- user_
id str - ID of the user to manage roles for.
- member
Roles StringId - The ID of this resource.
- roles List<Property Map>
- Roles to manage.
- server
Id String - ID of the server to manage roles in.
- user
Id String - ID of the user to manage roles for.
Supporting Types
MemberRolesRole, MemberRolesRoleArgs
Import
$ pulumi import discord:index/memberRoles:MemberRoles example "<server id>:<member id>"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- discord lucky3028/terraform-provider-discord
- License
- Notes
- This Pulumi package is based on the
discord
Terraform Provider.