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

github.getAppToken

Explore with Pulumi AI

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

    Use this data source to generate a GitHub App JWT.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    import * as std from "@pulumi/std";
    
    const this = std.file({
        input: "foo/bar.pem",
    }).then(invoke => github.getAppToken({
        appId: "123456",
        installationId: "78910",
        pemFile: invoke.result,
    }));
    
    import pulumi
    import pulumi_github as github
    import pulumi_std as std
    
    this = github.get_app_token(app_id="123456",
        installation_id="78910",
        pem_file=std.file(input="foo/bar.pem").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.GetAppToken(ctx, &github.GetAppTokenArgs{
    			AppId:          "123456",
    			InstallationId: "78910",
    			PemFile: std.File(ctx, &std.FileArgs{
    				Input: "foo/bar.pem",
    			}, nil).Result,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Github.GetAppToken.Invoke(new()
        {
            AppId = "123456",
            InstallationId = "78910",
            PemFile = Std.File.Invoke(new()
            {
                Input = "foo/bar.pem",
            }).Result,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.GithubFunctions;
    import com.pulumi.github.inputs.GetAppTokenArgs;
    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) {
            final var this = GithubFunctions.getAppToken(GetAppTokenArgs.builder()
                .appId("123456")
                .installationId("78910")
                .pemFile(StdFunctions.file(FileArgs.builder()
                    .input("foo/bar.pem")
                    .build()).result())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          Function: github:getAppToken
          Arguments:
            appId: '123456'
            installationId: '78910'
            pemFile:
              fn::invoke:
                Function: std:file
                Arguments:
                  input: foo/bar.pem
                Return: result
    

    Using getAppToken

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAppToken(args: GetAppTokenArgs, opts?: InvokeOptions): Promise<GetAppTokenResult>
    function getAppTokenOutput(args: GetAppTokenOutputArgs, opts?: InvokeOptions): Output<GetAppTokenResult>
    def get_app_token(app_id: Optional[str] = None,
                      installation_id: Optional[str] = None,
                      pem_file: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetAppTokenResult
    def get_app_token_output(app_id: Optional[pulumi.Input[str]] = None,
                      installation_id: Optional[pulumi.Input[str]] = None,
                      pem_file: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetAppTokenResult]
    func GetAppToken(ctx *Context, args *GetAppTokenArgs, opts ...InvokeOption) (*GetAppTokenResult, error)
    func GetAppTokenOutput(ctx *Context, args *GetAppTokenOutputArgs, opts ...InvokeOption) GetAppTokenResultOutput

    > Note: This function is named GetAppToken in the Go SDK.

    public static class GetAppToken 
    {
        public static Task<GetAppTokenResult> InvokeAsync(GetAppTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetAppTokenResult> Invoke(GetAppTokenInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAppTokenResult> getAppToken(GetAppTokenArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: github:index/getAppToken:getAppToken
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AppId string
    This is the ID of the GitHub App.
    InstallationId string
    This is the ID of the GitHub App installation.
    PemFile string
    This is the contents of the GitHub App private key PEM file.
    AppId string
    This is the ID of the GitHub App.
    InstallationId string
    This is the ID of the GitHub App installation.
    PemFile string
    This is the contents of the GitHub App private key PEM file.
    appId String
    This is the ID of the GitHub App.
    installationId String
    This is the ID of the GitHub App installation.
    pemFile String
    This is the contents of the GitHub App private key PEM file.
    appId string
    This is the ID of the GitHub App.
    installationId string
    This is the ID of the GitHub App installation.
    pemFile string
    This is the contents of the GitHub App private key PEM file.
    app_id str
    This is the ID of the GitHub App.
    installation_id str
    This is the ID of the GitHub App installation.
    pem_file str
    This is the contents of the GitHub App private key PEM file.
    appId String
    This is the ID of the GitHub App.
    installationId String
    This is the ID of the GitHub App installation.
    pemFile String
    This is the contents of the GitHub App private key PEM file.

    getAppToken Result

    The following output properties are available:

    AppId string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstallationId string
    PemFile string
    Token string
    The generated GitHub APP JWT.
    AppId string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstallationId string
    PemFile string
    Token string
    The generated GitHub APP JWT.
    appId String
    id String
    The provider-assigned unique ID for this managed resource.
    installationId String
    pemFile String
    token String
    The generated GitHub APP JWT.
    appId string
    id string
    The provider-assigned unique ID for this managed resource.
    installationId string
    pemFile string
    token string
    The generated GitHub APP JWT.
    app_id str
    id str
    The provider-assigned unique ID for this managed resource.
    installation_id str
    pem_file str
    token str
    The generated GitHub APP JWT.
    appId String
    id String
    The provider-assigned unique ID for this managed resource.
    installationId String
    pemFile String
    token String
    The generated GitHub APP JWT.

    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