Skip to content

Instantly share code, notes, and snippets.

@TheQueenIsDead
Created December 11, 2022 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheQueenIsDead/ea838b56322f4aa998cd1b84f1129cbe to your computer and use it in GitHub Desktop.
Save TheQueenIsDead/ea838b56322f4aa998cd1b84f1129cbe to your computer and use it in GitHub Desktop.
Example terraform output
# Terraform resource
resource "github_branch_protection_v3" "bp" {
repository = "terraform-template-module"
branch = "master"
required_status_checks {
strict = true
contexts = [
"context1",
"context2",
]
check {
context = "context_with_app_id_defined"
app_id = 12345
}
check {
context = "context_no_app_id_most_recent_check"
}
check {
context = "context_app_id_allow_all"
app_id = -1
}
}
}
terraform {
required_providers {
github = {
source = "integrations/github"
}
}
}
# Initial Apply
Terraform will perform the following actions:
# github_branch_protection_v3.bp will be created
+ resource "github_branch_protection_v3" "bp" {
+ branch = "master"
+ enforce_admins = false
+ etag = (known after apply)
+ id = (known after apply)
+ repository = "terraform-template-module"
+ require_conversation_resolution = false
+ require_signed_commits = false
+ required_status_checks {
+ contexts = [
+ "context1",
+ "context2",
]
+ strict = true
+ check {
+ app_id = 12345
+ context = "context_with_app_id_defined"
}
+ check {
+ app_id = -1
+ context = "context_no_app_id_most_recent_check"
}
+ check {
+ app_id = -1
+ context = "context_app_id_allow_all"
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
# Subsequent apply (No changes)
Terraform will perform the following actions:
# github_branch_protection_v3.bp will be updated in-place
~ resource "github_branch_protection_v3" "bp" {
id = "terraform-template-module:master"
# (6 unchanged attributes hidden)
~ required_status_checks {
# (3 unchanged attributes hidden)
~ check {
~ app_id = -1 -> 12345
~ context = "context1" -> "context_with_app_id_defined"
}
~ check {
~ context = "context2" -> "context_no_app_id_most_recent_check"
# (1 unchanged attribute hidden)
}
~ check {
~ context = "context_with_app_id_defined" -> "context_app_id_allow_all"
# (1 unchanged attribute hidden)
}
- check {
- app_id = -1 -> null
- context = "context_no_app_id_most_recent_check" -> null
}
- check {
- app_id = -1 -> null
- context = "context_app_id_allow_all" -> null
}
- check {
- app_id = 0 -> null
- context = "context1" -> null
}
- check {
- app_id = 0 -> null
- context = "context2" -> null
}
- check {
- app_id = 0 -> null
- context = "context_with_app_id_defined" -> null
}
- check {
- app_id = 0 -> null
- context = "context_no_app_id_most_recent_check" -> null
}
- check {
- app_id = 0 -> null
- context = "context_app_id_allow_all" -> null
}
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
# Subsequent apply #2 (No changes)
│ Warning: Provider development overrides are in effect
...
github_branch_protection_v3.bp: Refreshing state... [id=terraform-template-module:master]
No changes. Your infrastructure matches the configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment