DeleteEnvironmentCommand

Deletes an Amazon Web Services Migration Hub Refactor Spaces environment. Before you can delete an environment, you must first delete any applications and services within the environment.

Example Syntax

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

import { MigrationHubRefactorSpacesClient, DeleteEnvironmentCommand } from "@aws-sdk/client-migration-hub-refactor-spaces"; // ES Modules import
// const { MigrationHubRefactorSpacesClient, DeleteEnvironmentCommand } = require("@aws-sdk/client-migration-hub-refactor-spaces"); // CommonJS import
const client = new MigrationHubRefactorSpacesClient(config);
const input = { // DeleteEnvironmentRequest
  EnvironmentIdentifier: "STRING_VALUE", // required
};
const command = new DeleteEnvironmentCommand(input);
const response = await client.send(command);
// { // DeleteEnvironmentResponse
//   Name: "STRING_VALUE",
//   Arn: "STRING_VALUE",
//   EnvironmentId: "STRING_VALUE",
//   State: "STRING_VALUE",
//   LastUpdatedTime: new Date("TIMESTAMP"),
// };

DeleteEnvironmentCommand Input

See DeleteEnvironmentCommandInput for more details

Parameter
Type
Description
EnvironmentIdentifier
Required
string | undefined

The ID of the environment.

DeleteEnvironmentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Arn
string | undefined

The Amazon Resource Name (ARN) of the environment.

EnvironmentId
string | undefined

The unique identifier of the environment.

LastUpdatedTime
Date | undefined

A timestamp that indicates when the environment was last updated.

Name
string | undefined

The name of the environment.

State
EnvironmentState | undefined

The current state of the environment.

Throws

Name
Fault
Details
AccessDeniedException
client

The user does not have sufficient access to perform this action.

ConflictException
client

Updating or deleting a resource can cause an inconsistent state.

InternalServerException
server

An unexpected error occurred while processing the request.

ResourceNotFoundException
client

The request references a resource that does not exist.

ThrottlingException
client

Request was denied because the request was throttled.

ValidationException
client

The input does not satisfy the constraints specified by an Amazon Web Service.

MigrationHubRefactorSpacesServiceException
Base exception class for all service exceptions from MigrationHubRefactorSpaces service.