@pulumi/aws
Version: 
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
86 lines • 3.96 kB
JavaScript
;
// *** 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.Resource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Registers a Lake Formation resource (e.g., S3 bucket) as managed by the Data Catalog. In other words, the S3 path is added to the data lake.
 *
 * Choose a role that has read/write access to the chosen Amazon S3 path or use the service-linked role.
 * When you register the S3 path, the service-linked role and a new inline policy are created on your behalf.
 * Lake Formation adds the first path to the inline policy and attaches it to the service-linked role.
 * When you register subsequent paths, Lake Formation adds the path to the existing policy.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 *
 * const example = aws.s3.getBucket({
 *     bucket: "an-example-bucket",
 * });
 * const exampleResource = new aws.lakeformation.Resource("example", {arn: example.then(example => example.arn)});
 * ```
 */
class Resource extends pulumi.CustomResource {
    /**
     * Get an existing Resource 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 Resource(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Resource.  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'] === Resource.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["arn"] = state?.arn;
            resourceInputs["hybridAccessEnabled"] = state?.hybridAccessEnabled;
            resourceInputs["lastModified"] = state?.lastModified;
            resourceInputs["region"] = state?.region;
            resourceInputs["roleArn"] = state?.roleArn;
            resourceInputs["useServiceLinkedRole"] = state?.useServiceLinkedRole;
            resourceInputs["withFederation"] = state?.withFederation;
            resourceInputs["withPrivilegedAccess"] = state?.withPrivilegedAccess;
        }
        else {
            const args = argsOrState;
            if (args?.arn === undefined && !opts.urn) {
                throw new Error("Missing required property 'arn'");
            }
            resourceInputs["arn"] = args?.arn;
            resourceInputs["hybridAccessEnabled"] = args?.hybridAccessEnabled;
            resourceInputs["region"] = args?.region;
            resourceInputs["roleArn"] = args?.roleArn;
            resourceInputs["useServiceLinkedRole"] = args?.useServiceLinkedRole;
            resourceInputs["withFederation"] = args?.withFederation;
            resourceInputs["withPrivilegedAccess"] = args?.withPrivilegedAccess;
            resourceInputs["lastModified"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Resource.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Resource = Resource;
/** @internal */
Resource.__pulumiType = 'aws:lakeformation/resource:Resource';
//# sourceMappingURL=resource.js.map