hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

Support for SAML/AD principals in aws_lakeformation_permissions #16848

Closed chrisbulgaria closed 3 years ago

chrisbulgaria commented 3 years ago

Community Note

Description

The brand new aws_lakeformation_permissions does not seem to support SAML/AD principals (see console, the CLI accepts them without issues)

on lakeformation.tf line 65, in resource "aws_lakeformation_permissions" "xxx": 65: principal = "${local.saml_provider}:group/xxx" Error: "principal" doesn't look like a user or role: "arn:aws:iam::yyyy:saml-provider/zzz:group/xxx"

New or Affected Resource(s)

aws_lakeformation_permissions

chrisbulgaria commented 3 years ago

Probably “validateprincipal” should be replaced by something lighter for this field - given the wider possibilities of what a LF principal can be - not only SAML/AD but as well Quicksight.

colonmelvin commented 3 years ago

How about support for IAM federated users? We're using aws_cloudformation_stack resources since aws_lakeformation_permissions doesn't support "arn:aws:iam::account:federated-user/username" principals.

chrisbulgaria commented 3 years ago

Hi , federated-user ? You mean SAml or AD ? The linked pull request supports all allowed principals , as listed here https://docs.aws.amazon.com/lake-formation/latest/dg/lf-permissions-reference.html It just needs to be merged .... Chris

colonmelvin commented 3 years ago

Hi , federated-user ? You mean SAml or AD ? The linked pull request supports all allowed principals , as listed here https://docs.aws.amazon.com/lake-formation/latest/dg/lf-permissions-reference.html It just needs to be merged .... Chris

In this case, authentication is done via GetFederationToken (FederatedUser), I was able to apply Lake Formation permissions via CLI using the ARN pattern arn:aws:iam::account:federated-user/username. I'm also working with the Lake Formation team to potentially add console support for federated users as to not be forced to use AWS CLI to manage them.

chrisbulgaria commented 3 years ago

ok, yes, I see. Interesting , never used that. I will adapt the pull request to include this.

Chris

colonmelvin commented 3 years ago

Thanks so much!

YakDriver commented 3 years ago
Additional Principals Perm Delete/Revoke
Related #16848 (Issue)
Related #16916
Related #18034 (Issue)
Related #18374
Related #17633 (Issue)
Related #18446 (Issue)
Related #18505
Related #19063 (Issue)
Related #19064 (Issue)
ghost commented 3 years ago

This has been released in version 3.38.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 for triage. Thanks!

github-actions[bot] commented 3 years ago

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.