1. Packages
  2. AWS
  3. API Docs
  4. guardduty
  5. Member
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.guardduty.Member

Explore with Pulumi AI

Provides a resource to manage a GuardDuty member. To accept invitations in member accounts, see the aws.guardduty.InviteAccepter resource.

Example Usage

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",
});
Copy
import pulumi
import pulumi_aws as aws

primary = aws.guardduty.Detector("primary", enable=True)
member = aws.guardduty.Detector("member", enable=True)
member_member = aws.guardduty.Member("member",
    account_id=member.account_id,
    detector_id=primary.id,
    email="required@example.com",
    invite=True,
    invitation_message="please accept guardduty invitation")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/guardduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		primary, err := guardduty.NewDetector(ctx, "primary", &guardduty.DetectorArgs{
			Enable: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		member, err := guardduty.NewDetector(ctx, "member", &guardduty.DetectorArgs{
			Enable: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = guardduty.NewMember(ctx, "member", &guardduty.MemberArgs{
			AccountId:         member.AccountId,
			DetectorId:        primary.ID(),
			Email:             pulumi.String("required@example.com"),
			Invite:            pulumi.Bool(true),
			InvitationMessage: pulumi.String("please accept guardduty invitation"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var primary = new Aws.GuardDuty.Detector("primary", new()
    {
        Enable = true,
    });

    var member = new Aws.GuardDuty.Detector("member", new()
    {
        Enable = true,
    });

    var memberMember = new Aws.GuardDuty.Member("member", new()
    {
        AccountId = member.AccountId,
        DetectorId = primary.Id,
        Email = "required@example.com",
        Invite = true,
        InvitationMessage = "please accept guardduty invitation",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.guardduty.Detector;
import com.pulumi.aws.guardduty.DetectorArgs;
import com.pulumi.aws.guardduty.Member;
import com.pulumi.aws.guardduty.MemberArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var primary = new Detector("primary", DetectorArgs.builder()
            .enable(true)
            .build());

        var member = new Detector("member", DetectorArgs.builder()
            .enable(true)
            .build());

        var memberMember = new Member("memberMember", MemberArgs.builder()
            .accountId(member.accountId())
            .detectorId(primary.id())
            .email("required@example.com")
            .invite(true)
            .invitationMessage("please accept guardduty invitation")
            .build());

    }
}
Copy
resources:
  primary:
    type: aws:guardduty:Detector
    properties:
      enable: true
  member:
    type: aws:guardduty:Detector
    properties:
      enable: true
  memberMember:
    type: aws:guardduty:Member
    name: member
    properties:
      accountId: ${member.accountId}
      detectorId: ${primary.id}
      email: required@example.com
      invite: true
      invitationMessage: please accept guardduty invitation
Copy

Create Member Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Member(name: string, args: MemberArgs, opts?: CustomResourceOptions);
@overload
def Member(resource_name: str,
           args: MemberArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def Member(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           account_id: Optional[str] = None,
           detector_id: Optional[str] = None,
           email: Optional[str] = None,
           disable_email_notification: Optional[bool] = None,
           invitation_message: Optional[str] = None,
           invite: Optional[bool] = None)
func NewMember(ctx *Context, name string, args MemberArgs, opts ...ResourceOption) (*Member, error)
public Member(string name, MemberArgs args, CustomResourceOptions? opts = null)
public Member(String name, MemberArgs args)
public Member(String name, MemberArgs args, CustomResourceOptions options)
type: aws:guardduty:Member
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. MemberArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. MemberArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. MemberArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. MemberArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. MemberArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsMemberResource = new Aws.GuardDuty.Member("awsMemberResource", new()
{
    AccountId = "string",
    DetectorId = "string",
    Email = "string",
    DisableEmailNotification = false,
    InvitationMessage = "string",
    Invite = false,
});
Copy
example, err := guardduty.NewMember(ctx, "awsMemberResource", &guardduty.MemberArgs{
	AccountId:                pulumi.String("string"),
	DetectorId:               pulumi.String("string"),
	Email:                    pulumi.String("string"),
	DisableEmailNotification: pulumi.Bool(false),
	InvitationMessage:        pulumi.String("string"),
	Invite:                   pulumi.Bool(false),
})
Copy
var awsMemberResource = new Member("awsMemberResource", MemberArgs.builder()
    .accountId("string")
    .detectorId("string")
    .email("string")
    .disableEmailNotification(false)
    .invitationMessage("string")
    .invite(false)
    .build());
Copy
aws_member_resource = aws.guardduty.Member("awsMemberResource",
    account_id="string",
    detector_id="string",
    email="string",
    disable_email_notification=False,
    invitation_message="string",
    invite=False)
Copy
const awsMemberResource = new aws.guardduty.Member("awsMemberResource", {
    accountId: "string",
    detectorId: "string",
    email: "string",
    disableEmailNotification: false,
    invitationMessage: "string",
    invite: false,
});
Copy
type: aws:guardduty:Member
properties:
    accountId: string
    detectorId: string
    disableEmailNotification: false
    email: string
    invitationMessage: string
    invite: false
Copy

Member Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Member resource accepts the following input properties:

AccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID for member account.
DetectorId
This property is required.
Changes to this property will trigger replacement.
string
The detector ID of the GuardDuty account where you want to create member accounts.
Email
This property is required.
Changes to this property will trigger replacement.
string
Email address for member account.
DisableEmailNotification Changes to this property will trigger replacement. bool
Boolean whether an email notification is sent to the accounts. Defaults to false.
InvitationMessage Changes to this property will trigger replacement. string
Message for invitation.
Invite bool
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
AccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID for member account.
DetectorId
This property is required.
Changes to this property will trigger replacement.
string
The detector ID of the GuardDuty account where you want to create member accounts.
Email
This property is required.
Changes to this property will trigger replacement.
string
Email address for member account.
DisableEmailNotification Changes to this property will trigger replacement. bool
Boolean whether an email notification is sent to the accounts. Defaults to false.
InvitationMessage Changes to this property will trigger replacement. string
Message for invitation.
Invite bool
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
accountId
This property is required.
Changes to this property will trigger replacement.
String
AWS account ID for member account.
detectorId
This property is required.
Changes to this property will trigger replacement.
String
The detector ID of the GuardDuty account where you want to create member accounts.
email
This property is required.
Changes to this property will trigger replacement.
String
Email address for member account.
disableEmailNotification Changes to this property will trigger replacement. Boolean
Boolean whether an email notification is sent to the accounts. Defaults to false.
invitationMessage Changes to this property will trigger replacement. String
Message for invitation.
invite Boolean
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
accountId
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID for member account.
detectorId
This property is required.
Changes to this property will trigger replacement.
string
The detector ID of the GuardDuty account where you want to create member accounts.
email
This property is required.
Changes to this property will trigger replacement.
string
Email address for member account.
disableEmailNotification Changes to this property will trigger replacement. boolean
Boolean whether an email notification is sent to the accounts. Defaults to false.
invitationMessage Changes to this property will trigger replacement. string
Message for invitation.
invite boolean
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
account_id
This property is required.
Changes to this property will trigger replacement.
str
AWS account ID for member account.
detector_id
This property is required.
Changes to this property will trigger replacement.
str
The detector ID of the GuardDuty account where you want to create member accounts.
email
This property is required.
Changes to this property will trigger replacement.
str
Email address for member account.
disable_email_notification Changes to this property will trigger replacement. bool
Boolean whether an email notification is sent to the accounts. Defaults to false.
invitation_message Changes to this property will trigger replacement. str
Message for invitation.
invite bool
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
accountId
This property is required.
Changes to this property will trigger replacement.
String
AWS account ID for member account.
detectorId
This property is required.
Changes to this property will trigger replacement.
String
The detector ID of the GuardDuty account where you want to create member accounts.
email
This property is required.
Changes to this property will trigger replacement.
String
Email address for member account.
disableEmailNotification Changes to this property will trigger replacement. Boolean
Boolean whether an email notification is sent to the accounts. Defaults to false.
invitationMessage Changes to this property will trigger replacement. String
Message for invitation.
invite Boolean
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.

Outputs

All input properties are implicitly available as output properties. Additionally, the Member resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
RelationshipStatus string
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
Id string
The provider-assigned unique ID for this managed resource.
RelationshipStatus string
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
id String
The provider-assigned unique ID for this managed resource.
relationshipStatus String
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
id string
The provider-assigned unique ID for this managed resource.
relationshipStatus string
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
id str
The provider-assigned unique ID for this managed resource.
relationship_status str
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
id String
The provider-assigned unique ID for this managed resource.
relationshipStatus String
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.

Look up Existing Member Resource

Get an existing Member resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MemberState, opts?: CustomResourceOptions): Member
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        detector_id: Optional[str] = None,
        disable_email_notification: Optional[bool] = None,
        email: Optional[str] = None,
        invitation_message: Optional[str] = None,
        invite: Optional[bool] = None,
        relationship_status: Optional[str] = None) -> Member
func GetMember(ctx *Context, name string, id IDInput, state *MemberState, opts ...ResourceOption) (*Member, error)
public static Member Get(string name, Input<string> id, MemberState? state, CustomResourceOptions? opts = null)
public static Member get(String name, Output<String> id, MemberState state, CustomResourceOptions options)
resources:  _:    type: aws:guardduty:Member    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId Changes to this property will trigger replacement. string
AWS account ID for member account.
DetectorId Changes to this property will trigger replacement. string
The detector ID of the GuardDuty account where you want to create member accounts.
DisableEmailNotification Changes to this property will trigger replacement. bool
Boolean whether an email notification is sent to the accounts. Defaults to false.
Email Changes to this property will trigger replacement. string
Email address for member account.
InvitationMessage Changes to this property will trigger replacement. string
Message for invitation.
Invite bool
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
RelationshipStatus string
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
AccountId Changes to this property will trigger replacement. string
AWS account ID for member account.
DetectorId Changes to this property will trigger replacement. string
The detector ID of the GuardDuty account where you want to create member accounts.
DisableEmailNotification Changes to this property will trigger replacement. bool
Boolean whether an email notification is sent to the accounts. Defaults to false.
Email Changes to this property will trigger replacement. string
Email address for member account.
InvitationMessage Changes to this property will trigger replacement. string
Message for invitation.
Invite bool
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
RelationshipStatus string
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
accountId Changes to this property will trigger replacement. String
AWS account ID for member account.
detectorId Changes to this property will trigger replacement. String
The detector ID of the GuardDuty account where you want to create member accounts.
disableEmailNotification Changes to this property will trigger replacement. Boolean
Boolean whether an email notification is sent to the accounts. Defaults to false.
email Changes to this property will trigger replacement. String
Email address for member account.
invitationMessage Changes to this property will trigger replacement. String
Message for invitation.
invite Boolean
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
relationshipStatus String
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
accountId Changes to this property will trigger replacement. string
AWS account ID for member account.
detectorId Changes to this property will trigger replacement. string
The detector ID of the GuardDuty account where you want to create member accounts.
disableEmailNotification Changes to this property will trigger replacement. boolean
Boolean whether an email notification is sent to the accounts. Defaults to false.
email Changes to this property will trigger replacement. string
Email address for member account.
invitationMessage Changes to this property will trigger replacement. string
Message for invitation.
invite boolean
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
relationshipStatus string
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
account_id Changes to this property will trigger replacement. str
AWS account ID for member account.
detector_id Changes to this property will trigger replacement. str
The detector ID of the GuardDuty account where you want to create member accounts.
disable_email_notification Changes to this property will trigger replacement. bool
Boolean whether an email notification is sent to the accounts. Defaults to false.
email Changes to this property will trigger replacement. str
Email address for member account.
invitation_message Changes to this property will trigger replacement. str
Message for invitation.
invite bool
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
relationship_status str
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.
accountId Changes to this property will trigger replacement. String
AWS account ID for member account.
detectorId Changes to this property will trigger replacement. String
The detector ID of the GuardDuty account where you want to create member accounts.
disableEmailNotification Changes to this property will trigger replacement. Boolean
Boolean whether an email notification is sent to the accounts. Defaults to false.
email Changes to this property will trigger replacement. String
Email address for member account.
invitationMessage Changes to this property will trigger replacement. String
Message for invitation.
invite Boolean
Boolean whether to invite the account to GuardDuty as a member. Defaults to false. To detect if an invitation needs to be (re-)sent, the this provider state value is true based on a relationship_status of Disabled, Enabled, Invited, or EmailVerificationInProgress.
relationshipStatus String
The status of the relationship between the member account and its primary account. More information can be found in Amazon GuardDuty API Reference.

Import

Using pulumi import, import GuardDuty members using the primary GuardDuty detector ID and member AWS account ID. For example:

$ pulumi import aws:guardduty/member:Member MyMember 00b00fd5aecc0ab60a708659477e9617:123456789012
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.