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 v5.41.0 published on Monday, May 15, 2023 by Pulumi

aws.guardduty.InviteAccepter

Explore with Pulumi AI

aws logo

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

AWS Classic v5.41.0 published on Monday, May 15, 2023 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

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

    Create InviteAccepter Resource

    new InviteAccepter(name: string, args: InviteAccepterArgs, opts?: CustomResourceOptions);
    @overload
    def InviteAccepter(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       detector_id: Optional[str] = None,
                       master_account_id: Optional[str] = None)
    @overload
    def InviteAccepter(resource_name: str,
                       args: InviteAccepterArgs,
                       opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    aws_guardduty_invite_accepter can be imported using the member GuardDuty detector ID, e.g.,

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

    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 v5.41.0 published on Monday, May 15, 2023 by Pulumi