0

I have EC2 instances tagged with key environment and value production. I am trying to return them using the following:

$result = $ec2_client->describeInstances(array(
    "Filters" => array(
        array(
            "Name" => "tag",
            "Value" => array(
                "environment=production"
            )
        )
    )
));

The above errors out.

How do I specify this method call in the correct manner?

Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248

1 Answers1

1

Correct format is:

$result = $ec2_client->describeInstances(array(
    "Filters" => array(
        array(
            "Name" => "tag:environment",
            "Value" => array(
                "production"
            )
        )
    )
));
Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248