github.getAppToken
Explore with Pulumi AI
Use this data source to generate a GitHub App JWT.
Example Usage
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var @this = Github.GetAppToken.Invoke(new()
{
AppId = "123456",
InstallationId = "78910",
PemFile = File.ReadAllText("foo/bar.pem"),
});
});
package main
import (
"os"
"github.com/pulumi/pulumi-github/sdk/v5/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.GetAppToken(ctx, &github.GetAppTokenArgs{
AppId: "123456",
InstallationId: "78910",
PemFile: readFileOrPanic("foo/bar.pem"),
}, nil)
if err != nil {
return err
}
return nil
})
}
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(Files.readString(Paths.get("foo/bar.pem")))
.build());
}
}
import pulumi
import pulumi_github as github
this = github.get_app_token(app_id="123456",
installation_id="78910",
pem_file=(lambda path: open(path).read())("foo/bar.pem"))
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as github from "@pulumi/github";
const this = github.getAppToken({
appId: "123456",
installationId: "78910",
pemFile: fs.readFileSync("foo/bar.pem"),
});
variables:
this:
fn::invoke:
Function: github:getAppToken
Arguments:
appId: '123456'
installationId: '78910'
pemFile:
fn::readFile: foo/bar.pem
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:
- App
Id string This is the ID of the GitHub App.
- Installation
Id string This is the ID of the GitHub App installation.
- Pem
File string This is the contents of the GitHub App private key PEM file.
- App
Id string This is the ID of the GitHub App.
- Installation
Id string This is the ID of the GitHub App installation.
- Pem
File string This is the contents of the GitHub App private key PEM file.
- app
Id String This is the ID of the GitHub App.
- installation
Id String This is the ID of the GitHub App installation.
- pem
File String This is the contents of the GitHub App private key PEM file.
- app
Id string This is the ID of the GitHub App.
- installation
Id string This is the ID of the GitHub App installation.
- pem
File 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.
- app
Id String This is the ID of the GitHub App.
- installation
Id String This is the ID of the GitHub App installation.
- pem
File String This is the contents of the GitHub App private key PEM file.
getAppToken Result
The following output properties are available:
- App
Id string - Id string
The provider-assigned unique ID for this managed resource.
- Installation
Id string - Pem
File string - Token string
The generated GitHub APP JWT.
- App
Id string - Id string
The provider-assigned unique ID for this managed resource.
- Installation
Id string - Pem
File string - Token string
The generated GitHub APP JWT.
- app
Id String - id String
The provider-assigned unique ID for this managed resource.
- installation
Id String - pem
File String - token String
The generated GitHub APP JWT.
- app
Id string - id string
The provider-assigned unique ID for this managed resource.
- installation
Id string - pem
File 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.
- app
Id String - id String
The provider-assigned unique ID for this managed resource.
- installation
Id String - pem
File 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.