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: Some AWS operations do not support assumed roles #19958

Closed
YakDriver opened this issue Jun 24, 2021 · 2 comments · Fixed by #19957
Closed

Error: Some AWS operations do not support assumed roles #19958

YakDriver opened this issue Jun 24, 2021 · 2 comments · Fixed by #19957
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/iam Issues and PRs that pertain to the iam service. service/sts Issues and PRs that pertain to the sts service.
Milestone

Comments

@YakDriver
Copy link
Member

YakDriver commented Jun 24, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS services have operations that require a principal (e.g., an IAM user, role, or group). Sometimes these operations fail if an assumed-role ARN is passed in. Ideally, what you want is to grant/convey/designate the IAM source role so that the STS assumed role will have the benefit of the change, and the operation will succeed.

For example, in the Lake Formation service, you cannot make an assumed role a data lake administrator. If you try to, you receive this error:

InvalidInputException: Unsupported principal identifier:arn:aws:sts::123456789012:assumed-role/role_name/session-identifier. Arns identifying principals with temporary credentials are not supported.

However, if you pass in the source IAM role (arn:aws:iam::123456789012:role/role_name), the operation will succeed. The role will become an administrator and the person using the assumed role will have the benefit of the change as well.

Another example is in Service Catalog. There you may get this type of similar error:

InvalidParametersException: Invalid parameter principalArn, assumed-role is not a recognized IAM identity type

However, in the same vein, if you pass in the source IAM role, the operation will succeed.

A solution is to create a new data source call aws_iam_session_context to find the IAM source role of an STS assumed role. This data source should allow passing through IAM roles and users so that it can be used whether the role is STS or IAM and then everyone can use the same config.

Affected Data Source

  • aws_iam_session_context (new)

Potential Terraform Configuration

data "aws_caller_identity" "current" {}

data "aws_iam_session_context" "example" {
  arn = data.aws_called_identity.current.arn
}

References

@YakDriver YakDriver added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 24, 2021
@YakDriver YakDriver added service/sts Issues and PRs that pertain to the sts service. service/iam Issues and PRs that pertain to the iam service. labels Jun 24, 2021
@YakDriver YakDriver changed the title Error: Some AWS operations do not supported assumed roles Error: Some AWS operations do not support assumed roles Jun 24, 2021
@github-actions github-actions bot added this to the v3.48.0 milestone Jun 28, 2021
@github-actions
Copy link

github-actions bot commented Jul 8, 2021

This functionality has been released in v3.48.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

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 Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/iam Issues and PRs that pertain to the iam service. service/sts Issues and PRs that pertain to the sts service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant