1. Packages
  2. AWS Classic
  3. API Docs
  4. guardduty
  5. InviteAccepter

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.0 published on Monday, Apr 15, 2024 by Pulumi

aws.guardduty.InviteAccepter

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.0 published on Monday, Apr 15, 2024 by Pulumi

    Provides a resource to accept a pending GuardDuty invite on creation, ensure the detector has the correct primary account on read, and disassociate with the primary account upon removal.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const primary = new aws.guardduty.Detector("primary", {});
    const memberDetector = new aws.guardduty.Detector("member", {});
    const memberMember = new aws.guardduty.Member("member", {
        accountId: memberDetector.accountId,
        detectorId: primary.id,
        email: "required@example.com",
        invite: true,
    });
    const member = new aws.guardduty.InviteAccepter("member", {
        detectorId: memberDetector.id,
        masterAccountId: primary.accountId,
    }, {
        dependsOn: [memberMember],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    primary = aws.guardduty.Detector("primary")
    member_detector = aws.guardduty.Detector("member")
    member_member = aws.guardduty.Member("member",
        account_id=member_detector.account_id,
        detector_id=primary.id,
        email="required@example.com",
        invite=True)
    member = aws.guardduty.InviteAccepter("member",
        detector_id=member_detector.id,
        master_account_id=primary.account_id,
        opts=pulumi.ResourceOptions(depends_on=[member_member]))
    
    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", nil)
    		if err != nil {
    			return err
    		}
    		memberDetector, err := guardduty.NewDetector(ctx, "member", nil)
    		if err != nil {
    			return err
    		}
    		memberMember, err := guardduty.NewMember(ctx, "member", &guardduty.MemberArgs{
    			AccountId:  memberDetector.AccountId,
    			DetectorId: primary.ID(),
    			Email:      pulumi.String("required@example.com"),
    			Invite:     pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = guardduty.NewInviteAccepter(ctx, "member", &guardduty.InviteAccepterArgs{
    			DetectorId:      memberDetector.ID(),
    			MasterAccountId: primary.AccountId,
    		}, pulumi.DependsOn([]pulumi.Resource{
    			memberMember,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var primary = new Aws.GuardDuty.Detector("primary");
    
        var memberDetector = new Aws.GuardDuty.Detector("member");
    
        var memberMember = new Aws.GuardDuty.Member("member", new()
        {
            AccountId = memberDetector.AccountId,
            DetectorId = primary.Id,
            Email = "required@example.com",
            Invite = true,
        });
    
        var member = new Aws.GuardDuty.InviteAccepter("member", new()
        {
            DetectorId = memberDetector.Id,
            MasterAccountId = primary.AccountId,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                memberMember, 
            },
        });
    
    });
    
    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.Member;
    import com.pulumi.aws.guardduty.MemberArgs;
    import com.pulumi.aws.guardduty.InviteAccepter;
    import com.pulumi.aws.guardduty.InviteAccepterArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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");
    
            var memberDetector = new Detector("memberDetector");
    
            var memberMember = new Member("memberMember", MemberArgs.builder()        
                .accountId(memberDetector.accountId())
                .detectorId(primary.id())
                .email("required@example.com")
                .invite(true)
                .build());
    
            var member = new InviteAccepter("member", InviteAccepterArgs.builder()        
                .detectorId(memberDetector.id())
                .masterAccountId(primary.accountId())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(memberMember)
                    .build());
    
        }
    }
    
    resources:
      member:
        type: aws:guardduty:InviteAccepter
        properties:
          detectorId: ${memberDetector.id}
          masterAccountId: ${primary.accountId}
        options:
          dependson:
            - ${memberMember}
      memberMember:
        type: aws:guardduty:Member
        name: member
        properties:
          accountId: ${memberDetector.accountId}
          detectorId: ${primary.id}
          email: required@example.com
          invite: true
      primary:
        type: aws:guardduty:Detector
      memberDetector:
        type: aws:guardduty:Detector
        name: member
    

    Create InviteAccepter Resource

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

    Constructor syntax

    new InviteAccepter(name: string, args: InviteAccepterArgs, opts?: CustomResourceOptions);
    @overload
    def InviteAccepter(resource_name: str,
                       args: InviteAccepterArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def InviteAccepter(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       detector_id: Optional[str] = None,
                       master_account_id: Optional[str] = None)
    func NewInviteAccepter(ctx *Context, name string, args InviteAccepterArgs, opts ...ResourceOption) (*InviteAccepter, error)
    public InviteAccepter(string name, InviteAccepterArgs args, CustomResourceOptions? opts = null)
    public InviteAccepter(String name, InviteAccepterArgs args)
    public InviteAccepter(String name, InviteAccepterArgs args, CustomResourceOptions options)
    
    type: aws:guardduty:InviteAccepter
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Example

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

    var inviteAccepterResource = new Aws.GuardDuty.InviteAccepter("inviteAccepterResource", new()
    {
        DetectorId = "string",
        MasterAccountId = "string",
    });
    
    example, err := guardduty.NewInviteAccepter(ctx, "inviteAccepterResource", &guardduty.InviteAccepterArgs{
    	DetectorId:      pulumi.String("string"),
    	MasterAccountId: pulumi.String("string"),
    })
    
    var inviteAccepterResource = new InviteAccepter("inviteAccepterResource", InviteAccepterArgs.builder()        
        .detectorId("string")
        .masterAccountId("string")
        .build());
    
    invite_accepter_resource = aws.guardduty.InviteAccepter("inviteAccepterResource",
        detector_id="string",
        master_account_id="string")
    
    const inviteAccepterResource = new aws.guardduty.InviteAccepter("inviteAccepterResource", {
        detectorId: "string",
        masterAccountId: "string",
    });
    
    type: aws:guardduty:InviteAccepter
    properties:
        detectorId: string
        masterAccountId: string
    

    InviteAccepter Resource Properties

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

    Inputs

    The InviteAccepter resource accepts the following input properties:

    DetectorId string
    The detector ID of the member GuardDuty account.
    MasterAccountId string
    AWS account ID for primary account.
    DetectorId string
    The detector ID of the member GuardDuty account.
    MasterAccountId string
    AWS account ID for primary account.
    detectorId String
    The detector ID of the member GuardDuty account.
    masterAccountId String
    AWS account ID for primary account.
    detectorId string
    The detector ID of the member GuardDuty account.
    masterAccountId string
    AWS account ID for primary account.
    detector_id str
    The detector ID of the member GuardDuty account.
    master_account_id str
    AWS account ID for primary account.
    detectorId String
    The detector ID of the member GuardDuty account.
    masterAccountId String
    AWS account ID for primary account.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing InviteAccepter Resource

    Get an existing InviteAccepter 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?: InviteAccepterState, opts?: CustomResourceOptions): InviteAccepter
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            detector_id: Optional[str] = None,
            master_account_id: Optional[str] = None) -> InviteAccepter
    func GetInviteAccepter(ctx *Context, name string, id IDInput, state *InviteAccepterState, opts ...ResourceOption) (*InviteAccepter, error)
    public static InviteAccepter Get(string name, Input<string> id, InviteAccepterState? state, CustomResourceOptions? opts = null)
    public static InviteAccepter get(String name, Output<String> id, InviteAccepterState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    DetectorId string
    The detector ID of the member GuardDuty account.
    MasterAccountId string
    AWS account ID for primary account.
    DetectorId string
    The detector ID of the member GuardDuty account.
    MasterAccountId string
    AWS account ID for primary account.
    detectorId String
    The detector ID of the member GuardDuty account.
    masterAccountId String
    AWS account ID for primary account.
    detectorId string
    The detector ID of the member GuardDuty account.
    masterAccountId string
    AWS account ID for primary account.
    detector_id str
    The detector ID of the member GuardDuty account.
    master_account_id str
    AWS account ID for primary account.
    detectorId String
    The detector ID of the member GuardDuty account.
    masterAccountId String
    AWS account ID for primary account.

    Import

    Using pulumi import, import aws_guardduty_invite_accepter using the member GuardDuty detector ID. For example:

    $ pulumi import aws:guardduty/inviteAccepter:InviteAccepter member 00b00fd5aecc0ab60a708659477e9617
    

    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.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.0 published on Monday, Apr 15, 2024 by Pulumi