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

[Bug]: Wrong ARN for AWS Amplify Webhooks #39407

Open
AriannaLanz opened this issue Sep 19, 2024 · 1 comment
Open

[Bug]: Wrong ARN for AWS Amplify Webhooks #39407

AriannaLanz opened this issue Sep 19, 2024 · 1 comment
Labels
bug Addresses a defect in current functionality. service/amplify Issues and PRs that pertain to the amplify service.

Comments

@AriannaLanz
Copy link

Terraform Core Version

1.9.0

AWS Provider Version

5.67.0

Affected Resource(s)

aws_amplify_webhook

Expected Behavior

The output of aws_amplify_webhook.example_webhook.arn should be arn:aws:amplify:<region>:<account-id>:webhooks/<webhook-id>.

Actual Behavior

The actual output of aws_amplify_webhook.example_webhook.arn is arn:aws:amplify:<region>:<account-id>:apps/<app-id>/webhooks/<webhook-id>

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "> 5.0"
}
}
required_version = "
> 1.9.0"
}

Steps to Reproduce

resource "aws_amplify_app" "example" {
  name = "app"
}

resource "aws_amplify_branch" "master" {
  app_id      = aws_amplify_app.example.id
  branch_name = "master"
}

resource "aws_amplify_webhook" "master" {
  app_id      = aws_amplify_app.example.id
  branch_name = aws_amplify_branch.master.branch_name
  description = "triggermaster"
}
  1. terraform apply
  2. terraform state show aws_amplify_webhook.master

Debug Output

No response

Panic Output

No response

Important Factoids

I need to add an amplify:GetWebhook IAM permission for this specific webhook, but I was getting the error:

Error: reading Amplify Webhook (<webhook-id>): operation error Amplify: GetWebhook, https response error StatusCode: 403, RequestID: <request-id id>, api error AccessDeniedException: User: arn:aws:sts::<account-id>:assumed-role/<role> is not authorized to perform: amplify:GetWebhook on resource: arn:aws:amplify:<region>:<account-id>:webhooks/<webhook-id>

and I noticed the discrepancy in that Terraform outputs the ARN as arn:aws:amplify:<region>:<account-id>:apps/<app-id>/webhooks/<webhook-id> when AWS expects arn:aws:amplify:<region>:<account-id>:webhooks/<webhook-id> (without the apps/<app-id> part).

When I fixed this manually in the IAM console, I no longer saw the 403 error.

References

No response

Would you like to implement a fix?

None

@AriannaLanz AriannaLanz added the bug Addresses a defect in current functionality. label Sep 19, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/amplify Issues and PRs that pertain to the amplify service. needs-triage Waiting for first response or review from a maintainer. labels Sep 19, 2024
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/amplify Issues and PRs that pertain to the amplify service.
Projects
None yet
Development

No branches or pull requests

2 participants