UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

151 lines 5.69 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.CatalogTableOptimizer = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS Glue Catalog Table Optimizer. * * ## Example Usage * * ### Compaction Optimizer * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.CatalogTableOptimizer("example", { * catalogId: "123456789012", * databaseName: "example_database", * tableName: "example_table", * configuration: { * roleArn: "arn:aws:iam::123456789012:role/example-role", * enabled: true, * }, * type: "compaction", * }); * ``` * * ### Snapshot Retention Optimizer * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.CatalogTableOptimizer("example", { * catalogId: "123456789012", * databaseName: "example_database", * tableName: "example_table", * configuration: { * roleArn: "arn:aws:iam::123456789012:role/example-role", * enabled: true, * retentionConfiguration: { * icebergConfiguration: { * snapshotRetentionPeriodInDays: 7, * numberOfSnapshotsToRetain: 3, * cleanExpiredFiles: true, * }, * }, * }, * type: "retention", * }); * ``` * * ### Orphan File Deletion Optimizer * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.CatalogTableOptimizer("example", { * catalogId: "123456789012", * databaseName: "example_database", * tableName: "example_table", * configuration: { * roleArn: "arn:aws:iam::123456789012:role/example-role", * enabled: true, * orphanFileDeletionConfiguration: { * icebergConfiguration: { * orphanFileRetentionPeriodInDays: 7, * location: "s3://example-bucket/example_table/", * }, * }, * }, * type: "orphan_file_deletion", * }); * ``` * * ## Import * * Using `pulumi import`, import Glue Catalog Table Optimizer using the `catalog_id,database_name,table_name,type`. For example: * * ```sh * $ pulumi import aws:glue/catalogTableOptimizer:CatalogTableOptimizer example 123456789012,example_database,example_table,compaction * ``` */ class CatalogTableOptimizer extends pulumi.CustomResource { /** * Get an existing CatalogTableOptimizer resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new CatalogTableOptimizer(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of CatalogTableOptimizer. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === CatalogTableOptimizer.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["catalogId"] = state?.catalogId; resourceInputs["configuration"] = state?.configuration; resourceInputs["databaseName"] = state?.databaseName; resourceInputs["region"] = state?.region; resourceInputs["tableName"] = state?.tableName; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.catalogId === undefined && !opts.urn) { throw new Error("Missing required property 'catalogId'"); } if (args?.databaseName === undefined && !opts.urn) { throw new Error("Missing required property 'databaseName'"); } if (args?.tableName === undefined && !opts.urn) { throw new Error("Missing required property 'tableName'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["catalogId"] = args?.catalogId; resourceInputs["configuration"] = args?.configuration; resourceInputs["databaseName"] = args?.databaseName; resourceInputs["region"] = args?.region; resourceInputs["tableName"] = args?.tableName; resourceInputs["type"] = args?.type; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CatalogTableOptimizer.__pulumiType, name, resourceInputs, opts); } } exports.CatalogTableOptimizer = CatalogTableOptimizer; /** @internal */ CatalogTableOptimizer.__pulumiType = 'aws:glue/catalogTableOptimizer:CatalogTableOptimizer'; //# sourceMappingURL=catalogTableOptimizer.js.map