GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi
github.getAppToken
Explore with Pulumi AI
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:
- 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.