Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class GetEnvironmentCommandProtected

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.

Example

Use a bare-bones client and the command you need to make an API call.

import { AppConfigClient, GetEnvironmentCommand } from "@aws-sdk/client-appconfig"; // ES Modules import
// const { AppConfigClient, GetEnvironmentCommand } = require("@aws-sdk/client-appconfig"); // CommonJS import
const client = new AppConfigClient(config);
const input = { // GetEnvironmentRequest
ApplicationId: "STRING_VALUE", // required
EnvironmentId: "STRING_VALUE", // required
};
const command = new GetEnvironmentCommand(input);
const response = await client.send(command);
// { // Environment
// ApplicationId: "STRING_VALUE",
// Id: "STRING_VALUE",
// Name: "STRING_VALUE",
// Description: "STRING_VALUE",
// State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
// Monitors: [ // MonitorList
// { // Monitor
// AlarmArn: "STRING_VALUE", // required
// AlarmRoleArn: "STRING_VALUE",
// },
// ],
// };

Param

GetEnvironmentCommandInput

Returns

GetEnvironmentCommandOutput

See

Throws

BadRequestException (client fault)

The input fails to satisfy the constraints specified by an Amazon Web Services service.

Throws

InternalServerException (server fault)

There was an internal failure in the AppConfig service.

Throws

ResourceNotFoundException (client fault)

The requested resource could not be found.

Throws

AppConfigServiceException

Base exception class for all service exceptions from AppConfig service.

Example

To retrieve environment details

// The following get-environment example returns the details and state of the specified environment.
const input = {
"ApplicationId": "339ohji",
"EnvironmentId": "54j1r29"
};
const command = new GetEnvironmentCommand(input);
const response = await client.send(command);
/* response ==
{
"ApplicationId": "339ohji",
"Id": "54j1r29",
"Name": "Example-Environment",
"State": "READY_FOR_DEPLOYMENT"
}
*/
// example id: to-retrieve-environment-details-1632266924806

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<GetEnvironmentCommandInput, GetEnvironmentCommandOutput>

Methods