Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tfe_stack "github_app_installation_id" argument does not work #1562

Open
jmalloc opened this issue Jan 10, 2025 · 0 comments
Open

tfe_stack "github_app_installation_id" argument does not work #1562

jmalloc opened this issue Jan 10, 2025 · 0 comments
Labels

Comments

@jmalloc
Copy link

jmalloc commented Jan 10, 2025

Terraform version

Terraform Cloud: ~> 1.10.0

Terraform Configuration Files

resource "tfe_stack" "this" {
  name        = "idp-eks"
  description = "..."
  project_id  = "<redacted>"

  vcs_repo {
    identifier                 = "<redacted>/idp-eks"
    branch                     = "main"
    github_app_installation_id = "ghain-<redacted>"
  }
}

Debug Output

�Terraform v1.10.4
on linux_amd64
Initializing plugins and modules...
{"@level":"info","@message":"Terraform 1.10.4","@module":"terraform.ui","@timestamp":"2025-01-09T23:27:53.099967Z","terraform":"1.10.4","type":"version","ui":"1.2"}
{"@level":"info","@message":"module.stack_eks.tfe_stack.this: Plan to create","@module":"terraform.ui","@timestamp":"2025-01-09T23:27:56.623036Z","change":{"resource":{"addr":"module.stack_eks.tfe_stack.this","module":"module.stack_eks","resource":"tfe_stack.this","implied_provider":"tfe","resource_type":"tfe_stack","resource_name":"this","resource_key":null},"action":"create"},"type":"planned_change"}
{"@level":"info","@message":"module.stack_eks.tfe_stack.this: Creating...","@module":"terraform.ui","@timestamp":"2025-01-09T23:27:57.359877Z","hook":{"resource":{"addr":"module.stack_eks.tfe_stack.this","module":"module.stack_eks","resource":"tfe_stack.this","implied_provider":"tfe","resource_type":"tfe_stack","resource_name":"this","resource_key":null},"action":"create"},"type":"apply_start"}
{"@level":"info","@message":"module.stack_eks.tfe_stack.this: Creation errored after 0s","@module":"terraform.ui","@timestamp":"2025-01-09T23:27:57.407648Z","hook":{"resource":{"addr":"module.stack_eks.tfe_stack.this","module":"module.stack_eks","resource":"tfe_stack.this","implied_provider":"tfe","resource_type":"tfe_stack","resource_name":"this","resource_key":null},"action":"create","elapsed_seconds":0},"type":"apply_errored"}
{"@level":"error","@message":"Error: Unable to create stack","@module":"terraform.ui","@timestamp":"2025-01-09T23:28:00.594849Z","diagnostic":{"severity":"error","summary":"Unable to create stack","detail":"unprocessable entity\n\nVCS connection requires either github app installation or oauth token","address":"module.stack_eks.tfe_stack.this","range":{"filename":"modules/stack/stack.tf","start":{"line":1,"column":29,"byte":28},"end":{"line":1,"column":30,"byte":29}},"snippet":{"context":"resource \"tfe_stack\" \"this\"","code":"resource \"tfe_stack\" \"this\" {","start_line":1,"highlight_start_offset":28,"highlight_end_offset":29,"values":[]}},"type":"diagnostic"}
Operation failed: failed running terraform apply (exit 1)

Expected Behavior

Expected creation of a Stack with VCS configured to use the existing GitHub app integration.

Actual Behavior

Resource creation fails with the error message:

Error: Unable to create stack
unprocessable entity
VCS connection requires either github app installation or oauth token

Additional Context

This GitHub app integration is already configured and works for existing workspaces, as well as stacks created manually through the API.

I have tried using both the GitHub app installation ID (the numeric one), and the "Hashicorp-side" identifier that begins with "ghain-". As an aside, the latter is quite difficult to find, and I was only clued into the fact that it may be the correct identifier to use after manually creating a stack and querying it using the HCP API.

I also tried creating the stack manually then importing it into the configuration, which results in a different message when attempting to update the tfe_stack resource:

Error: Unable to update stack
invalid attribute
Cannot connect to VCS. Update the stack's VCS settings before continuing.

@jmalloc jmalloc added the bug label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant