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

support filters on aws_efs_file_system data source #2563

Closed
mengesb opened this issue Dec 6, 2017 · 2 comments
Closed

support filters on aws_efs_file_system data source #2563

mengesb opened this issue Dec 6, 2017 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@mengesb
Copy link
Contributor

mengesb commented Dec 6, 2017

I'd appreciate the ability to support search filters like other resources have. Ideally I'd like to remove all "ids" from my TF plans and allow data source contexts to be searchable by things such as tags, etc., like the aws_ami data source.

Terraform Version

v0.11.1

Affected Resource(s)

  • aws_efs_file_system

Terraform Configuration Files

data "aws_efs_file_system" "searched" {
  provider = "aws.myalias"
  filter {
    name = "name"
    values = ["ASpecificEFSName"]
  }

  filter {
    name = "tags:terraform"
    values = ["true"]
  }
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Returns a matched EFS file system ID and details about it

Actual Behavior

Nothing - this is a feature request

Steps to Reproduce

  1. terraform apply

Important Factoids

N/A

References

  • N/A
@apparentlymart apparentlymart added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 19, 2017
@apparentlymart
Copy link
Contributor

apparentlymart commented Dec 19, 2017

Hi @mengesb! Thanks for this feature request.

The filter blocks you see on many of the aws provider data sources map onto a feature that is implemented consistently across all of the EC2 API endpoints (which includes VPC, EBS, etc as well), but does not tend to exist on other service APIs.

We are definitely open to implementing an interface to any sort of query functionality provided by the underlying APIs, but the degree to which this is supported varies a lot between services. In the case of EFS, it looks like DescribeFileSystems supports server-side filtering only by id.

We can potentially do client-side filtering of the DescribeFileSystems result to achieve more advanced filters than the server supports, but the tag information is not included in this response so it is unfortunately impossible to implement filtering by tag in a reasonable way (we'd need to do serial calls to DescribeTags for all filesystems in your account).

Since technical limitations prevent this from being solved for now, I'm going to close it. I'd suggest taking this feature request to AWS since indeed we'd be happy to add support for this were the underlying API extended to support tag-based querying. This would, however, use specific attributes rather than generic filter because that is (as noted earlier) an EC2-specific construct:

# (not currently implemented)

data "aws_efs_file_system" "searched" {
  provider = "aws.myalias"

  name = "ASpecificEFSName"
  tags = {
    terraform = "true"
  }
}

@ghost
Copy link

ghost commented Apr 10, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
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.
Projects
None yet
Development

No branches or pull requests

2 participants