1. Packages
  2. Github Provider
  3. API Docs
  4. OrganizationBlock
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

github.OrganizationBlock

Explore with Pulumi AI

github logo
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

    This resource allows you to create and manage blocks for GitHub organizations.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = new github.OrganizationBlock("example", {username: "paultyng"});
    
    import pulumi
    import pulumi_github as github
    
    example = github.OrganizationBlock("example", username="paultyng")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.NewOrganizationBlock(ctx, "example", &github.OrganizationBlockArgs{
    			Username: pulumi.String("paultyng"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Github.OrganizationBlock("example", new()
        {
            Username = "paultyng",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.OrganizationBlock;
    import com.pulumi.github.OrganizationBlockArgs;
    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 example = new OrganizationBlock("example", OrganizationBlockArgs.builder()
                .username("paultyng")
                .build());
    
        }
    }
    
    resources:
      example:
        type: github:OrganizationBlock
        properties:
          username: paultyng
    

    Create OrganizationBlock Resource

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

    Constructor syntax

    new OrganizationBlock(name: string, args: OrganizationBlockArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationBlock(resource_name: str,
                          args: OrganizationBlockArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationBlock(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          username: Optional[str] = None)
    func NewOrganizationBlock(ctx *Context, name string, args OrganizationBlockArgs, opts ...ResourceOption) (*OrganizationBlock, error)
    public OrganizationBlock(string name, OrganizationBlockArgs args, CustomResourceOptions? opts = null)
    public OrganizationBlock(String name, OrganizationBlockArgs args)
    public OrganizationBlock(String name, OrganizationBlockArgs args, CustomResourceOptions options)
    
    type: github:OrganizationBlock
    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 OrganizationBlockArgs
    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 OrganizationBlockArgs
    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 OrganizationBlockArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationBlockArgs
    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 organizationBlockResource = new Github.OrganizationBlock("organizationBlockResource", new()
    {
        Username = "string",
    });
    
    example, err := github.NewOrganizationBlock(ctx, "organizationBlockResource", &github.OrganizationBlockArgs{
    	Username: pulumi.String("string"),
    })
    
    var organizationBlockResource = new OrganizationBlock("organizationBlockResource", OrganizationBlockArgs.builder()
        .username("string")
        .build());
    
    organization_block_resource = github.OrganizationBlock("organizationBlockResource", username="string")
    
    const organizationBlockResource = new github.OrganizationBlock("organizationBlockResource", {username: "string"});
    
    type: github:OrganizationBlock
    properties:
        username: string
    

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

    Username string
    The name of the user to block.
    Username string
    The name of the user to block.
    username String
    The name of the user to block.
    username string
    The name of the user to block.
    username str
    The name of the user to block.
    username String
    The name of the user to block.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the OrganizationBlock resource produces the following output properties:

    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    etag string
    id string
    The provider-assigned unique ID for this managed resource.
    etag str
    id str
    The provider-assigned unique ID for this managed resource.
    etag String
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing OrganizationBlock Resource

    Get an existing OrganizationBlock 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?: OrganizationBlockState, opts?: CustomResourceOptions): OrganizationBlock
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            etag: Optional[str] = None,
            username: Optional[str] = None) -> OrganizationBlock
    func GetOrganizationBlock(ctx *Context, name string, id IDInput, state *OrganizationBlockState, opts ...ResourceOption) (*OrganizationBlock, error)
    public static OrganizationBlock Get(string name, Input<string> id, OrganizationBlockState? state, CustomResourceOptions? opts = null)
    public static OrganizationBlock get(String name, Output<String> id, OrganizationBlockState 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.
    The following state arguments are supported:
    Etag string
    Username string
    The name of the user to block.
    Etag string
    Username string
    The name of the user to block.
    etag String
    username String
    The name of the user to block.
    etag string
    username string
    The name of the user to block.
    etag str
    username str
    The name of the user to block.
    etag String
    username String
    The name of the user to block.

    Import

    GitHub organization block can be imported using a username, e.g.

    $ pulumi import github:index/organizationBlock:OrganizationBlock example someuser
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi