Skip to content

Commit 8621445

Browse files
author
Jeremy Udit
committed
add app_authentication example
1 parent 77526e8 commit 8621445

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

examples/app_authentication/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# App Installation Example
2+
3+
This example demonstrates authenticating using a GitHub App.
4+
5+
The example will create a repository in the specified organization.
6+
7+
You may use variables passed via command line:
8+
9+
```console
10+
export GITHUB_OWNER=
11+
export GITHUB_APP_ID=
12+
export GITHUB_APP_INSTALLATION_ID=
13+
export GITHUB_APP_PEM_FILE=
14+
```
15+
16+
```console
17+
terraform apply -var "organization=${GITHUB_ORG}"
18+
```

examples/app_authentication/main.tf

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resource "github_repository" "github_repository" {
2+
name = "github_app_example"
3+
description = "A repository created using GitHub App authentication"
4+
}

examples/app_authentication/outputs.tf

Whitespace-only changes.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
provider "github" {
2+
owner = var.owner
3+
app_auth {
4+
// Empty block to allow the provider configurations to be specified through
5+
// environment variables.
6+
// See: https://github.com/hashicorp/terraform-plugin-sdk/issues/142
7+
}
8+
}
9+
10+
terraform {
11+
required_providers {
12+
github = {
13+
source = "integrations/github"
14+
}
15+
}
16+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
variable "owner" {
2+
description = "GitHub owner used to configure the provider"
3+
type = string
4+
}

0 commit comments

Comments
 (0)