InviteAccepter
Provides a resource to accept a pending GuardDuty invite on creation, ensure the detector has the correct master account on read, and disassociate with the master account upon removal.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var master = new Aws.GuardDuty.Detector("master", new Aws.GuardDuty.DetectorArgs
{
});
var memberDetector = new Aws.GuardDuty.Detector("memberDetector", new Aws.GuardDuty.DetectorArgs
{
}, new CustomResourceOptions
{
Provider = "aws.dev",
});
var dev = new Aws.GuardDuty.Member("dev", new Aws.GuardDuty.MemberArgs
{
AccountId = memberDetector.AccountId,
DetectorId = master.Id,
Email = "required@example.com",
Invite = true,
});
var memberInviteAccepter = new Aws.GuardDuty.InviteAccepter("memberInviteAccepter", new Aws.GuardDuty.InviteAccepterArgs
{
DetectorId = memberDetector.Id,
MasterAccountId = master.AccountId,
}, new CustomResourceOptions
{
Provider = "aws.dev",
DependsOn =
{
"aws_guardduty_member.dev",
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/guardduty"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
master, err := guardduty.NewDetector(ctx, "master", nil)
if err != nil {
return err
}
memberDetector, err := guardduty.NewDetector(ctx, "memberDetector", nil, pulumi.Provider("aws.dev"))
if err != nil {
return err
}
_, err = guardduty.NewMember(ctx, "dev", &guardduty.MemberArgs{
AccountId: memberDetector.AccountId,
DetectorId: master.ID(),
Email: pulumi.String("required@example.com"),
Invite: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = guardduty.NewInviteAccepter(ctx, "memberInviteAccepter", &guardduty.InviteAccepterArgs{
DetectorId: memberDetector.ID(),
MasterAccountId: master.AccountId,
}, pulumi.Provider("aws.dev"), pulumi.DependsOn([]pulumi.Resource{
"aws_guardduty_member.dev",
}))
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
master = aws.guardduty.Detector("master")
member_detector = aws.guardduty.Detector("memberDetector", opts=ResourceOptions(provider="aws.dev"))
dev = aws.guardduty.Member("dev",
account_id=member_detector.account_id,
detector_id=master.id,
email="required@example.com",
invite=True)
member_invite_accepter = aws.guardduty.InviteAccepter("memberInviteAccepter",
detector_id=member_detector.id,
master_account_id=master.account_id,
opts=ResourceOptions(provider="aws.dev",
depends_on=["aws_guardduty_member.dev"]))import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const master = new aws.guardduty.Detector("master", {});
const memberDetector = new aws.guardduty.Detector("memberDetector", {}, {
provider: "aws.dev",
});
const dev = new aws.guardduty.Member("dev", {
accountId: memberDetector.accountId,
detectorId: master.id,
email: "required@example.com",
invite: true,
});
const memberInviteAccepter = new aws.guardduty.InviteAccepter("memberInviteAccepter", {
detectorId: memberDetector.id,
masterAccountId: master.accountId,
}, {
provider: "aws.dev",
dependsOn: ["aws_guardduty_member.dev"],
});Create a InviteAccepter Resource
new InviteAccepter(name: string, args: InviteAccepterArgs, opts?: CustomResourceOptions);def InviteAccepter(resource_name, opts=None, detector_id=None, master_account_id=None, __props__=None);func NewInviteAccepter(ctx *Context, name string, args InviteAccepterArgs, opts ...ResourceOption) (*InviteAccepter, error)public InviteAccepter(string name, InviteAccepterArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
InviteAccepter Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The InviteAccepter resource accepts the following input properties:
- Detector
Id string The detector ID of the member GuardDuty account.
- Master
Account stringId AWS account ID for master account.
- Detector
Id string The detector ID of the member GuardDuty account.
- Master
Account stringId AWS account ID for master account.
- detector
Id string The detector ID of the member GuardDuty account.
- master
Account stringId AWS account ID for master account.
- detector_
id str The detector ID of the member GuardDuty account.
- master_
account_ strid AWS account ID for master account.
Outputs
All input properties are implicitly available as output properties. Additionally, the InviteAccepter resource produces the following output properties:
Look up an 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): InviteAccepterstatic get(resource_name, id, opts=None, detector_id=None, master_account_id=None, __props__=None);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)- 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.
The following state arguments are supported:
- Detector
Id string The detector ID of the member GuardDuty account.
- Master
Account stringId AWS account ID for master account.
- Detector
Id string The detector ID of the member GuardDuty account.
- Master
Account stringId AWS account ID for master account.
- detector
Id string The detector ID of the member GuardDuty account.
- master
Account stringId AWS account ID for master account.
- detector_
id str The detector ID of the member GuardDuty account.
- master_
account_ strid AWS account ID for master account.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.