Terraform Core Version
1.7.3
AWS Provider Version
5.39.1
Affected Resource(s)
The affected resource is: module.amplify.aws_amplify_app
Expected Behavior
I'm trying to setup Amplify connecting to my private GitHub repo. Since all infra is provisioned by pipelines, I wanted to avoid using a dev's personal access token, it should be able to provision using a GitHub App token instead.
Actual Behavior
It seems like when I provide a token from GitHub App, it fails with this error:
│ Error: creating Amplify App (MyApp): BadRequestException: There was an issue setting up your repository. Please try again later.({"message":"Not Found","documentation_url":"https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook"})
The GitHub App has write permissions on Webhooks for all repositories in the org (including the one I'm trying to set up). So it's unclear why this is not working, either I'm still missing something or this module doesn't support GitHub App tokens.
Relevant Error/Panic Output Snippet
> │ Error: creating Amplify App (MyApp): BadRequestException: There was an issue setting up your repository. Please try again later.({"message":"Not Found","documentation_url":"https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook"})
Terraform Configuration Files
We can use the example from terraform docs, but providing a GitHub App token:
resource "aws_amplify_app" "example" {
name = "example"
repository = "https://github.com/example/app"
# GitHub personal access token
access_token = "..." # GitHub App token
# The default build_spec added by the Amplify Console for React.
build_spec = <<-EOT
version: 0.1
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
EOT
# The default rewrites and redirects added by the Amplify Console.
custom_rule {
source = "/<*>"
status = "404"
target = "/index.html"
}
environment_variables = {
ENV = "test"
}
}
Steps to Reproduce
- Generate a token using a GitHub App that has write permissions on the repository you are trying to connect to Amplify.
- Provide this token in the terraform setup for the Amplify module.
- Try to apply the changes using this token in the
access_token field from the aws_amplify_app resource.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
Yes
Terraform Core Version
1.7.3
AWS Provider Version
5.39.1
Affected Resource(s)
The affected resource is:
module.amplify.aws_amplify_appExpected Behavior
I'm trying to setup Amplify connecting to my private GitHub repo. Since all infra is provisioned by pipelines, I wanted to avoid using a dev's personal access token, it should be able to provision using a GitHub App token instead.
Actual Behavior
It seems like when I provide a token from GitHub App, it fails with this error:
The GitHub App has write permissions on Webhooks for all repositories in the org (including the one I'm trying to set up). So it's unclear why this is not working, either I'm still missing something or this module doesn't support GitHub App tokens.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
We can use the example from terraform docs, but providing a GitHub App token:
Steps to Reproduce
access_tokenfield from theaws_amplify_appresource.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
Yes