diff --git a/lib/fog/aws/models/beanstalk/environment.rb b/lib/fog/aws/models/beanstalk/environment.rb index 8304ed251..689db4af8 100644 --- a/lib/fog/aws/models/beanstalk/environment.rb +++ b/lib/fog/aws/models/beanstalk/environment.rb @@ -5,7 +5,8 @@ module Fog class ElasticBeanstalk class Environment < Fog::Model - identity :id, :aliases => 'EnvironmentId' + identity :name, :aliases => 'EnvironmentName' + attribute :id, :aliases => 'EnvironmentId' attribute :application_name, :aliases => 'ApplicationName' attribute :cname, :aliases => 'CNAME' @@ -15,7 +16,6 @@ module Fog attribute :updated_at, :aliases => 'DateUpdated' attribute :description, :aliases => 'Description' attribute :endpoint_url, :aliases => 'EndpointURL' - attribute :name, :aliases => 'EnvironmentName' attribute :health, :aliases => 'Health' attribute :resources, :aliases => 'Resources' attribute :solution_stack_name, :aliases => 'SolutionStackName' diff --git a/lib/fog/aws/models/beanstalk/environments.rb b/lib/fog/aws/models/beanstalk/environments.rb index 0afa9929b..657b8d8be 100644 --- a/lib/fog/aws/models/beanstalk/environments.rb +++ b/lib/fog/aws/models/beanstalk/environments.rb @@ -13,14 +13,10 @@ module Fog load(data) # data is an array of attribute hashes end - # Gets an environment given an id or name. + # Gets an environment given a name. # - def get(environment_id) - if match = environment_id.match(/e\-[a-zA-Z0-9]{10}/) - options = { 'EnvironmentIds' => [environment_id] } - else - options = { 'EnvironmentNames' => [environment_id] } - end + def get(environment_name) + options = { 'EnvironmentNames' => [environment_name] } if data = connection.describe_environments(options).body['DescribeEnvironmentsResult']['Environments'].first new(data)