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

Error creating Backup Vault #6

Closed
GuilhermeRizzottoLis opened this issue Feb 7, 2020 · 14 comments
Closed

Error creating Backup Vault #6

GuilhermeRizzottoLis opened this issue Feb 7, 2020 · 14 comments
Assignees
Labels
question Further information is requested

Comments

@GuilhermeRizzottoLis
Copy link

Hey man, im trying to use your repo, but im always getting an error to create a backup vault, error creating Backup Vault (): AccessDeniedException: status code: 403, request id: 8e7e577e-5b74-4d4d-95d0-bf63e0b2cc2e, do you know why. I only changed the main.tf file from the simple_plan_using_list example with my data. Do you know is that happening?

Thanks.

@lgallard
Copy link
Owner

lgallard commented Feb 7, 2020

Hi @GuilhermeRizzottoLis, the module uses the service role as defined here https://github.com/lgallard/terraform-aws-backup/blob/master/iam.tf#L12 and add a policies in the iam.tf, in particular here https://github.com/lgallard/terraform-aws-backup/blob/master/iam.tf#L24.

With those roles/policies should be enough to create the a new vault. I checked the simple_plan_using_list example last week and it created the vault named "vault-1" as in the example.

Did you check if the service role were created?

@lgallard lgallard added the bug Something isn't working label Feb 7, 2020
@lgallard lgallard self-assigned this Feb 7, 2020
@lgallard lgallard added question Further information is requested and removed bug Something isn't working labels Feb 7, 2020
@GuilhermeRizzottoLis
Copy link
Author

Yeah, it was created, maybe its some configuration in AWS, but i have Full Access permition.

@lgallard
Copy link
Owner

lgallard commented Feb 7, 2020

@GuilhermeRizzottoLis did you check this issue reported here ?

It seems a async problem (maybe due to networking issues or token expiration) as expressed in this comment

@lgallard lgallard closed this as completed Mar 6, 2020
@brightshine1111
Copy link

brightshine1111 commented Apr 7, 2021

I just started encountering this same exact issue. I'm able to create vaults via the aws console and aws cli directly no problem, but when I attempt to do so using the same exact IAM role via Terraform, I get this cryptic 403 error. Looking through Terrform's debug log reveals nothing useful.

Terraform v0.14.9, AWS provider v3.35.0

@lgallard
Copy link
Owner

lgallard commented Apr 8, 2021

@faucherb94 can you share your Terraform definition?

@jralonso
Copy link

I am suffering the same issue. Terraform v0.14.10, AWS provider 3.36.0.
This is what the plan outputs:

# aws_backup_vault.ps-backup-vault will be created
+ resource "aws_backup_vault" "ps-backup-vault" {
    + arn             = (known after apply)
    + id              = (known after apply)
    + kms_key_arn     = (known after apply)
    + name            = "prod-backup-vault"
    + recovery_points = (known after apply)
 }

@lgallard
Copy link
Owner

@jralonso i just applied the complete example in my account using Terraform v0.14.10, AWS provider 3.36.0.

aws-backup-2021-04-13_09-42

aws-backup-2021-04-13_09-49

Are you using the complete example or any other example?

Did you check you have enough permission privileges to create AWS Backup resources (vaults, plans, rules, etc) ?

@lgallard
Copy link
Owner

@jralonso I checked the simple_plan example with the latest version of the module (0.11.2) and it's working with Terraform v0.14.10, AWS provider 3.36.0 as well.

@thiagolsfortunato
Copy link

thiagolsfortunato commented Jun 30, 2021

I have the same error when run with my Pipeline User. This User has backup:* permission attached to your policy.

image

When I perform terraform apply returns AccessDeniedException: status code: 403

image

I have Full Administrator Access and can create AWS Backup Vault with my credentials. Which permissions my pipeline user needs?

@lgallard
Copy link
Owner

@thiagolsfortunato the module creates a service role, meaning your pipeline must be able to create roles in IAM.

@carflo
Copy link

carflo commented Jul 8, 2021

For anyone else who stumbles upon this issue, make sure you are adding the required IAM permissions mentioned in the CreateBackupVault row to the role creating the Vault. I was misssing the required kms and backup-storage permissions and got the same 403 error.

@lgallard
Copy link
Owner

lgallard commented Jul 9, 2021

@carflo maybe we can add those permissions in the IAM policy here https://github.com/lgallard/terraform-aws-backup/blob/master/iam.tf#L40

@carflo
Copy link

carflo commented Jul 9, 2021

@lgallard The IAM permissions need to be added to the Role running the terraform. In @thiagolsfortunato's case, his "pipeline user" (i.e., not the IAM role used by AWS Backup that your module creates).

I think just adding this to the README (e.g., Troubleshooting: error creating Backup Vault () ...) would be helpful as the error message from AWS is not useful. This is mentioned in the AWS docs as a requirement so I'll leave that up to you. As a disclaimer, I'm not using this module but I stumbled upon this issue (google search) due to the same error from the aws_backup_vault resource 😄

@lgallard
Copy link
Owner

@carflo thanks for the clarification. Comment added in README!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants