published on Monday, May 18, 2026 by lucky3028
published on Monday, May 18, 2026 by lucky3028
Manage the widget settings of a Discord server.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as discord from "@pulumi/discord";
const lobby = new discord.VoiceChannel("lobby", {
name: "lobby",
serverId: serverId,
});
const example = new discord.ServerWidget("example", {
serverId: serverId,
enabled: true,
channelId: lobby.id,
});
import pulumi
import pulumi_discord as discord
lobby = discord.VoiceChannel("lobby",
name="lobby",
server_id=server_id)
example = discord.ServerWidget("example",
server_id=server_id,
enabled=True,
channel_id=lobby.id)
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 {
lobby, err := discord.NewVoiceChannel(ctx, "lobby", &discord.VoiceChannelArgs{
Name: pulumi.String("lobby"),
ServerId: pulumi.Any(serverId),
})
if err != nil {
return err
}
_, err = discord.NewServerWidget(ctx, "example", &discord.ServerWidgetArgs{
ServerId: pulumi.Any(serverId),
Enabled: pulumi.Bool(true),
ChannelId: lobby.ID(),
})
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 lobby = new Discord.VoiceChannel("lobby", new()
{
Name = "lobby",
ServerId = serverId,
});
var example = new Discord.ServerWidget("example", new()
{
ServerId = serverId,
Enabled = true,
ChannelId = lobby.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.discord.VoiceChannel;
import com.pulumi.discord.VoiceChannelArgs;
import com.pulumi.discord.ServerWidget;
import com.pulumi.discord.ServerWidgetArgs;
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 lobby = new VoiceChannel("lobby", VoiceChannelArgs.builder()
.name("lobby")
.serverId(serverId)
.build());
var example = new ServerWidget("example", ServerWidgetArgs.builder()
.serverId(serverId)
.enabled(true)
.channelId(lobby.id())
.build());
}
}
resources:
lobby:
type: discord:VoiceChannel
properties:
name: lobby
serverId: ${serverId}
example:
type: discord:ServerWidget
properties:
serverId: ${serverId}
enabled: true
channelId: ${lobby.id}
Example coming soon!
Create ServerWidget Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServerWidget(name: string, args: ServerWidgetArgs, opts?: CustomResourceOptions);@overload
def ServerWidget(resource_name: str,
args: ServerWidgetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServerWidget(resource_name: str,
opts: Optional[ResourceOptions] = None,
enabled: Optional[bool] = None,
server_id: Optional[str] = None,
channel_id: Optional[str] = None,
server_widget_id: Optional[str] = None)func NewServerWidget(ctx *Context, name string, args ServerWidgetArgs, opts ...ResourceOption) (*ServerWidget, error)public ServerWidget(string name, ServerWidgetArgs args, CustomResourceOptions? opts = null)
public ServerWidget(String name, ServerWidgetArgs args)
public ServerWidget(String name, ServerWidgetArgs args, CustomResourceOptions options)
type: discord:ServerWidget
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "discord_serverwidget" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ServerWidgetArgs
- 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 ServerWidgetArgs
- 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 ServerWidgetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerWidgetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServerWidgetArgs
- 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 serverWidgetResource = new Discord.ServerWidget("serverWidgetResource", new()
{
Enabled = false,
ServerId = "string",
ChannelId = "string",
ServerWidgetId = "string",
});
example, err := discord.NewServerWidget(ctx, "serverWidgetResource", &discord.ServerWidgetArgs{
Enabled: pulumi.Bool(false),
ServerId: pulumi.String("string"),
ChannelId: pulumi.String("string"),
ServerWidgetId: pulumi.String("string"),
})
resource "discord_serverwidget" "serverWidgetResource" {
enabled = false
server_id = "string"
channel_id = "string"
server_widget_id = "string"
}
var serverWidgetResource = new ServerWidget("serverWidgetResource", ServerWidgetArgs.builder()
.enabled(false)
.serverId("string")
.channelId("string")
.serverWidgetId("string")
.build());
server_widget_resource = discord.ServerWidget("serverWidgetResource",
enabled=False,
server_id="string",
channel_id="string",
server_widget_id="string")
const serverWidgetResource = new discord.ServerWidget("serverWidgetResource", {
enabled: false,
serverId: "string",
channelId: "string",
serverWidgetId: "string",
});
type: discord:ServerWidget
properties:
channelId: string
enabled: false
serverId: string
serverWidgetId: string
ServerWidget 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 ServerWidget resource accepts the following input properties:
- Enabled bool
- Whether the server widget is enabled.
- Server
Id string - The ID of the server to manage the widget for.
- Channel
Id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- Server
Widget stringId - The ID of this resource.
- Enabled bool
- Whether the server widget is enabled.
- Server
Id string - The ID of the server to manage the widget for.
- Channel
Id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- Server
Widget stringId - The ID of this resource.
- enabled bool
- Whether the server widget is enabled.
- server_
id string - The ID of the server to manage the widget for.
- channel_
id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- server_
widget_ stringid - The ID of this resource.
- enabled Boolean
- Whether the server widget is enabled.
- server
Id String - The ID of the server to manage the widget for.
- channel
Id String - The channel ID that the widget will generate an invite to, or null if set to no invite.
- server
Widget StringId - The ID of this resource.
- enabled boolean
- Whether the server widget is enabled.
- server
Id string - The ID of the server to manage the widget for.
- channel
Id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- server
Widget stringId - The ID of this resource.
- enabled bool
- Whether the server widget is enabled.
- server_
id str - The ID of the server to manage the widget for.
- channel_
id str - The channel ID that the widget will generate an invite to, or null if set to no invite.
- server_
widget_ strid - The ID of this resource.
- enabled Boolean
- Whether the server widget is enabled.
- server
Id String - The ID of the server to manage the widget for.
- channel
Id String - The channel ID that the widget will generate an invite to, or null if set to no invite.
- server
Widget StringId - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServerWidget 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 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 ServerWidget Resource
Get an existing ServerWidget 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?: ServerWidgetState, opts?: CustomResourceOptions): ServerWidget@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
channel_id: Optional[str] = None,
enabled: Optional[bool] = None,
server_id: Optional[str] = None,
server_widget_id: Optional[str] = None) -> ServerWidgetfunc GetServerWidget(ctx *Context, name string, id IDInput, state *ServerWidgetState, opts ...ResourceOption) (*ServerWidget, error)public static ServerWidget Get(string name, Input<string> id, ServerWidgetState? state, CustomResourceOptions? opts = null)public static ServerWidget get(String name, Output<String> id, ServerWidgetState state, CustomResourceOptions options)resources: _: type: discord:ServerWidget get: id: ${id}import {
to = discord_serverwidget.example
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.
- Channel
Id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- Enabled bool
- Whether the server widget is enabled.
- Server
Id string - The ID of the server to manage the widget for.
- Server
Widget stringId - The ID of this resource.
- Channel
Id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- Enabled bool
- Whether the server widget is enabled.
- Server
Id string - The ID of the server to manage the widget for.
- Server
Widget stringId - The ID of this resource.
- channel_
id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- enabled bool
- Whether the server widget is enabled.
- server_
id string - The ID of the server to manage the widget for.
- server_
widget_ stringid - The ID of this resource.
- channel
Id String - The channel ID that the widget will generate an invite to, or null if set to no invite.
- enabled Boolean
- Whether the server widget is enabled.
- server
Id String - The ID of the server to manage the widget for.
- server
Widget StringId - The ID of this resource.
- channel
Id string - The channel ID that the widget will generate an invite to, or null if set to no invite.
- enabled boolean
- Whether the server widget is enabled.
- server
Id string - The ID of the server to manage the widget for.
- server
Widget stringId - The ID of this resource.
- channel_
id str - The channel ID that the widget will generate an invite to, or null if set to no invite.
- enabled bool
- Whether the server widget is enabled.
- server_
id str - The ID of the server to manage the widget for.
- server_
widget_ strid - The ID of this resource.
- channel
Id String - The channel ID that the widget will generate an invite to, or null if set to no invite.
- enabled Boolean
- Whether the server widget is enabled.
- server
Id String - The ID of the server to manage the widget for.
- server
Widget StringId - The ID of this resource.
Import
The pulumi import command can be used, for example:
$ pulumi import discord:index/serverWidget:ServerWidget example "<server 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
discordTerraform Provider.
published on Monday, May 18, 2026 by lucky3028
