@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
117 lines • 5.13 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.ThreatIntelSet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage a GuardDuty ThreatIntelSet.
*
* > **Note:** Currently in GuardDuty, users from member accounts cannot upload and further manage ThreatIntelSets. ThreatIntelSets that are uploaded by the primary account are imposed on GuardDuty functionality in its member accounts. See the [GuardDuty API Documentation](https://docs.aws.amazon.com/guardduty/latest/ug/create-threat-intel-set.html)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const primary = new aws.guardduty.Detector("primary", {enable: true});
* const bucket = new aws.s3.Bucket("bucket", {});
* const bucketAcl = new aws.s3.BucketAcl("bucket_acl", {
* bucket: bucket.id,
* acl: "private",
* });
* const myThreatIntelSet = new aws.s3.BucketObjectv2("MyThreatIntelSet", {
* acl: "public-read",
* content: "10.0.0.0/8\n",
* bucket: bucket.id,
* key: "MyThreatIntelSet",
* });
* const myThreatIntelSetThreatIntelSet = new aws.guardduty.ThreatIntelSet("MyThreatIntelSet", {
* activate: true,
* detectorId: primary.id,
* format: "TXT",
* location: pulumi.interpolate`https://s3.amazonaws.com/${myThreatIntelSet.bucket}/${myThreatIntelSet.key}`,
* name: "MyThreatIntelSet",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import GuardDuty ThreatIntelSet using the primary GuardDuty detector ID and ThreatIntelSetID. For example:
*
* ```sh
* $ pulumi import aws:guardduty/threatIntelSet:ThreatIntelSet MyThreatIntelSet 00b00fd5aecc0ab60a708659477e9617:123456789012
* ```
*/
class ThreatIntelSet extends pulumi.CustomResource {
/**
* Get an existing ThreatIntelSet 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 ThreatIntelSet(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ThreatIntelSet. 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'] === ThreatIntelSet.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activate"] = state?.activate;
resourceInputs["arn"] = state?.arn;
resourceInputs["detectorId"] = state?.detectorId;
resourceInputs["format"] = state?.format;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.activate === undefined && !opts.urn) {
throw new Error("Missing required property 'activate'");
}
if (args?.detectorId === undefined && !opts.urn) {
throw new Error("Missing required property 'detectorId'");
}
if (args?.format === undefined && !opts.urn) {
throw new Error("Missing required property 'format'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["activate"] = args?.activate;
resourceInputs["detectorId"] = args?.detectorId;
resourceInputs["format"] = args?.format;
resourceInputs["location"] = args?.location;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ThreatIntelSet.__pulumiType, name, resourceInputs, opts);
}
}
exports.ThreatIntelSet = ThreatIntelSet;
/** @internal */
ThreatIntelSet.__pulumiType = 'aws:guardduty/threatIntelSet:ThreatIntelSet';
//# sourceMappingURL=threatIntelSet.js.map
;