@aws-sdk/client-imagebuilder
TypeScript icon, indicating that this package has built-in type declarations

3.564.0 • Public • Published

@aws-sdk/client-imagebuilder

Description

AWS SDK for JavaScript Imagebuilder Client for Node.js, Browser and React Native.

EC2 Image Builder is a fully managed Amazon Web Services service that makes it easier to automate the creation, management, and deployment of customized, secure, and up-to-date "golden" server images that are pre-installed and pre-configured with software and settings to meet specific IT standards.

Installing

To install the this package, simply type add or install @aws-sdk/client-imagebuilder using your favorite package manager:

  • npm install @aws-sdk/client-imagebuilder
  • yarn add @aws-sdk/client-imagebuilder
  • pnpm add @aws-sdk/client-imagebuilder

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the ImagebuilderClient and the commands you need, for example ListImagesCommand:

// ES5 example
const { ImagebuilderClient, ListImagesCommand } = require("@aws-sdk/client-imagebuilder");
// ES6+ example
import { ImagebuilderClient, ListImagesCommand } from "@aws-sdk/client-imagebuilder";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region).
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
// a client can be shared by different commands.
const client = new ImagebuilderClient({ region: "REGION" });

const params = {
  /** input parameters */
};
const command = new ListImagesCommand(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Promises

You can also use Promise chaining to execute send operation.

client.send(command).then(
  (data) => {
    // process data.
  },
  (error) => {
    // error handling.
  }
);

Promises can also be called using .catch() and .finally() as follows:

client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Callbacks

We do not recommend using callbacks because of callback hell, but they are supported by the send operation.

// callbacks.
client.send(command, (err, data) => {
  // process err and data.
});

v2 compatible style

The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript

import * as AWS from "@aws-sdk/client-imagebuilder";
const client = new AWS.Imagebuilder({ region: "REGION" });

// async/await.
try {
  const data = await client.listImages(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listImages(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks.
client.listImages(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-imagebuilder package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

CancelImageCreation

Command API Reference / Input / Output

CancelLifecycleExecution

Command API Reference / Input / Output

CreateComponent

Command API Reference / Input / Output

CreateContainerRecipe

Command API Reference / Input / Output

CreateDistributionConfiguration

Command API Reference / Input / Output

CreateImage

Command API Reference / Input / Output

CreateImagePipeline

Command API Reference / Input / Output

CreateImageRecipe

Command API Reference / Input / Output

CreateInfrastructureConfiguration

Command API Reference / Input / Output

CreateLifecyclePolicy

Command API Reference / Input / Output

CreateWorkflow

Command API Reference / Input / Output

DeleteComponent

Command API Reference / Input / Output

DeleteContainerRecipe

Command API Reference / Input / Output

DeleteDistributionConfiguration

Command API Reference / Input / Output

DeleteImage

Command API Reference / Input / Output

DeleteImagePipeline

Command API Reference / Input / Output

DeleteImageRecipe

Command API Reference / Input / Output

DeleteInfrastructureConfiguration

Command API Reference / Input / Output

DeleteLifecyclePolicy

Command API Reference / Input / Output

DeleteWorkflow

Command API Reference / Input / Output

GetComponent

Command API Reference / Input / Output

GetComponentPolicy

Command API Reference / Input / Output

GetContainerRecipe

Command API Reference / Input / Output

GetContainerRecipePolicy

Command API Reference / Input / Output

GetDistributionConfiguration

Command API Reference / Input / Output

GetImage

Command API Reference / Input / Output

GetImagePipeline

Command API Reference / Input / Output

GetImagePolicy

Command API Reference / Input / Output

GetImageRecipe

Command API Reference / Input / Output

GetImageRecipePolicy

Command API Reference / Input / Output

GetInfrastructureConfiguration

Command API Reference / Input / Output

GetLifecycleExecution

Command API Reference / Input / Output

GetLifecyclePolicy

Command API Reference / Input / Output

GetWorkflow

Command API Reference / Input / Output

GetWorkflowExecution

Command API Reference / Input / Output

GetWorkflowStepExecution

Command API Reference / Input / Output

ImportComponent

Command API Reference / Input / Output

ImportVmImage

Command API Reference / Input / Output

ListComponentBuildVersions

Command API Reference / Input / Output

ListComponents

Command API Reference / Input / Output

ListContainerRecipes

Command API Reference / Input / Output

ListDistributionConfigurations

Command API Reference / Input / Output

ListImageBuildVersions

Command API Reference / Input / Output

ListImagePackages

Command API Reference / Input / Output

ListImagePipelineImages

Command API Reference / Input / Output

ListImagePipelines

Command API Reference / Input / Output

ListImageRecipes

Command API Reference / Input / Output

ListImages

Command API Reference / Input / Output

ListImageScanFindingAggregations

Command API Reference / Input / Output

ListImageScanFindings

Command API Reference / Input / Output

ListInfrastructureConfigurations

Command API Reference / Input / Output

ListLifecycleExecutionResources

Command API Reference / Input / Output

ListLifecycleExecutions

Command API Reference / Input / Output

ListLifecyclePolicies

Command API Reference / Input / Output

ListTagsForResource

Command API Reference / Input / Output

ListWaitingWorkflowSteps

Command API Reference / Input / Output

ListWorkflowBuildVersions

Command API Reference / Input / Output

ListWorkflowExecutions

Command API Reference / Input / Output

ListWorkflows

Command API Reference / Input / Output

ListWorkflowStepExecutions

Command API Reference / Input / Output

PutComponentPolicy

Command API Reference / Input / Output

PutContainerRecipePolicy

Command API Reference / Input / Output

PutImagePolicy

Command API Reference / Input / Output

PutImageRecipePolicy

Command API Reference / Input / Output

SendWorkflowStepAction

Command API Reference / Input / Output

StartImagePipelineExecution

Command API Reference / Input / Output

StartResourceStateUpdate

Command API Reference / Input / Output

TagResource

Command API Reference / Input / Output

UntagResource

Command API Reference / Input / Output

UpdateDistributionConfiguration

Command API Reference / Input / Output

UpdateImagePipeline

Command API Reference / Input / Output

UpdateInfrastructureConfiguration

Command API Reference / Input / Output

UpdateLifecyclePolicy

Command API Reference / Input / Output

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-imagebuilder

Weekly Downloads

109,745

Version

3.564.0

License

Apache-2.0

Unpacked Size

1.56 MB

Total Files

356

Last publish

Collaborators

  • mattsb42-aws
  • kuhe
  • amzn-oss
  • aws-sdk-bot
  • trivikr-aws