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

Sort AMI and snapshot IDs #13866

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Sort AMI and snapshot IDs #13866

merged 1 commit into from
Apr 25, 2017

Commits on Apr 25, 2017

  1. Sort AMI and snapshot IDs

    As a follow up to #13844, this pull request sorts the AMIs and snapshots returned from the `aws_ami_ids` and `aws_ebs_snapshot_ids` data sources, respectively. Basically the idea is that by sorting the IDs, the `aws_ami_ids` and `aws_ebs_snapshot_ids` data sources can be used similarly to the `aws_ami` and `aws_ebs_snapshot` data sources as if the `most_recent` attribute were set to `true`. For example:
    
    ```hcl
    data "aws_ami_ids" "main"
      # filter { ... }
    }
    
    output "ami_id" {
      value = "${length(data.ami_ids.main.ids) > 0 ? data.ami_ids.main.ids[0] : ""}"
    }
    ```
    joshuaspence committed Apr 25, 2017
    Configuration menu
    Copy the full SHA
    bc8e90f View commit details
    Browse the repository at this point in the history