UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

116 lines 4.81 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.IPSet = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage a GuardDuty IPSet. * * > **Note:** Currently in GuardDuty, users from member accounts cannot upload and further manage IPSets. IPSets 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-ip-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 myIPSet = new aws.s3.BucketObjectv2("MyIPSet", { * content: "10.0.0.0/8\n", * bucket: bucket.id, * key: "MyIPSet", * }); * const example = new aws.guardduty.IPSet("example", { * activate: true, * detectorId: primary.id, * format: "TXT", * location: pulumi.interpolate`https://s3.amazonaws.com/${myIPSet.bucket}/${myIPSet.key}`, * name: "MyIPSet", * }); * const bucketAcl = new aws.s3.BucketAcl("bucket_acl", { * bucket: bucket.id, * acl: "private", * }); * ``` * * ## Import * * Using `pulumi import`, import GuardDuty IPSet using the primary GuardDuty detector ID and IPSet ID. For example: * * ```sh * $ pulumi import aws:guardduty/iPSet:IPSet MyIPSet 00b00fd5aecc0ab60a708659477e9617:123456789012 * ``` */ class IPSet extends pulumi.CustomResource { /** * Get an existing IPSet 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 IPSet(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of IPSet. 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'] === IPSet.__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(IPSet.__pulumiType, name, resourceInputs, opts); } } exports.IPSet = IPSet; /** @internal */ IPSet.__pulumiType = 'aws:guardduty/iPSet:IPSet'; //# sourceMappingURL=ipset.js.map