BatchCreateBillScenarioCommitmentModificationCommand

Create Compute Savings Plans, EC2 Instance Savings Plans, or EC2 Reserved Instances commitments that you want to model in a Bill Scenario.

The BatchCreateBillScenarioCommitmentModification operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission bcm-pricing-calculator:CreateBillScenarioCommitmentModification in your policies.

Example Syntax

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

import { BCMPricingCalculatorClient, BatchCreateBillScenarioCommitmentModificationCommand } from "@aws-sdk/client-bcm-pricing-calculator"; // ES Modules import
// const { BCMPricingCalculatorClient, BatchCreateBillScenarioCommitmentModificationCommand } = require("@aws-sdk/client-bcm-pricing-calculator"); // CommonJS import
const client = new BCMPricingCalculatorClient(config);
const input = { // BatchCreateBillScenarioCommitmentModificationRequest
  billScenarioId: "STRING_VALUE", // required
  commitmentModifications: [ // BatchCreateBillScenarioCommitmentModificationEntries // required
    { // BatchCreateBillScenarioCommitmentModificationEntry
      key: "STRING_VALUE", // required
      group: "STRING_VALUE",
      usageAccountId: "STRING_VALUE", // required
      commitmentAction: { // BillScenarioCommitmentModificationAction Union: only one key present
        addReservedInstanceAction: { // AddReservedInstanceAction
          reservedInstancesOfferingId: "STRING_VALUE",
          instanceCount: Number("int"),
        },
        addSavingsPlanAction: { // AddSavingsPlanAction
          savingsPlanOfferingId: "STRING_VALUE",
          commitment: Number("double"),
        },
        negateReservedInstanceAction: { // NegateReservedInstanceAction
          reservedInstancesId: "STRING_VALUE",
        },
        negateSavingsPlanAction: { // NegateSavingsPlanAction
          savingsPlanId: "STRING_VALUE",
        },
      },
    },
  ],
  clientToken: "STRING_VALUE",
};
const command = new BatchCreateBillScenarioCommitmentModificationCommand(input);
const response = await client.send(command);
// { // BatchCreateBillScenarioCommitmentModificationResponse
//   items: [ // BatchCreateBillScenarioCommitmentModificationItems
//     { // BatchCreateBillScenarioCommitmentModificationItem
//       key: "STRING_VALUE",
//       id: "STRING_VALUE",
//       group: "STRING_VALUE",
//       usageAccountId: "STRING_VALUE",
//       commitmentAction: { // BillScenarioCommitmentModificationAction Union: only one key present
//         addReservedInstanceAction: { // AddReservedInstanceAction
//           reservedInstancesOfferingId: "STRING_VALUE",
//           instanceCount: Number("int"),
//         },
//         addSavingsPlanAction: { // AddSavingsPlanAction
//           savingsPlanOfferingId: "STRING_VALUE",
//           commitment: Number("double"),
//         },
//         negateReservedInstanceAction: { // NegateReservedInstanceAction
//           reservedInstancesId: "STRING_VALUE",
//         },
//         negateSavingsPlanAction: { // NegateSavingsPlanAction
//           savingsPlanId: "STRING_VALUE",
//         },
//       },
//     },
//   ],
//   errors: [ // BatchCreateBillScenarioCommitmentModificationErrors
//     { // BatchCreateBillScenarioCommitmentModificationError
//       key: "STRING_VALUE",
//       errorMessage: "STRING_VALUE",
//       errorCode: "CONFLICT" || "INTERNAL_SERVER_ERROR" || "INVALID_ACCOUNT",
//     },
//   ],
// };

BatchCreateBillScenarioCommitmentModificationCommand Input

Parameter
Type
Description
billScenarioId
Required
string | undefined

The ID of the Bill Scenario for which you want to create the modeled commitment.

commitmentModifications
Required
BatchCreateBillScenarioCommitmentModificationEntry[] | undefined

List of commitments that you want to model in the Bill Scenario.

clientToken
string | undefined

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

BatchCreateBillScenarioCommitmentModificationCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
errors
BatchCreateBillScenarioCommitmentModificationError[] | undefined

Returns the list of errors reason and the commitment item keys that cannot be created in the Bill Scenario.

items
BatchCreateBillScenarioCommitmentModificationItem[] | undefined

Returns the list of successful commitment line items that were created for the Bill Scenario.

Throws

Name
Fault
Details
ConflictException
client

The request could not be processed because of conflict in the current state of the resource.

DataUnavailableException
client

The requested data is currently unavailable.

ResourceNotFoundException
client

The specified resource was not found.

AccessDeniedException
client

You do not have sufficient access to perform this action.

InternalServerException
server

An internal error has occurred. Retry your request, but if the problem persists, contact Amazon Web Services support.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input provided fails to satisfy the constraints specified by an Amazon Web Services service.

BCMPricingCalculatorServiceException
Base exception class for all service exceptions from BCMPricingCalculator service.