GetBackendEnvironmentCommand

Returns a backend environment for an Amplify app.

This API is available only to Amplify Gen 1 applications where the backend is created using Amplify Studio or the Amplify command line interface (CLI). This API isn’t available to Amplify Gen 2 applications. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

Example Syntax

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

import { AmplifyClient, GetBackendEnvironmentCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, GetBackendEnvironmentCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // GetBackendEnvironmentRequest
  appId: "STRING_VALUE", // required
  environmentName: "STRING_VALUE", // required
};
const command = new GetBackendEnvironmentCommand(input);
const response = await client.send(command);
// { // GetBackendEnvironmentResult
//   backendEnvironment: { // BackendEnvironment
//     backendEnvironmentArn: "STRING_VALUE", // required
//     environmentName: "STRING_VALUE", // required
//     stackName: "STRING_VALUE",
//     deploymentArtifacts: "STRING_VALUE",
//     createTime: new Date("TIMESTAMP"), // required
//     updateTime: new Date("TIMESTAMP"), // required
//   },
// };

GetBackendEnvironmentCommand Input

Parameter
Type
Description
appId
Required
string | undefined

The unique id for an Amplify app.

environmentName
Required
string | undefined

The name for the backend environment.

GetBackendEnvironmentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
backendEnvironment
Required
BackendEnvironment | undefined

Describes the backend environment for an Amplify app.

Throws

Name
Fault
Details
BadRequestException
client

A request contains unexpected data.

InternalFailureException
server

The service failed to perform an operation due to an internal issue.

NotFoundException
client

An entity was not found during an operation.

UnauthorizedException
client

An operation failed due to a lack of access.

AmplifyServiceException
Base exception class for all service exceptions from Amplify service.