ExportServerEngineAttributeCommand

Exports a specified server engine attribute as a base64-encoded string. For example, you can export user data that you can use in EC2 to associate nodes with a server.

This operation is synchronous.

A ValidationException is raised when parameters of the request are not valid. A ResourceNotFoundException is thrown when the server does not exist. An InvalidStateException is thrown when the server is in any of the following states: CREATING, TERMINATED, FAILED or DELETING.

Example Syntax

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

import { OpsWorksCMClient, ExportServerEngineAttributeCommand } from "@aws-sdk/client-opsworkscm"; // ES Modules import
// const { OpsWorksCMClient, ExportServerEngineAttributeCommand } = require("@aws-sdk/client-opsworkscm"); // CommonJS import
const client = new OpsWorksCMClient(config);
const input = { // ExportServerEngineAttributeRequest
  ExportAttributeName: "STRING_VALUE", // required
  ServerName: "STRING_VALUE", // required
  InputAttributes: [ // EngineAttributes
    { // EngineAttribute
      Name: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
};
const command = new ExportServerEngineAttributeCommand(input);
const response = await client.send(command);
// { // ExportServerEngineAttributeResponse
//   EngineAttribute: { // EngineAttribute
//     Name: "STRING_VALUE",
//     Value: "STRING_VALUE",
//   },
//   ServerName: "STRING_VALUE",
// };

ExportServerEngineAttributeCommand Input

Parameter
Type
Description
ExportAttributeName
Required
string | undefined

The name of the export attribute. Currently, the supported export attribute is Userdata. This exports a user data script that includes parameters and values provided in the InputAttributes list.

ServerName
Required
string | undefined

The name of the server from which you are exporting the attribute.

InputAttributes
EngineAttribute[] | undefined

The list of engine attributes. The list type is EngineAttribute. An EngineAttribute list item is a pair that includes an attribute name and its value. For the Userdata ExportAttributeName, the following are supported engine attribute names.

  • RunList In Chef, a list of roles or recipes that are run in the specified order. In Puppet, this parameter is ignored.

  • OrganizationName In Chef, an organization name. AWS OpsWorks for Chef Automate always creates the organization default. In Puppet, this parameter is ignored.

  • NodeEnvironment In Chef, a node environment (for example, development, staging, or one-box). In Puppet, this parameter is ignored.

  • NodeClientVersion In Chef, the version of the Chef engine (three numbers separated by dots, such as 13.8.5). If this attribute is empty, OpsWorks for Chef Automate uses the most current version. In Puppet, this parameter is ignored.

ExportServerEngineAttributeCommand Output

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

The requested engine attribute pair with attribute name and value.

ServerName
string | undefined

The server name used in the request.

Throws

Name
Fault
Details
InvalidStateException
client

The resource is in a state that does not allow you to perform a specified action.

ResourceNotFoundException
client

The requested resource does not exist, or access was denied.

ValidationException
client

One or more of the provided request parameters are not valid.

OpsWorksCMServiceException
Base exception class for all service exceptions from OpsWorksCM service.