-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Improve filters for data source aws_autoscaling_group #3534
Comments
this might take a while, as the raw API does not support filters, so AWS will need to update their API endpoint first, before the SDK's can be updated. A good source for this is the raw API doc's for AWS's API |
@MadMax88 it is using the describe tags function, looks like it needs some debugging. if I get time will take a look. |
This issue is pretty old but the data source supports filters now... however, it only seems to support one tag filter at a time, or maybe it is ORing them together. If you try to do something like filter on Role=myapp, Environment=qa you get everything from Environment=qa and everything from Role=myapp. This is not how filters normally work in AWS, I think: if you use the console to filter, it ANDs the filters together |
Tags are now natively supported by the API: |
This functionality has been released in v3.68.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! |
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. |
When using aws_autoscaling_group as a data source, I expect to be able to filter autoscaling groups similar to how I can filter other resource (i.e. aws_ami).
Terraform Version
Any
Affected Resource(s)
aws_autoscaling_groups
Terraform Configuration Files
Expected Behavior
Finds AutoScaling groups that have a tag with a key
some-arbitrary-value
and eithersome-arbitrary-value
orsome-other-arbitrary-value
as values.Actual Behavior
This behavior isn't supported.
Preliminary Findings
I spent a little time seeing if I could implement this behavior myself. I can see why this isn't currently supported :). The data provider (
terraform-provider-aws/aws/data_source_aws_autoscaling_groups.go
) basically just encapsulates the behavior of the AWS SDK'sDescribeTags()
functionality, which means this data source isn't doing what we (users) would intuitively expect. I see two possible routes to fix this:Option 1 is probably the way to solve the issue fastest, but the real problem is that the SDK doesn't easily support the desired behavior, so option 2 is probably the correct solution. Perhaps we implement a temporary workaround, while looking at how we can improve the SDK to better suit this behavior?
Anyway, I'd be willing to help on this issue of the team provides some feedback on the proper approach.
The text was updated successfully, but these errors were encountered: