@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
117 lines • 5.4 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.TrafficMirrorSession = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Traffic mirror session.\
* Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-considerations.html) for traffic mirroring
*
* ## Example Usage
*
* To create a basic traffic mirror session
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const filter = new aws.ec2.TrafficMirrorFilter("filter", {
* description: "traffic mirror filter - example",
* networkServices: ["amazon-dns"],
* });
* const target = new aws.ec2.TrafficMirrorTarget("target", {networkLoadBalancerArn: lb.arn});
* const session = new aws.ec2.TrafficMirrorSession("session", {
* description: "traffic mirror session - example",
* networkInterfaceId: test.primaryNetworkInterfaceId,
* sessionNumber: 1,
* trafficMirrorFilterId: filter.id,
* trafficMirrorTargetId: target.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import traffic mirror sessions using the `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/trafficMirrorSession:TrafficMirrorSession session tms-0d8aa3ca35897b82e
* ```
*/
class TrafficMirrorSession extends pulumi.CustomResource {
/**
* Get an existing TrafficMirrorSession 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 TrafficMirrorSession(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of TrafficMirrorSession. 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'] === TrafficMirrorSession.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["networkInterfaceId"] = state?.networkInterfaceId;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["packetLength"] = state?.packetLength;
resourceInputs["region"] = state?.region;
resourceInputs["sessionNumber"] = state?.sessionNumber;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["trafficMirrorFilterId"] = state?.trafficMirrorFilterId;
resourceInputs["trafficMirrorTargetId"] = state?.trafficMirrorTargetId;
resourceInputs["virtualNetworkId"] = state?.virtualNetworkId;
}
else {
const args = argsOrState;
if (args?.networkInterfaceId === undefined && !opts.urn) {
throw new Error("Missing required property 'networkInterfaceId'");
}
if (args?.sessionNumber === undefined && !opts.urn) {
throw new Error("Missing required property 'sessionNumber'");
}
if (args?.trafficMirrorFilterId === undefined && !opts.urn) {
throw new Error("Missing required property 'trafficMirrorFilterId'");
}
if (args?.trafficMirrorTargetId === undefined && !opts.urn) {
throw new Error("Missing required property 'trafficMirrorTargetId'");
}
resourceInputs["description"] = args?.description;
resourceInputs["networkInterfaceId"] = args?.networkInterfaceId;
resourceInputs["packetLength"] = args?.packetLength;
resourceInputs["region"] = args?.region;
resourceInputs["sessionNumber"] = args?.sessionNumber;
resourceInputs["tags"] = args?.tags;
resourceInputs["trafficMirrorFilterId"] = args?.trafficMirrorFilterId;
resourceInputs["trafficMirrorTargetId"] = args?.trafficMirrorTargetId;
resourceInputs["virtualNetworkId"] = args?.virtualNetworkId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TrafficMirrorSession.__pulumiType, name, resourceInputs, opts);
}
}
exports.TrafficMirrorSession = TrafficMirrorSession;
/** @internal */
TrafficMirrorSession.__pulumiType = 'aws:ec2/trafficMirrorSession:TrafficMirrorSession';
//# sourceMappingURL=trafficMirrorSession.js.map