UNPKG

@pulumi/aws

Version:

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

100 lines 4.27 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.Member = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage a GuardDuty member. To accept invitations in member accounts, see the `aws.guardduty.InviteAccepter` resource. * * ## 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 member = new aws.guardduty.Detector("member", {enable: true}); * const memberMember = new aws.guardduty.Member("member", { * accountId: member.accountId, * detectorId: primary.id, * email: "required@example.com", * invite: true, * invitationMessage: "please accept guardduty invitation", * }); * ``` * * ## Import * * Using `pulumi import`, import GuardDuty members using the primary GuardDuty detector ID and member AWS account ID. For example: * * ```sh * $ pulumi import aws:guardduty/member:Member MyMember 00b00fd5aecc0ab60a708659477e9617:123456789012 * ``` */ class Member extends pulumi.CustomResource { /** * Get an existing Member 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 Member(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Member. 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'] === Member.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["detectorId"] = state?.detectorId; resourceInputs["disableEmailNotification"] = state?.disableEmailNotification; resourceInputs["email"] = state?.email; resourceInputs["invitationMessage"] = state?.invitationMessage; resourceInputs["invite"] = state?.invite; resourceInputs["region"] = state?.region; resourceInputs["relationshipStatus"] = state?.relationshipStatus; } else { const args = argsOrState; if (args?.accountId === undefined && !opts.urn) { throw new Error("Missing required property 'accountId'"); } if (args?.detectorId === undefined && !opts.urn) { throw new Error("Missing required property 'detectorId'"); } if (args?.email === undefined && !opts.urn) { throw new Error("Missing required property 'email'"); } resourceInputs["accountId"] = args?.accountId; resourceInputs["detectorId"] = args?.detectorId; resourceInputs["disableEmailNotification"] = args?.disableEmailNotification; resourceInputs["email"] = args?.email; resourceInputs["invitationMessage"] = args?.invitationMessage; resourceInputs["invite"] = args?.invite; resourceInputs["region"] = args?.region; resourceInputs["relationshipStatus"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Member.__pulumiType, name, resourceInputs, opts); } } exports.Member = Member; /** @internal */ Member.__pulumiType = 'aws:guardduty/member:Member'; //# sourceMappingURL=member.js.map