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

[Enhancement]: aws_emr_studio add encryption_key_arn config #40743

Closed
jspaine opened this issue Jan 2, 2025 · 4 comments · Fixed by #40771
Closed

[Enhancement]: aws_emr_studio add encryption_key_arn config #40743

jspaine opened this issue Jan 2, 2025 · 4 comments · Fixed by #40771
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/emr Issues and PRs that pertain to the emr service.
Milestone

Comments

@jspaine
Copy link

jspaine commented Jan 2, 2025

Description

Creating an EMR Studio using a KMS encrypted S3 location fails with the error:

Error: creating EMR Studio (xxx-studio): operation error EMR: CreateStudio, https response error StatusCode: 400, RequestID: xxx, InvalidRequestException: 'ServiceRole' does not have permission to access the 'S3 Location' or associated KMS key(s). Review the policies for the service role and the resource policies for the S3 location and KMS key(s) to ensure that permission is granted. (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: xxx; Proxy: null)

because it's not possible to pass the KMS key arn of the bucket to the resource. Using the aws-cli shows the same error until the --encryption-key-arn parameter is set, then the request succeeds.

Affected Resource(s) and/or Data Source(s)

aws_emr_studio

Potential Terraform Configuration

resource "aws_emr_studio" "studio" {
  ...
  encryption_key_arn = aws_kms_key.example.arn
}

References

aws docs: https://docs.aws.amazon.com/emr/latest/APIReference/API_CreateStudio.html

aws-sdk-go seems to support the parameter: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/emr#CreateStudioInput

Would you like to implement a fix?

None

@jspaine jspaine added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 2, 2025
@github-actions github-actions bot added the service/emr Issues and PRs that pertain to the emr service. label Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

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 the needs-triage Waiting for first response or review from a maintainer. label Jan 2, 2025
@acwwat
Copy link
Contributor

acwwat commented Jan 4, 2025

There seems to be a couple issues at play:

  1. There is a regression with an eventual consistency issue where an InvalidRequestException about missing S3 or KMS permissions is reported. While the resource code handles this case, because the error message changed the handling was skipped.
  2. The encryption_key_arn argument is missing, however it is mainly for per-object encryption of workspace artifacts by EMR. I believe that if an S3 bucket has server-side encryption enabled, it should suffice to just provide permission to the KMS key in the EMR role without setting encryption_key_arn. I could be wrong though, so please double check on this.

Consequently I will fix the first issue and add encryption_key_arn as an enhancement.

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jan 6, 2025
Copy link

github-actions bot commented Jan 6, 2025

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.83.0 milestone Jan 6, 2025
Copy link

github-actions bot commented Jan 9, 2025

This functionality has been released in v5.83.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/emr Issues and PRs that pertain to the emr service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants