UNPKG

@pulumi/cloudngfwaws

Version:

A Pulumi package for creating and managing Cloud NGFW for AWS resources.

233 lines 8.67 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NgfwLogProfile = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Resource for NGFW log profile manipulation. * * ## Admin Permission Type * * * `Firewall` * * ## Schema Overview * * The log profile resource supports two schemas for configuring log delivery: * * | | V1 Schema | V2 Schema | * |---|---|---| * | **Block** | `logDestination` | `logConfig` | * | **Log types per block** | One | Multiple (Set) | * | **Cross-account logging** | Not supported | Supported via `roleType` + `accountId` | * | **Use case** | Existing deployments | New deployments | * * *** * * ## V1 Schema — `logDestination` (Existing Deployments) * * > Use V1 if you already have a log profile deployed using `logDestination` blocks. * Existing configurations do not need to be migrated. * * One `logDestination` block is required per log type. The following destination types * are supported: `S3`, `CloudWatchLogs`, `KinesisDataFirehose`. * * **Full example — V1 log profile with multiple destinations:** * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudngfwaws from "@pulumi/cloudngfwaws"; * * const example = new cloudngfwaws.NgfwLogProfile("example", { * ngfw: exampleCloudngfwawsNgfw.name, * accountId: exampleCloudngfwawsNgfw.accountId, * logDestinations: [ * { * destinationType: "S3", * destination: "my-s3-bucket", * logType: "TRAFFIC", * }, * { * destinationType: "CloudWatchLogs", * destination: "my-log-group", * logType: "THREAT", * }, * { * destinationType: "KinesisDataFirehose", * destination: "my-firehose-stream", * logType: "DECRYPTION", * }, * ], * }); * ``` * * **To add a destination:** add another `logDestination` block and re-apply. * **To remove a destination:** remove the block and re-apply. * * *** * * ## V2 Schema — `logConfig` (New Deployments) * * > Use V2 for new deployments. It consolidates all destination configuration into a * single `logConfig` block and supports multiple log types per destination. * * **Full example — V2 log profile, same-account delivery:** * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudngfwaws from "@pulumi/cloudngfwaws"; * * const example = new cloudngfwaws.NgfwLogProfile("example", { * ngfw: exampleCloudngfwawsNgfw.name, * accountId: exampleCloudngfwawsNgfw.accountId, * logConfig: { * logDestinationType: "S3", * logDestination: "my-s3-bucket", * logTypes: [ * "TRAFFIC", * "THREAT", * "DECRYPTION", * ], * }, * }); * ``` * * **Full example — V2 log profile with cross-account delivery:** * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudngfwaws from "@pulumi/cloudngfwaws"; * * const example = new cloudngfwaws.NgfwLogProfile("example", { * ngfw: exampleCloudngfwawsNgfw.name, * accountId: exampleCloudngfwawsNgfw.accountId, * logConfig: { * logDestinationType: "CloudWatchLogs", * logDestination: "arn:aws:logs:us-east-1:222222222222:log-group:my-log-group", * logTypes: [ * "TRAFFIC", * "THREAT", * ], * roleType: "CrossAccount", * accountId: "222222222222", * }, * }); * ``` * * **Full example — V2 log profile with advanced threat logging and CloudWatch metrics:** * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudngfwaws from "@pulumi/cloudngfwaws"; * * const example = new cloudngfwaws.NgfwLogProfile("example", { * ngfw: exampleCloudngfwawsNgfw.name, * accountId: exampleCloudngfwawsNgfw.accountId, * advancedThreatLog: true, * cloudWatchMetricNamespace: "CloudNGFW", * logConfig: { * logDestinationType: "KinesisDataFirehose", * logDestination: "my-firehose-stream", * logTypes: [ * "TRAFFIC", * "THREAT", * "DECRYPTION", * ], * }, * }); * ``` * * *** * * ## Import * * import name is <account_id>:<ngfw> * * ```sh * $ pulumi import cloudngfwaws:index/ngfwLogProfile:NgfwLogProfile example 12345678:example-instance * ``` */ class NgfwLogProfile extends pulumi.CustomResource { /** * Get an existing NgfwLogProfile 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 NgfwLogProfile(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'cloudngfwaws:index/ngfwLogProfile:NgfwLogProfile'; /** * Returns true if the given object is an instance of NgfwLogProfile. 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'] === NgfwLogProfile.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["advancedThreatLog"] = state?.advancedThreatLog; resourceInputs["cloudWatchMetricNamespace"] = state?.cloudWatchMetricNamespace; resourceInputs["cloudwatchMetricFields"] = state?.cloudwatchMetricFields; resourceInputs["firewallId"] = state?.firewallId; resourceInputs["logConfig"] = state?.logConfig; resourceInputs["logDestinations"] = state?.logDestinations; resourceInputs["ngfw"] = state?.ngfw; resourceInputs["region"] = state?.region; resourceInputs["updateToken"] = state?.updateToken; } else { const args = argsOrState; resourceInputs["accountId"] = args?.accountId; resourceInputs["advancedThreatLog"] = args?.advancedThreatLog; resourceInputs["cloudWatchMetricNamespace"] = args?.cloudWatchMetricNamespace; resourceInputs["cloudwatchMetricFields"] = args?.cloudwatchMetricFields; resourceInputs["firewallId"] = args?.firewallId; resourceInputs["logConfig"] = args?.logConfig; resourceInputs["logDestinations"] = args?.logDestinations; resourceInputs["ngfw"] = args?.ngfw; resourceInputs["region"] = args?.region; resourceInputs["updateToken"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NgfwLogProfile.__pulumiType, name, resourceInputs, opts); } } exports.NgfwLogProfile = NgfwLogProfile; //# sourceMappingURL=ngfwLogProfile.js.map