@pulumi/tailscale
Version:
A Pulumi package for creating and managing Tailscale cloud resources.
134 lines • 6.47 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.LogstreamConfiguration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The logstreamConfiguration resource allows you to configure streaming configuration or network flow logs to a supported security information and event management (SIEM) system. See https://tailscale.com/kb/1255/log-streaming for more information.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as tailscale from "@pulumi/tailscale";
*
* // Example configuration for a non-S3 logstreaming endpoint
* const sampleLogstreamConfiguration = new tailscale.LogstreamConfiguration("sample_logstream_configuration", {
* logType: "configuration",
* destinationType: "panther",
* url: "https://example.com",
* token: "some-token",
* });
* // Example configuration for an AWS S3 logstreaming endpoint
* const sampleLogstreamConfigurationS3 = new tailscale.LogstreamConfiguration("sample_logstream_configuration_s3", {
* logType: "configuration",
* destinationType: "s3",
* s3Bucket: tailscaleLogs.id,
* s3Region: "us-west-2",
* s3AuthenticationType: "rolearn",
* s3RoleArn: tailscaleLogsWriter.arn,
* s3ExternalId: prod.externalId,
* });
* // Example configuration for an S3-compatible logstreaming endpoint
* const sampleLogstreamConfigurationS3Compatible = new tailscale.LogstreamConfiguration("sample_logstream_configuration_s3_compatible", {
* logType: "configuration",
* destinationType: "s3",
* url: "https://s3.example.com",
* s3Bucket: "example-bucket",
* s3Region: "us-west-2",
* s3AuthenticationType: "accesskey",
* s3AccessKeyId: "some-access-key",
* s3SecretAccessKey: "some-secret-key",
* });
* ```
*
* ## Import
*
* The `pulumi import` command can be used, for example:
*
* Logstream configuration can be imported using the logstream configuration id, e.g.,
*
* ```sh
* $ pulumi import tailscale:index/logstreamConfiguration:LogstreamConfiguration sample_logstream_configuration 123456789
* ```
*/
class LogstreamConfiguration extends pulumi.CustomResource {
/**
* Get an existing LogstreamConfiguration 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 LogstreamConfiguration(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LogstreamConfiguration. 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'] === LogstreamConfiguration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["compressionFormat"] = state?.compressionFormat;
resourceInputs["destinationType"] = state?.destinationType;
resourceInputs["logType"] = state?.logType;
resourceInputs["s3AccessKeyId"] = state?.s3AccessKeyId;
resourceInputs["s3AuthenticationType"] = state?.s3AuthenticationType;
resourceInputs["s3Bucket"] = state?.s3Bucket;
resourceInputs["s3ExternalId"] = state?.s3ExternalId;
resourceInputs["s3KeyPrefix"] = state?.s3KeyPrefix;
resourceInputs["s3Region"] = state?.s3Region;
resourceInputs["s3RoleArn"] = state?.s3RoleArn;
resourceInputs["s3SecretAccessKey"] = state?.s3SecretAccessKey;
resourceInputs["token"] = state?.token;
resourceInputs["uploadPeriodMinutes"] = state?.uploadPeriodMinutes;
resourceInputs["url"] = state?.url;
resourceInputs["user"] = state?.user;
}
else {
const args = argsOrState;
if (args?.destinationType === undefined && !opts.urn) {
throw new Error("Missing required property 'destinationType'");
}
if (args?.logType === undefined && !opts.urn) {
throw new Error("Missing required property 'logType'");
}
resourceInputs["compressionFormat"] = args?.compressionFormat;
resourceInputs["destinationType"] = args?.destinationType;
resourceInputs["logType"] = args?.logType;
resourceInputs["s3AccessKeyId"] = args?.s3AccessKeyId;
resourceInputs["s3AuthenticationType"] = args?.s3AuthenticationType;
resourceInputs["s3Bucket"] = args?.s3Bucket;
resourceInputs["s3ExternalId"] = args?.s3ExternalId;
resourceInputs["s3KeyPrefix"] = args?.s3KeyPrefix;
resourceInputs["s3Region"] = args?.s3Region;
resourceInputs["s3RoleArn"] = args?.s3RoleArn;
resourceInputs["s3SecretAccessKey"] = args?.s3SecretAccessKey ? pulumi.secret(args.s3SecretAccessKey) : undefined;
resourceInputs["token"] = args?.token ? pulumi.secret(args.token) : undefined;
resourceInputs["uploadPeriodMinutes"] = args?.uploadPeriodMinutes;
resourceInputs["url"] = args?.url;
resourceInputs["user"] = args?.user;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["s3SecretAccessKey", "token"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(LogstreamConfiguration.__pulumiType, name, resourceInputs, opts);
}
}
exports.LogstreamConfiguration = LogstreamConfiguration;
/** @internal */
LogstreamConfiguration.__pulumiType = 'tailscale:index/logstreamConfiguration:LogstreamConfiguration';
//# sourceMappingURL=logstreamConfiguration.js.map