Open marciogmorales opened 2 years ago
The Potential Terraform Configuration should be without directory_id, because you don't need the filters if you already have the id.
data "aws_directory_service_directory" "managed_ad" {
filter {
name = "tag:Name"
values = ["MyManagedAD01"]
}
}
But describe-directories has no filter parameter, and does not return tags, so terraform can't really provide the desired functionality.
Current workaround seems a bit convoluted, as the datasource only takes the id, not the arn;
data "aws_resourcegroupstaggingapi_resources" "example" {
resource_type_filters = ["fsx:file-system"]
tag_filter {
key = "Name"
values = ["fsx-example"]
}
}
data "aws_fsx_windows_file_system" "example" {
id = split("/", data.aws_resourcegroupstaggingapi_resources.example.resource_tag_mapping_list[0].resource_arn)[1]
}
output "fsx" {
value = data.aws_fsx_windows_file_system.example
}
@justinretzolk Do you have any update on this?
Hey @marciogmorales 👋 Thanks for checking in on this one! I can't speak to when this will be prioritized just yet, so don't have much of an update, unfortunately. We base our prioritization on the count of :+1: reactions and a few other considerations (more information: prioritization guide).
Community Note
Description
When working with multiple AWS Directory Services, using Dependency Inversion becomes challenging because Filter doesn't allow to search by tag as argument references. It requires the use of a Module composition approach.
New or Affected Resource(s)
Potential Terraform Configuration
References
0000