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

backend/s3: Support assume_role_with_web_identity #31244

Closed
Tracked by #33687
james1miller93 opened this issue Jun 14, 2022 · 9 comments · Fixed by #33730
Closed
Tracked by #33687

backend/s3: Support assume_role_with_web_identity #31244

james1miller93 opened this issue Jun 14, 2022 · 9 comments · Fixed by #33730
Labels
backend/s3 enhancement new new issue not yet triaged

Comments

@james1miller93
Copy link

The s3 backend currently does not support assuming a role with web identity.

This is currently supported by the aws provider and it would be good to have feature parity across the aws provider configurations.

Personally, I'd like to use this with github actions to federate access to a state backend from deployment pipelines whilst using a separate federated role for running terraform plan and apply operations.

@james1miller93 james1miller93 added enhancement new new issue not yet triaged labels Jun 14, 2022
@bschaatsbergen
Copy link
Member

bschaatsbergen commented Jun 14, 2022

Picking this one up 👍, first time diving into the backends.

@crw
Copy link
Contributor

crw commented Jun 17, 2022

Thanks for the enhancement request!

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Jun 19, 2022

There seems to be no support yet for AssumeRoleWithWebIdentity in the awsbase go package we're using. As support for AssumeRoleWithWebIdentity through awsbase is only added to the v2 package. It will require a bit of refactoring to make the existing S3 backend code compatible with the v2 version of awsbase.

I'm happy to put in some refactor work and make it inline with how the terraform-provider-aws handles assume_role and assume_role_with_web_identity as separate blocks.

I can't guarantee what the outcome will be of the refactor as awsbase/v2 seems to do things a bit differently..
e.g.

terraform {
  backend "s3" {
    bucket = "mybucket"
    key    = "path/to/my/key"
    region = "us-east-1"
    
    assume_role {
      // ....
    }
    
    assume_role_with_web_identity {
      // ....
    }
  }
}

If you can think of something more straight-forward to avoid the refactor, please share your thoughts with me @jbardin

@bschaatsbergen
Copy link
Member

See (currently draft) PR for additional information.

@haakond
Copy link

haakond commented Feb 21, 2023

Hi, chiming in on the conversation. I believe more and more people in the community are facing the same situation as described by the original poster here. My company is also working on modernizing our pipelines and this capability would be really great to have in place for the Terraform s3 backend.

Has there been any alternative approaches announced since June 2022? Anything I can do to help?

@james1miller93
Copy link
Author

Any further thoughts on this?

@alencar
Copy link

alencar commented Jul 11, 2023

Any news on supporting AssumeRoleWithWebIdentity for S3 backend?

@gdavison
Copy link
Contributor

This will be resolved when #30443 is complete. It is an active project this quarter.

Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend/s3 enhancement new new issue not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants