### Install Cloudcraft Node.js SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Instructions for installing the Cloudcraft Node.js SDK using npm or yarn package managers. ```bash npm install cloudcraft --save # or yarn add cloudcraft ``` -------------------------------- ### Install Cloudcraft Node.js Library Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Instructions for installing the Cloudcraft Node.js library using npm or yarn. This is the first step to using the SDK in your project. ```console npm install cloudcraft --save ``` ```console yarn add cloudcraft ``` -------------------------------- ### GET /user/me Source: https://context7.com/datadog/cloudcraft-node/llms.txt Retrieves profile information for the currently authenticated user, including account settings and metadata. ```APIDOC ## GET /user/me ### Description Retrieves information about the authenticated user, including account details and settings. ### Method GET ### Endpoint /user/me ### Response #### Success Response (200) - **id** (string) - User unique identifier. - **name** (string) - User display name. - **email** (string) - User email address. - **createdAt** (string) - ISO timestamp of account creation. #### Response Example { "id": "user-123", "name": "John Doe", "email": "john@example.com", "createdAt": "2023-01-01T00:00:00Z" } ``` -------------------------------- ### Export Blueprint Budget Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Exports the budget data for a specific blueprint in a requested format. This example demonstrates creating a blueprint and exporting its budget as a CSV string. ```javascript const client = new Cloudcraft(); const blueprint = await client.blueprint.create(testBlueprint); const csv = (await client.budget.export( blueprint.id, Cloudcraft.BudgetFormat.CSV )) as string; ``` -------------------------------- ### Retrieve IAM Setup Parameters via Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Fetches the necessary IAM role parameters required to integrate a new AWS account. The output includes the Cloudcraft Account ID, External ID, and a direct AWS Console URL for role creation. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function getIAMSetupParameters() { try { const iamParams = await client.awsAccount.iamParameters(); console.log('IAM Role Setup Parameters:'); console.log(` Cloudcraft Account ID: ${iamParams.accountId}`); console.log(` External ID: ${iamParams.externalId}`); console.log(` AWS Console URL: ${iamParams.awsConsoleUrl}`); return iamParams; } catch (error) { console.error('Failed to get IAM parameters:', error.message); throw error; } } const params = await getIAMSetupParameters(); ``` -------------------------------- ### Get Current User Information Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Fetches the profile information for the currently authenticated user. Returns an object containing user details associated with the API key. ```javascript const client = new Cloudcraft(); const user = await client.user.me(); ``` -------------------------------- ### GET /aws-accounts/iam-parameters Source: https://context7.com/datadog/cloudcraft-node/llms.txt Retrieves the necessary IAM role parameters required to configure a new AWS account integration with Cloudcraft. ```APIDOC ## GET /aws-accounts/iam-parameters ### Description Retrieves the IAM role parameters needed to set up a new AWS account integration. Use these values when creating the IAM role in AWS. ### Method GET ### Endpoint /aws-accounts/iam-parameters ### Response #### Success Response (200) - **accountId** (string) - The Cloudcraft account ID for the trust relationship. - **externalId** (string) - The unique external ID for the trust relationship. - **awsConsoleUrl** (string) - A direct URL to the AWS console to create the role. #### Response Example { "accountId": "123456789012", "externalId": "abc-123-def", "awsConsoleUrl": "https://console.aws.amazon.com/..." } ``` -------------------------------- ### Get AWS IAM Role Parameters Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Retrieves the necessary IAM role parameters required for Cloudcraft to access AWS resources. This is essential for setting up or verifying AWS account integrations. ```javascript const client = new Cloudcraft(); const iamParameters = await client.awsAccount.iamParameters(); ``` -------------------------------- ### Get Specific Blueprint by ID using Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Fetches detailed data for a single blueprint using its ID, including diagram elements like nodes and connectors. Logs key properties of the retrieved blueprint and handles potential errors. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function getBlueprint(blueprintId: string) { try { const blueprint = await client.blueprint.get(blueprintId); console.log(`Name: ${blueprint.data.name}`); console.log(`Grid: ${blueprint.data.grid}`); console.log(`Projection: ${blueprint.data.projection}`); console.log(`Nodes: ${blueprint.data.nodes?.length || 0}`); console.log(`Connectors: ${blueprint.data.connectors?.length || 0}`); return blueprint; } catch (error) { console.error(`Failed to get blueprint ${blueprintId}:`, error.message); throw error; } } const blueprint = await getBlueprint('1234-5678-abcd-efgh'); ``` -------------------------------- ### Initialize Cloudcraft with Configuration Options Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Shows how to initialize the Cloudcraft client with a configuration object, allowing customization of host, port, protocol, timeouts, and network retries. ```javascript import { Cloudcraft } from 'Cloudcraft'; const client = new Cloudcraft('api_key...', { host: 'customhost', }); ``` -------------------------------- ### Initialize Cloudcraft Client Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Demonstrates how to initialize the Cloudcraft client with an API key, either directly or via an environment variable. This client is used to interact with the Cloudcraft API. ```javascript import { Cloudcraft } from 'Cloudcraft'; const client = new Cloudcraft('api_key...'); (async () => { const user = await client.user.me(); console.log(user.name); })(); ``` -------------------------------- ### Initialize Cloudcraft Client in TypeScript Source: https://context7.com/datadog/cloudcraft-node/llms.txt Demonstrates how to initialize the Cloudcraft client with an API key, environment variable, or custom configuration options like retries and timeouts. ```typescript import { Cloudcraft, BlueprintFormat, BudgetFormat, PaperSize, Projection, Theme } from 'cloudcraft'; // Initialize with API key directly const client = new Cloudcraft('your-api-key'); // Or use environment variable CLOUDCRAFT_API_KEY const clientFromEnv = new Cloudcraft(); // Initialize with custom configuration const clientWithConfig = new Cloudcraft('your-api-key', { maxNetworkRetries: 5, // Default: 10 timeout: 60_000, // Default: 80000ms host: 'api.cloudcraft.co', // Default: 'api.cloudcraft.co' port: 443, // Default: 443 protocol: 'https' // Default: 'https' }); ``` -------------------------------- ### Configure Cloudcraft SDK via Environment Variables Source: https://context7.com/datadog/cloudcraft-node/llms.txt Demonstrates how to configure the SDK using environment variables for secure credential management and how to override these settings during client instantiation. ```bash export CLOUDCRAFT_API_KEY="your-api-key" export CLOUDCRAFT_HOST="api.cloudcraft.co" export CLOUDCRAFT_PORT="443" export CLOUDCRAFT_PROTOCOL="https" export CLOUDCRAFT_TIMEOUT="80000" export CLOUDCRAFT_MAX_NETWORK_RETRIES="10" export CLOUDCRAFT_BASE_PATH="" ``` ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); const clientWithOverrides = new Cloudcraft(undefined, { timeout: 120_000 }); ``` -------------------------------- ### Execute Integration Tests Source: https://github.com/datadog/cloudcraft-node/blob/trunk/test/README.md Command to trigger the integration test suite against the live Cloudcraft API. Requires the .env file to be configured correctly. ```bash yarn test:integration ``` -------------------------------- ### Create Blueprint with Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Initializes a new blueprint with required configuration parameters including grid type and name. It returns the created blueprint object or throws an error if the request fails. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function createNewBlueprint() { try { const newBlueprint = await client.blueprint.create({ data: { grid: 'standard', name: 'My AWS Architecture', nodes: [], edges: [], icons: [], text: [], groups: [], images: [], surfaces: [], connectors: [], projection: 'isometric', disabledLayers: [], shareDocs: false }, tags: ['development', 'team-backend'] }); console.log(`Created blueprint: ${newBlueprint.id}`); return newBlueprint; } catch (error) { console.error('Failed to create blueprint:', error.message); throw error; } } const created = await createNewBlueprint(); ``` -------------------------------- ### Snapshot AWS Account Environment using Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Generates a diagram of a live AWS environment by scanning resources in a specified region. Supports exporting the snapshot in various formats like SVG and PNG, with options for filtering, styling, and projection. Requires the AWS account ID, region, and desired format. ```typescript import { Cloudcraft, BlueprintFormat, Projection, Theme } from 'cloudcraft'; import * as fs from 'fs'; const client = new Cloudcraft(); async function snapshotAWSEnvironment(awsAccountId: string, region: string) { try { // Snapshot as SVG with default options const svg = await client.awsAccount.snapshot( awsAccountId, region, BlueprintFormat.SVG ) as string; fs.writeFileSync(`aws-${region}.svg`, svg); // Snapshot as PNG with filtering and styling options const png = await client.awsAccount.snapshot( awsAccountId, region, BlueprintFormat.PNG, { filter: 'ec2,rds,lambda', // Only include specific services exclude: ['sg-*'], // Exclude security groups label: true, // Show resource labels autoconnect: true, // Auto-connect related resources scale: 2, projection: Projection.Isometric, theme: Theme.Dark, grid: false, transparent: false } ) as ArrayBuffer; fs.writeFileSync(`aws-${region}.png`, Buffer.from(png)); console.log(`AWS environment snapshot saved for ${region}`); } catch (error) { console.error('Failed to snapshot AWS environment:', error.message); throw error; } } await snapshotAWSEnvironment('aws-account-id', 'us-west-2'); ``` -------------------------------- ### Configure Environment Variables for Cloudcraft API Source: https://github.com/datadog/cloudcraft-node/blob/trunk/test/README.md Defines the required environment variables for authenticating with the Cloudcraft API. This file must be placed in the root directory to enable integration tests. ```bash export CLOUDCRAFT_API_KEY=XXXX export CLOUDCRAFT_AWS_ROLE_ARN=XXXX ``` -------------------------------- ### List All Blueprints using Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Retrieves and logs metadata for all blueprints accessible to the authenticated user, including their ID, name, tags, and creation/update timestamps. Handles potential errors during the API call. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function listAllBlueprints() { try { const blueprints = await client.blueprint.list(); blueprints.forEach((blueprint) => { console.log(`Blueprint: ${blueprint.name}`); console.log(` ID: ${blueprint.id}`); console.log(` Tags: ${blueprint.tags.join(', ')}`); console.log(` Created: ${blueprint.createdAt.toISOString()}`); console.log(` Updated: ${blueprint.updatedAt.toISOString()}`); }); return blueprints; } catch (error) { console.error('Failed to list blueprints:', error.message); throw error; } } // Example output: // Blueprint: Production Infrastructure // ID: 1234-5678-abcd-efgh // Tags: production, aws // Created: 2024-01-15T10:30:00.000Z // Updated: 2024-02-20T14:45:00.000Z ``` -------------------------------- ### List Cloudcraft Blueprints Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Retrieves a list of all blueprints associated with the authenticated Cloudcraft account. This function requires an initialized Cloudcraft client. ```javascript const client = new Cloudcraft(); const blueprints = await client.blueprint.list(); ``` -------------------------------- ### Create a New Cloudcraft Blueprint Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Creates a new blueprint with basic data, such as grid type and name. The `data` object contains the initial properties for the blueprint. ```javascript const client = new Cloudcraft(); const blueprint = await client.blueprint.create({ data: { grid: 'standard', name: 'My new blueprint', }, }); ``` -------------------------------- ### Retrieve Authenticated User Information Source: https://context7.com/datadog/cloudcraft-node/llms.txt Fetches profile details for the currently authenticated user, including account settings and timestamps for creation, updates, and last access. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function getCurrentUser() { try { const user = await client.user.me(); console.log('Current User:'); console.log(` ID: ${user.id}`); console.log(` Name: ${user.name}`); console.log(` Email: ${user.email}`); console.log(` Created: ${user.createdAt.toISOString()}`); console.log(` Last Updated: ${user.updatedAt.toISOString()}`); console.log(` Last Accessed: ${user.accessedAt.toISOString()}`); return user; } catch (error) { console.error('Failed to get user info:', error.message); throw error; } } const user = await getCurrentUser(); ``` -------------------------------- ### POST /blueprints/{blueprintId}/budget/export Source: https://context7.com/datadog/cloudcraft-node/llms.txt Exports cost estimation data for a specific blueprint in CSV or XLSX format with support for custom currency and time period settings. ```APIDOC ## POST /blueprints/{blueprintId}/budget/export ### Description Exports cost estimation data for a blueprint in CSV or XLSX format. Supports various currencies, time periods, and rate calculations. ### Method POST ### Endpoint /blueprints/{blueprintId}/budget/export ### Parameters #### Path Parameters - **blueprintId** (string) - Required - The ID of the blueprint to export. #### Request Body - **format** (string) - Required - 'CSV' or 'XLSX'. - **currency** (string) - Optional - Currency code (e.g., USD, EUR). - **period** (string) - Optional - Time period (e.g., Monthly, Yearly). ### Response #### Success Response (200) - **data** (binary) - The exported file content. #### Response Example { "data": "" } ``` -------------------------------- ### Export Blueprint with Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Exports blueprints into various formats like SVG, PNG, or PDF. Supports optional configurations such as scaling, dimensions, and paper size for document generation. ```typescript import { Cloudcraft, BlueprintFormat, PaperSize } from 'cloudcraft'; import * as fs from 'fs'; const client = new Cloudcraft(); async function exportBlueprintAsImage(blueprintId: string) { try { // Export as SVG (returns string) const svg = await client.blueprint.export( blueprintId, BlueprintFormat.SVG ) as string; fs.writeFileSync('architecture.svg', svg); // Export as PNG with custom options (returns ArrayBuffer) const png = await client.blueprint.export( blueprintId, BlueprintFormat.PNG, { scale: 2, width: 1920, height: 1080, grid: false, transparent: true } ) as ArrayBuffer; fs.writeFileSync('architecture.png', Buffer.from(png)); // Export as PDF with paper size const pdf = await client.blueprint.export( blueprintId, BlueprintFormat.PDF, { paperSize: PaperSize.A3, landscape: true, grid: true } ) as ArrayBuffer; fs.writeFileSync('architecture.pdf', Buffer.from(pdf)); console.log('Blueprint exported successfully'); } catch (error) { console.error('Failed to export blueprint:', error.message); throw error; } } await exportBlueprintAsImage('1234-5678-abcd-efgh'); ``` -------------------------------- ### Export Blueprint Budget Data via Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Exports cost estimation data for a specific blueprint into CSV or XLSX formats. Supports customization of currency, time periods, and rate calculations. ```typescript import { Cloudcraft, BudgetFormat, Currency, Period, Rate } from 'cloudcraft'; import * as fs from 'fs'; const client = new Cloudcraft(); async function exportBudget(blueprintId: string) { try { const csv = await client.budget.export(blueprintId, BudgetFormat.CSV) as string; fs.writeFileSync('budget.csv', csv); const xlsx = await client.budget.export(blueprintId, BudgetFormat.XLSX, { currency: Currency.EUR, period: Period.Yearly, rate: Rate.Effective }) as ArrayBuffer; fs.writeFileSync('budget.xlsx', Buffer.from(xlsx)); console.log('Budget exported successfully'); } catch (error) { console.error('Failed to export budget:', error.message); throw error; } } await exportBudget('1234-5678-abcd-efgh'); ``` -------------------------------- ### Snapshot AWS Account as SVG Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Generates an SVG diagram representing the current state of a specified AWS account. This requires the AWS account ID, region, and the desired output format (SVG). ```javascript const client = new Cloudcraft(); const awsAccounts = await client.awsAccount.list(); const awsAccount = awsAccounts.find( (awsAccount) => awsAccount.id === 'id' ) as any; const svg = (await client.awsAccount.snapshot( awsAccount.id, 'us-east-1', Cloudcraft.BlueprintFormat.SVG )) as string; ``` -------------------------------- ### Retrieve a Specific Cloudcraft Blueprint Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Fetches a single blueprint by its unique ID. This is useful for viewing or modifying an existing diagram. ```javascript const client = new Cloudcraft(); const blueprint = await client.blueprint.get('id'); ``` -------------------------------- ### List AWS Accounts using Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Retrieves all AWS accounts linked to your Cloudcraft account. Each account object includes details like name, ID, IAM role ARN, external ID, and creation timestamp. This function requires the Cloudcraft SDK and an initialized client. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function listAWSAccounts() { try { const awsAccounts = await client.awsAccount.list(); awsAccounts.forEach((account) => { console.log(`Account: ${account.name}`); console.log(` ID: ${account.id}`); console.log(` Role ARN: ${account.roleArn}`); console.log(` External ID: ${account.externalId}`); console.log(` Created: ${account.createdAt.toISOString()}`); }); return awsAccounts; } catch (error) { console.error('Failed to list AWS accounts:', error.message); throw error; } } const accounts = await listAWSAccounts(); ``` -------------------------------- ### Update an Existing Cloudcraft Blueprint Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Updates an existing blueprint by first retrieving it, modifying its properties (e.g., name), and then saving the changes. This requires the blueprint's ID. ```javascript const client = new Cloudcraft(); const blueprint = await client.blueprint.get('id'); blueprint.data.name = 'My updated blueprint'; await client.blueprint.update(blueprint); ``` -------------------------------- ### Add an AWS Account to Cloudcraft Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Adds an AWS account to Cloudcraft for visualization and management. Requires the account name, IAM role ARN, and AWS region. ```javascript const client = new Cloudcraft(); const awsAccount = await client.awsAccount.create( { name: 'Test account', roleArn: 'arn:...', }, 'us-east-1', ); ``` -------------------------------- ### List Cloudcraft AWS Accounts Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Retrieves a list of all AWS accounts that have been linked to the Cloudcraft account. This allows for managing and selecting accounts for operations. ```javascript const client = new Cloudcraft(); const awsAccounts = await client.awsAccount.list(); ``` -------------------------------- ### Update Blueprint with Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Updates an existing blueprint by first retrieving the current state, modifying properties, and sending the updated object back to the API. This ensures that existing data is preserved during the update process. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function renameBlueprint(blueprintId: string, newName: string) { try { // First, retrieve the existing blueprint const blueprint = await client.blueprint.get(blueprintId); // Modify the desired properties blueprint.data.name = newName; blueprint.tags = [...blueprint.tags, 'renamed']; // Update the blueprint const updatedBlueprint = await client.blueprint.update(blueprint); console.log(`Blueprint renamed to: ${updatedBlueprint.data.name}`); return updatedBlueprint; } catch (error) { console.error(`Failed to update blueprint ${blueprintId}:`, error.message); throw error; } } await renameBlueprint('1234-5678-abcd-efgh', 'Production Infrastructure v2'); ``` -------------------------------- ### Add AWS Account using Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Links a new AWS account to Cloudcraft by providing its name and IAM role ARN. The IAM role must be pre-configured in AWS with the necessary read-only permissions. The function returns the newly added AWS account details, including its ID and external ID. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function addAWSAccount() { try { const awsAccount = await client.awsAccount.create( { name: 'Production Account', roleArn: 'arn:aws:iam::123456789012:role/CloudcraftReadAccess' }, 'us-east-1' // Initial region to scan ); console.log(`AWS Account added: ${awsAccount.name}`); console.log(`Account ID: ${awsAccount.id}`); console.log(`External ID: ${awsAccount.externalId}`); return awsAccount; } catch (error) { console.error('Failed to add AWS account:', error.message); throw error; } } const newAccount = await addAWSAccount(); ``` -------------------------------- ### Export Cloudcraft Blueprint as SVG Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Exports a specified blueprint as an SVG image. This function requires the blueprint ID and specifies the desired output format (SVG in this case). ```javascript const client = new Cloudcraft(); const blueprint = await client.blueprint.get('id'); const svg = (await client.blueprint.export( blueprint.id, Cloudcraft.BlueprintFormat.SVG )) as string; ``` -------------------------------- ### Update AWS Account Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Updates the name of an existing AWS account. It retrieves the account list, identifies the target account by ID, modifies the name property, and sends the update request to the Cloudcraft API. ```javascript const client = new Cloudcraft(); const awsAccounts = await client.awsAccount.list(); const awsAccount = awsAccounts.find( (awsAccount) => awsAccount.id === 'id' ) as any; awsAccount.name = 'Updated account'; const updatedAWSAccount = await client.awsAccount.update(awsAccount); ``` -------------------------------- ### Delete AWS Account Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Removes an AWS account from the Cloudcraft configuration. It fetches the account list to verify existence before calling the delete method using the account ID. ```javascript const client = new Cloudcraft(); const awsAccounts = await client.awsAccount.list(); const awsAccount = awsAccounts.find( (awsAccount) => awsAccount.id === 'id' ) as any; await client.awsAccount.delete(awsAccount.id); ``` -------------------------------- ### Update AWS Account using Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Updates the configuration of a linked AWS account. This can include changing the display name or the IAM role ARN associated with the account. The function requires the AWS account ID to identify the account to be updated. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function updateAWSAccount(accountId: string) { try { // Get the current account configuration const awsAccounts = await client.awsAccount.list(); const awsAccount = awsAccounts.find((acc) => acc.id === accountId); if (!awsAccount) { throw new Error(`AWS account ${accountId} not found`); } // Update the account name awsAccount.name = 'Production Account (Updated)'; const updatedAccount = await client.awsAccount.update(awsAccount); console.log(`AWS account updated: ${updatedAccount.name}`); return updatedAccount; } catch (error) { console.error('Failed to update AWS account:', error.message); throw error; } } await updateAWSAccount('aws-account-id'); ``` -------------------------------- ### Delete Blueprint with Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Permanently removes a blueprint from the Cloudcraft account using its unique ID. This action is irreversible and requires proper error handling. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function deleteBlueprint(blueprintId: string) { try { await client.blueprint.delete(blueprintId); console.log(`Blueprint ${blueprintId} deleted successfully`); } catch (error) { console.error(`Failed to delete blueprint ${blueprintId}:`, error.message); throw error; } } await deleteBlueprint('1234-5678-abcd-efgh'); ``` -------------------------------- ### Delete a Cloudcraft Blueprint Source: https://github.com/datadog/cloudcraft-node/blob/trunk/README.md Deletes a blueprint identified by its unique ID. This action is irreversible and removes the diagram from Cloudcraft. ```javascript const client = new Cloudcraft(); const blueprint = await client.blueprint.get('id'); await client.blueprint.delete(blueprint.id); ``` -------------------------------- ### DELETE /aws-accounts/{accountId} Source: https://context7.com/datadog/cloudcraft-node/llms.txt Removes a linked AWS account from the Cloudcraft platform. This action does not impact the actual infrastructure within your AWS account. ```APIDOC ## DELETE /aws-accounts/{accountId} ### Description Removes a linked AWS account from Cloudcraft. This does not affect your actual AWS resources. ### Method DELETE ### Endpoint /aws-accounts/{accountId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The unique identifier of the AWS account to remove. ### Response #### Success Response (200) - **status** (string) - Confirmation message of the deletion. #### Response Example { "status": "success" } ``` -------------------------------- ### Delete AWS Account via Cloudcraft SDK Source: https://context7.com/datadog/cloudcraft-node/llms.txt Removes a linked AWS account from the Cloudcraft platform. This operation does not impact actual resources within the AWS environment. ```typescript import { Cloudcraft } from 'cloudcraft'; const client = new Cloudcraft(); async function deleteAWSAccount(accountId: string) { try { await client.awsAccount.delete(accountId); console.log(`AWS account ${accountId} removed from Cloudcraft`); } catch (error) { console.error('Failed to delete AWS account:', error.message); throw error; } } await deleteAWSAccount('aws-account-id'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.