1. Packages
  2. Discord Provider
  3. API Docs
  4. ChannelPermission
discord 2.0.0 published on Friday, Mar 7, 2025 by lucky3028

discord.ChannelPermission

Explore with Pulumi AI

A resource to create a permission override for a channel.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as discord from "@pulumi/discord";

const chatting = new discord.ChannelPermission("chatting", {
    channelId: _var.channel_id,
    type: "role",
    overwriteId: _var.role_id,
    allow: data.discord_permission.chatting.allow_bits,
});
Copy
import pulumi
import pulumi_discord as discord

chatting = discord.ChannelPermission("chatting",
    channel_id=var["channel_id"],
    type="role",
    overwrite_id=var["role_id"],
    allow=data["discord_permission"]["chatting"]["allow_bits"])
Copy
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.NewChannelPermission(ctx, "chatting", &discord.ChannelPermissionArgs{
			ChannelId:   pulumi.Any(_var.Channel_id),
			Type:        pulumi.String("role"),
			OverwriteId: pulumi.Any(_var.Role_id),
			Allow:       pulumi.Any(data.Discord_permission.Chatting.Allow_bits),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Discord = Pulumi.Discord;

return await Deployment.RunAsync(() => 
{
    var chatting = new Discord.ChannelPermission("chatting", new()
    {
        ChannelId = @var.Channel_id,
        Type = "role",
        OverwriteId = @var.Role_id,
        Allow = data.Discord_permission.Chatting.Allow_bits,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.discord.ChannelPermission;
import com.pulumi.discord.ChannelPermissionArgs;
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 chatting = new ChannelPermission("chatting", ChannelPermissionArgs.builder()
            .channelId(var_.channel_id())
            .type("role")
            .overwriteId(var_.role_id())
            .allow(data.discord_permission().chatting().allow_bits())
            .build());

    }
}
Copy
resources:
  chatting:
    type: discord:ChannelPermission
    properties:
      channelId: ${var.channel_id}
      type: role
      overwriteId: ${var.role_id}
      allow: ${data.discord_permission.chatting.allow_bits}
Copy

Create ChannelPermission Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ChannelPermission(name: string, args: ChannelPermissionArgs, opts?: CustomResourceOptions);
@overload
def ChannelPermission(resource_name: str,
                      args: ChannelPermissionArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def ChannelPermission(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      channel_id: Optional[str] = None,
                      overwrite_id: Optional[str] = None,
                      type: Optional[str] = None,
                      allow: Optional[float] = None,
                      deny: Optional[float] = None)
func NewChannelPermission(ctx *Context, name string, args ChannelPermissionArgs, opts ...ResourceOption) (*ChannelPermission, error)
public ChannelPermission(string name, ChannelPermissionArgs args, CustomResourceOptions? opts = null)
public ChannelPermission(String name, ChannelPermissionArgs args)
public ChannelPermission(String name, ChannelPermissionArgs args, CustomResourceOptions options)
type: discord:ChannelPermission
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ChannelPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ChannelPermissionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ChannelPermissionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ChannelPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ChannelPermissionArgs
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 channelPermissionResource = new Discord.ChannelPermission("channelPermissionResource", new()
{
    ChannelId = "string",
    OverwriteId = "string",
    Type = "string",
    Allow = 0,
    Deny = 0,
});
Copy
example, err := discord.NewChannelPermission(ctx, "channelPermissionResource", &discord.ChannelPermissionArgs{
ChannelId: pulumi.String("string"),
OverwriteId: pulumi.String("string"),
Type: pulumi.String("string"),
Allow: pulumi.Float64(0),
Deny: pulumi.Float64(0),
})
Copy
var channelPermissionResource = new ChannelPermission("channelPermissionResource", ChannelPermissionArgs.builder()
    .channelId("string")
    .overwriteId("string")
    .type("string")
    .allow(0)
    .deny(0)
    .build());
Copy
channel_permission_resource = discord.ChannelPermission("channelPermissionResource",
    channel_id="string",
    overwrite_id="string",
    type="string",
    allow=0,
    deny=0)
Copy
const channelPermissionResource = new discord.ChannelPermission("channelPermissionResource", {
    channelId: "string",
    overwriteId: "string",
    type: "string",
    allow: 0,
    deny: 0,
});
Copy
type: discord:ChannelPermission
properties:
    allow: 0
    channelId: string
    deny: 0
    overwriteId: string
    type: string
Copy

ChannelPermission 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 ChannelPermission resource accepts the following input properties:

ChannelId This property is required. string
ID of the channel for this override.
OverwriteId This property is required. string
ID of the user or role for this override.
Type This property is required. string
Type of the override. Must be role or user.
Allow double
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
Deny double
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
ChannelId This property is required. string
ID of the channel for this override.
OverwriteId This property is required. string
ID of the user or role for this override.
Type This property is required. string
Type of the override. Must be role or user.
Allow float64
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
Deny float64
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
channelId This property is required. String
ID of the channel for this override.
overwriteId This property is required. String
ID of the user or role for this override.
type This property is required. String
Type of the override. Must be role or user.
allow Double
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
deny Double
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
channelId This property is required. string
ID of the channel for this override.
overwriteId This property is required. string
ID of the user or role for this override.
type This property is required. string
Type of the override. Must be role or user.
allow number
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
deny number
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
channel_id This property is required. str
ID of the channel for this override.
overwrite_id This property is required. str
ID of the user or role for this override.
type This property is required. str
Type of the override. Must be role or user.
allow float
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
deny float
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
channelId This property is required. String
ID of the channel for this override.
overwriteId This property is required. String
ID of the user or role for this override.
type This property is required. String
Type of the override. Must be role or user.
allow Number
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
deny Number
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.

Outputs

All input properties are implicitly available as output properties. Additionally, the ChannelPermission 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 ChannelPermission Resource

Get an existing ChannelPermission 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?: ChannelPermissionState, opts?: CustomResourceOptions): ChannelPermission
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allow: Optional[float] = None,
        channel_id: Optional[str] = None,
        deny: Optional[float] = None,
        overwrite_id: Optional[str] = None,
        type: Optional[str] = None) -> ChannelPermission
func GetChannelPermission(ctx *Context, name string, id IDInput, state *ChannelPermissionState, opts ...ResourceOption) (*ChannelPermission, error)
public static ChannelPermission Get(string name, Input<string> id, ChannelPermissionState? state, CustomResourceOptions? opts = null)
public static ChannelPermission get(String name, Output<String> id, ChannelPermissionState state, CustomResourceOptions options)
resources:  _:    type: discord:ChannelPermission    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Allow double
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
ChannelId string
ID of the channel for this override.
Deny double
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
OverwriteId string
ID of the user or role for this override.
Type string
Type of the override. Must be role or user.
Allow float64
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
ChannelId string
ID of the channel for this override.
Deny float64
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
OverwriteId string
ID of the user or role for this override.
Type string
Type of the override. Must be role or user.
allow Double
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
channelId String
ID of the channel for this override.
deny Double
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
overwriteId String
ID of the user or role for this override.
type String
Type of the override. Must be role or user.
allow number
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
channelId string
ID of the channel for this override.
deny number
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
overwriteId string
ID of the user or role for this override.
type string
Type of the override. Must be role or user.
allow float
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
channel_id str
ID of the channel for this override.
deny float
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
overwrite_id str
ID of the user or role for this override.
type str
Type of the override. Must be role or user.
allow Number
Permission bits for the allowed permissions on this override. At least one of allow or deny must be set.
channelId String
ID of the channel for this override.
deny Number
Permission bits for the denied permissions on this override. At least one of allow or deny must be set.
overwriteId String
ID of the user or role for this override.
type String
Type of the override. Must be role or user.

Package Details

Repository
discord lucky3028/terraform-provider-discord
License
Notes
This Pulumi package is based on the discord Terraform Provider.