Back to Aws Sdk Js V3

@aws-sdk/client-config-service

clients/client-config-service/README.md

3.1043.057.7 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-config-service

Description

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

<fullname>Config</fullname>

<p>Config provides a way to keep track of the configurations of all the Amazon Web Services resources associated with your Amazon Web Services account. You can use Config to get the current and historical configurations of each Amazon Web Services resource and also to get information about the relationship between the resources. An Amazon Web Services resource can be an Amazon Compute Cloud (Amazon EC2) instance, an Elastic Block Store (EBS) volume, an elastic network Interface (ENI), or a security group. For a complete list of resources currently supported by Config, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources">Supported Amazon Web Services resources</a>.</p> <p>You can access and manage Config through the Amazon Web Services Management Console, the Amazon Web Services Command Line Interface (Amazon Web Services CLI), the Config API, or the Amazon Web Services SDKs for Config. This reference guide contains documentation for the Config API and the Amazon Web Services CLI commands that you can use to manage Config. The Config API uses the Signature Version 4 protocol for signing requests. For more information about how to sign a request with this protocol, see <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Signature Version 4 Signing Process</a>. For detailed information about Config features and their associated actions or commands, as well as how to work with Amazon Web Services Management Console, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html">What Is Config</a> in the <i>Config Developer Guide</i>.</p>

Installing

To install this package, use the CLI of your favorite package manager:

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

Getting Started

Import

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

js
// ES5 example
const { ConfigServiceClient, ListStoredQueriesCommand } = require("@aws-sdk/client-config-service");
ts
// ES6+ example
import { ConfigServiceClient, ListStoredQueriesCommand } from "@aws-sdk/client-config-service";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new ConfigServiceClient({ region: "REGION" });

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

Async/await

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

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

Promises

You can also use Promise chaining.

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

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

ConfigService extends ConfigServiceClient and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (ConfigServiceClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { ConfigService } from "@aws-sdk/client-config-service";

const client = new ConfigService({ region: "REGION" });

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

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

// callbacks (not recommended).
client.listStoredQueries(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).

js
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;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use 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-config-service 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)

<details> <summary> AssociateResourceTypes </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchGetAggregateResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchGetResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAggregationAuthorization </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConfigurationAggregator </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConfigurationRecorder </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConformancePack </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteDeliveryChannel </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteEvaluationResults </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteOrganizationConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteOrganizationConformancePack </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeletePendingAggregationRequest </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRemediationConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRemediationExceptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRetentionConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteServiceLinkedConfigurationRecorder </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteStoredQuery </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeliverConfigSnapshot </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeAggregateComplianceByConfigRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeAggregateComplianceByConformancePacks </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeAggregationAuthorizations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeComplianceByConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeComplianceByResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConfigRuleEvaluationStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConfigRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConfigurationAggregators </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConfigurationAggregatorSourcesStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConfigurationRecorders </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConfigurationRecorderStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConformancePackCompliance </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConformancePacks </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConformancePackStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeDeliveryChannels </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeDeliveryChannelStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeOrganizationConfigRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeOrganizationConfigRuleStatuses </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeOrganizationConformancePacks </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeOrganizationConformancePackStatuses </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribePendingAggregationRequests </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeRemediationConfigurations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeRemediationExceptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeRemediationExecutionStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeRetentionConfigurations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateResourceTypes </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAggregateComplianceDetailsByConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAggregateConfigRuleComplianceSummary </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAggregateConformancePackComplianceSummary </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAggregateDiscoveredResourceCounts </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAggregateResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetComplianceDetailsByConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetComplianceDetailsByResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetComplianceSummaryByConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetComplianceSummaryByResourceType </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetConformancePackComplianceDetails </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetConformancePackComplianceSummary </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetCustomRulePolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDiscoveredResourceCounts </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetOrganizationConfigRuleDetailedStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetOrganizationConformancePackDetailedStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetOrganizationCustomRulePolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetResourceConfigHistory </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetResourceEvaluationSummary </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetStoredQuery </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAggregateDiscoveredResources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListConfigurationRecorders </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListConformancePackComplianceScores </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDiscoveredResources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListResourceEvaluations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListStoredQueries </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAggregationAuthorization </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationAggregator </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationRecorder </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConformancePack </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutDeliveryChannel </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEvaluations </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutExternalEvaluation </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutOrganizationConfigRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutOrganizationConformancePack </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutRemediationConfigurations </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutRemediationExceptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutRetentionConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutServiceLinkedConfigurationRecorder </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutStoredQuery </summary>

Command API Reference / Input / Output

</details> <details> <summary> SelectAggregateResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> SelectResourceConfig </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartConfigRulesEvaluation </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartConfigurationRecorder </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartRemediationExecution </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartResourceEvaluation </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopConfigurationRecorder </summary>

Command API Reference / Input / Output

</details> <details> <summary> TagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UntagResource </summary>

Command API Reference / Input / Output

</details>