Method: Aws::AppConfig::Client#get_environment

Defined in:
lib/aws-sdk-appconfig/client.rb

#get_environment(params = {}) ⇒ Types::Environment

Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a Production environment or in an EU_Region environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.

The following waiters are defined for this operation (see #wait_until for detailed usage):

* environment_ready_for_deployment

Examples:

Example: To retrieve environment details


# The following get-environment example returns the details and state of the specified environment.

resp = client.get_environment({
  application_id: "339ohji", 
  environment_id: "54j1r29", 
})

resp.to_h outputs the following:
{
  application_id: "339ohji", 
  id: "54j1r29", 
  name: "Example-Environment", 
  state: "READY_FOR_DEPLOYMENT", 
}

Request syntax with placeholder values


resp = client.get_environment({
  application_id: "Id", # required
  environment_id: "Id", # required
})

Response structure


resp.application_id #=> String
resp.id #=> String
resp.name #=> String
resp.description #=> String
resp.state #=> String, one of "READY_FOR_DEPLOYMENT", "DEPLOYING", "ROLLING_BACK", "ROLLED_BACK", "REVERTED"
resp.monitors #=> Array
resp.monitors[0].alarm_arn #=> String
resp.monitors[0].alarm_role_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :application_id (required, String)

    The ID of the application that includes the environment you want to get.

  • :environment_id (required, String)

    The ID of the environment that you want to get.

Returns:

See Also:



2142
2143
2144
2145
# File 'lib/aws-sdk-appconfig/client.rb', line 2142

def get_environment(params = {}, options = {})
  req = build_request(:get_environment, params)
  req.send_request(options)
end