"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.Trail = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created.
 */
class Trail extends pulumi.CustomResource {
    /**
     * Get an existing Trail 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 opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new Trail(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Trail.  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'] === Trail.__pulumiType;
    }
    /**
     * Create a Trail resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            if (args?.isLogging === undefined && !opts.urn) {
                throw new Error("Missing required property 'isLogging'");
            }
            if (args?.s3BucketName === undefined && !opts.urn) {
                throw new Error("Missing required property 's3BucketName'");
            }
            resourceInputs["advancedEventSelectors"] = args?.advancedEventSelectors;
            resourceInputs["aggregationConfigurations"] = args?.aggregationConfigurations;
            resourceInputs["cloudWatchLogsLogGroupArn"] = args?.cloudWatchLogsLogGroupArn;
            resourceInputs["cloudWatchLogsRoleArn"] = args?.cloudWatchLogsRoleArn;
            resourceInputs["enableLogFileValidation"] = args?.enableLogFileValidation;
            resourceInputs["eventSelectors"] = args?.eventSelectors;
            resourceInputs["includeGlobalServiceEvents"] = args?.includeGlobalServiceEvents;
            resourceInputs["insightSelectors"] = args?.insightSelectors;
            resourceInputs["isLogging"] = args?.isLogging;
            resourceInputs["isMultiRegionTrail"] = args?.isMultiRegionTrail;
            resourceInputs["isOrganizationTrail"] = args?.isOrganizationTrail;
            resourceInputs["kmsKeyId"] = args?.kmsKeyId;
            resourceInputs["s3BucketName"] = args?.s3BucketName;
            resourceInputs["s3KeyPrefix"] = args?.s3KeyPrefix;
            resourceInputs["snsTopicName"] = args?.snsTopicName;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["trailName"] = args?.trailName;
            resourceInputs["arn"] = undefined /*out*/;
            resourceInputs["snsTopicArn"] = undefined /*out*/;
        }
        else {
            resourceInputs["advancedEventSelectors"] = undefined /*out*/;
            resourceInputs["aggregationConfigurations"] = undefined /*out*/;
            resourceInputs["arn"] = undefined /*out*/;
            resourceInputs["cloudWatchLogsLogGroupArn"] = undefined /*out*/;
            resourceInputs["cloudWatchLogsRoleArn"] = undefined /*out*/;
            resourceInputs["enableLogFileValidation"] = undefined /*out*/;
            resourceInputs["eventSelectors"] = undefined /*out*/;
            resourceInputs["includeGlobalServiceEvents"] = undefined /*out*/;
            resourceInputs["insightSelectors"] = undefined /*out*/;
            resourceInputs["isLogging"] = undefined /*out*/;
            resourceInputs["isMultiRegionTrail"] = undefined /*out*/;
            resourceInputs["isOrganizationTrail"] = undefined /*out*/;
            resourceInputs["kmsKeyId"] = undefined /*out*/;
            resourceInputs["s3BucketName"] = undefined /*out*/;
            resourceInputs["s3KeyPrefix"] = undefined /*out*/;
            resourceInputs["snsTopicArn"] = undefined /*out*/;
            resourceInputs["snsTopicName"] = undefined /*out*/;
            resourceInputs["tags"] = undefined /*out*/;
            resourceInputs["trailName"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["trailName"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(Trail.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Trail = Trail;
/** @internal */
Trail.__pulumiType = 'aws-native:cloudtrail:Trail';
//# sourceMappingURL=trail.js.map