1. Packages
  2. GitHub
  3. API Docs
  4. AppInstallationRepository
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

github.AppInstallationRepository

Explore with Pulumi AI

github logo
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

    Note: This resource is not compatible with the GitHub App Installation authentication method.

    This resource manages relationships between app installations and repositories in your GitHub organization.

    Creating this resource installs a particular app on a particular repository.

    The app installation and the repository must both belong to the same organization on GitHub. Note: you can review your organization’s installations by the following the instructions at this link.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    // Create a repository.
    const someRepo = new github.Repository("someRepo", {});
    const someAppRepo = new github.AppInstallationRepository("someAppRepo", {
        installationId: "1234567",
        repository: someRepo.name,
    });
    
    import pulumi
    import pulumi_github as github
    
    # Create a repository.
    some_repo = github.Repository("someRepo")
    some_app_repo = github.AppInstallationRepository("someAppRepo",
        installation_id="1234567",
        repository=some_repo.name)
    
    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 {
    		// Create a repository.
    		someRepo, err := github.NewRepository(ctx, "someRepo", nil)
    		if err != nil {
    			return err
    		}
    		_, err = github.NewAppInstallationRepository(ctx, "someAppRepo", &github.AppInstallationRepositoryArgs{
    			InstallationId: pulumi.String("1234567"),
    			Repository:     someRepo.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a repository.
        var someRepo = new Github.Repository("someRepo");
    
        var someAppRepo = new Github.AppInstallationRepository("someAppRepo", new()
        {
            InstallationId = "1234567",
            Repository = someRepo.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.Repository;
    import com.pulumi.github.AppInstallationRepository;
    import com.pulumi.github.AppInstallationRepositoryArgs;
    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 someRepo = new Repository("someRepo");
    
            var someAppRepo = new AppInstallationRepository("someAppRepo", AppInstallationRepositoryArgs.builder()        
                .installationId("1234567")
                .repository(someRepo.name())
                .build());
    
        }
    }
    
    resources:
      # Create a repository.
      someRepo:
        type: github:Repository
      someAppRepo:
        type: github:AppInstallationRepository
        properties:
          # The installation id of the app (in the organization).
          installationId: '1234567'
          repository: ${someRepo.name}
    

    Create AppInstallationRepository Resource

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

    Constructor syntax

    new AppInstallationRepository(name: string, args: AppInstallationRepositoryArgs, opts?: CustomResourceOptions);
    @overload
    def AppInstallationRepository(resource_name: str,
                                  args: AppInstallationRepositoryArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def AppInstallationRepository(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  installation_id: Optional[str] = None,
                                  repository: Optional[str] = None)
    func NewAppInstallationRepository(ctx *Context, name string, args AppInstallationRepositoryArgs, opts ...ResourceOption) (*AppInstallationRepository, error)
    public AppInstallationRepository(string name, AppInstallationRepositoryArgs args, CustomResourceOptions? opts = null)
    public AppInstallationRepository(String name, AppInstallationRepositoryArgs args)
    public AppInstallationRepository(String name, AppInstallationRepositoryArgs args, CustomResourceOptions options)
    
    type: github:AppInstallationRepository
    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 AppInstallationRepositoryArgs
    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 AppInstallationRepositoryArgs
    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 AppInstallationRepositoryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AppInstallationRepositoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AppInstallationRepositoryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var appInstallationRepositoryResource = new Github.AppInstallationRepository("appInstallationRepositoryResource", new()
    {
        InstallationId = "string",
        Repository = "string",
    });
    
    example, err := github.NewAppInstallationRepository(ctx, "appInstallationRepositoryResource", &github.AppInstallationRepositoryArgs{
    	InstallationId: pulumi.String("string"),
    	Repository:     pulumi.String("string"),
    })
    
    var appInstallationRepositoryResource = new AppInstallationRepository("appInstallationRepositoryResource", AppInstallationRepositoryArgs.builder()        
        .installationId("string")
        .repository("string")
        .build());
    
    app_installation_repository_resource = github.AppInstallationRepository("appInstallationRepositoryResource",
        installation_id="string",
        repository="string")
    
    const appInstallationRepositoryResource = new github.AppInstallationRepository("appInstallationRepositoryResource", {
        installationId: "string",
        repository: "string",
    });
    
    type: github:AppInstallationRepository
    properties:
        installationId: string
        repository: string
    

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

    InstallationId string
    The GitHub app installation id.
    Repository string
    The repository to install the app on.
    InstallationId string
    The GitHub app installation id.
    Repository string
    The repository to install the app on.
    installationId String
    The GitHub app installation id.
    repository String
    The repository to install the app on.
    installationId string
    The GitHub app installation id.
    repository string
    The repository to install the app on.
    installation_id str
    The GitHub app installation id.
    repository str
    The repository to install the app on.
    installationId String
    The GitHub app installation id.
    repository String
    The repository to install the app on.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    RepoId int
    Id string
    The provider-assigned unique ID for this managed resource.
    RepoId int
    id String
    The provider-assigned unique ID for this managed resource.
    repoId Integer
    id string
    The provider-assigned unique ID for this managed resource.
    repoId number
    id str
    The provider-assigned unique ID for this managed resource.
    repo_id int
    id String
    The provider-assigned unique ID for this managed resource.
    repoId Number

    Look up Existing AppInstallationRepository Resource

    Get an existing AppInstallationRepository 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?: AppInstallationRepositoryState, opts?: CustomResourceOptions): AppInstallationRepository
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            installation_id: Optional[str] = None,
            repo_id: Optional[int] = None,
            repository: Optional[str] = None) -> AppInstallationRepository
    func GetAppInstallationRepository(ctx *Context, name string, id IDInput, state *AppInstallationRepositoryState, opts ...ResourceOption) (*AppInstallationRepository, error)
    public static AppInstallationRepository Get(string name, Input<string> id, AppInstallationRepositoryState? state, CustomResourceOptions? opts = null)
    public static AppInstallationRepository get(String name, Output<String> id, AppInstallationRepositoryState 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:
    InstallationId string
    The GitHub app installation id.
    RepoId int
    Repository string
    The repository to install the app on.
    InstallationId string
    The GitHub app installation id.
    RepoId int
    Repository string
    The repository to install the app on.
    installationId String
    The GitHub app installation id.
    repoId Integer
    repository String
    The repository to install the app on.
    installationId string
    The GitHub app installation id.
    repoId number
    repository string
    The repository to install the app on.
    installation_id str
    The GitHub app installation id.
    repo_id int
    repository str
    The repository to install the app on.
    installationId String
    The GitHub app installation id.
    repoId Number
    repository String
    The repository to install the app on.

    Import

    GitHub App Installation Repository can be imported using an ID made up of installation_id:repository, e.g.

    $ pulumi import github:index/appInstallationRepository:AppInstallationRepository terraform_repo 1234567:terraform
    

    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.1.0 published on Monday, Mar 11, 2024 by Pulumi