Encountering BadRequestException: There was an issue setting up your repository. Please try again later.({"message":"403 Forbidden"}) on provisioning aws_amplify_app using Terraform(Gitlab)

0

Encountering BadRequestException: There was an issue setting up your repository. Please try again later.({"message":"403 Forbidden"}) on provisioning aws_amplify_app using Terraform. Although my GitlabPAT has relevant access(api, read_api, read_user, read_repository, write_repository) but still getting it, Although using AWS console it shows repo in my account but my usecase require to do it via terraform

asked 2 months ago54 views
1 Answer
0

The 403 Forbidden error you're encountering while trying to provision an AWS Amplify app using Terraform with GitLab integration suggests there's an issue with authentication or permissions. Even though your GitLab Personal Access Token (PAT) has the relevant access scopes, there might be other factors causing this problem. Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Check token expiration: Ensure your GitLab PAT hasn't expired. If it has, generate a new one with the required scopes.

  2. Verify Amplify permissions: Make sure the IAM role or user associated with your Terraform execution has the necessary permissions to create and manage Amplify resources.

  3. Double-check GitLab permissions: Confirm that the GitLab account associated with the PAT has the correct access level to the repository you're trying to connect.

  4. Refresh or regenerate tokens: Try refreshing your GitLab PAT or generating a new one with the same permissions.

  5. Clear cached credentials: If you're using any form of credential caching, try clearing it and reauthenticating.

  6. Check Amplify service status: Verify that there are no ongoing issues with the AWS Amplify service in your region.

  7. Review Terraform configuration: Ensure your Terraform configuration for the aws_amplify_app resource is correct, including any required parameters for GitLab integration.

  8. Examine Amplify console logs: If possible, check the Amplify console logs for more detailed error messages that might provide additional context.

  9. Consider using AWS CLI: As a workaround, you could try creating the Amplify app using the AWS CLI first, and then import it into your Terraform state.

If the issue persists after trying these steps, you may need to contact AWS support for further assistance, as there could be an underlying problem with the integration between AWS Amplify and GitLab that requires their intervention.

Sources
Missing token in connection: Amplify - GitHub | AWS re:Post
error "access denied" when creating s3 with terraform | AWS re:Post

profile picture
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions