github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/detective/member.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package detective
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a resource to manage an [Amazon Detective Member](https://docs.aws.amazon.com/detective/latest/APIReference/API_CreateMembers.html).
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/detective"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			example, err := detective.NewGraph(ctx, "example", nil)
    33  //			if err != nil {
    34  //				return err
    35  //			}
    36  //			_, err = detective.NewMember(ctx, "example", &detective.MemberArgs{
    37  //				AccountId:                pulumi.String("AWS ACCOUNT ID"),
    38  //				EmailAddress:             pulumi.String("EMAIL"),
    39  //				GraphArn:                 example.ID(),
    40  //				Message:                  pulumi.String("Message of the invitation"),
    41  //				DisableEmailNotification: pulumi.Bool(true),
    42  //			})
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ## Import
    54  //
    55  // Using `pulumi import`, import `aws_detective_member` using the ARN of the graph followed by the account ID of the member account. For example:
    56  //
    57  // ```sh
    58  // $ pulumi import aws:detective/member:Member example arn:aws:detective:us-east-1:123456789101:graph:231684d34gh74g4bae1dbc7bd807d02d/123456789012
    59  // ```
    60  type Member struct {
    61  	pulumi.CustomResourceState
    62  
    63  	// AWS account ID for the account.
    64  	AccountId pulumi.StringOutput `pulumi:"accountId"`
    65  	// AWS account ID for the administrator account.
    66  	AdministratorId pulumi.StringOutput `pulumi:"administratorId"`
    67  	// If set to true, then the root user of the invited account will _not_ receive an email notification. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. By default, this is set to `false`.
    68  	DisableEmailNotification pulumi.BoolPtrOutput `pulumi:"disableEmailNotification"`
    69  	DisabledReason           pulumi.StringOutput  `pulumi:"disabledReason"`
    70  	// Email address for the account.
    71  	EmailAddress pulumi.StringOutput `pulumi:"emailAddress"`
    72  	// ARN of the behavior graph to invite the member accounts to contribute their data to.
    73  	GraphArn pulumi.StringOutput `pulumi:"graphArn"`
    74  	// Date and time, in UTC and extended RFC 3339 format, when an Amazon Detective membership invitation was last sent to the account.
    75  	InvitedTime pulumi.StringOutput `pulumi:"invitedTime"`
    76  	// A custom message to include in the invitation. Amazon Detective adds this message to the standard content that it sends for an invitation.
    77  	Message pulumi.StringPtrOutput `pulumi:"message"`
    78  	// Current membership status of the member account.
    79  	Status pulumi.StringOutput `pulumi:"status"`
    80  	// Date and time, in UTC and extended RFC 3339 format, of the most recent change to the member account's status.
    81  	UpdatedTime pulumi.StringOutput `pulumi:"updatedTime"`
    82  	// Data volume in bytes per day for the member account.
    83  	VolumeUsageInBytes pulumi.StringOutput `pulumi:"volumeUsageInBytes"`
    84  }
    85  
    86  // NewMember registers a new resource with the given unique name, arguments, and options.
    87  func NewMember(ctx *pulumi.Context,
    88  	name string, args *MemberArgs, opts ...pulumi.ResourceOption) (*Member, error) {
    89  	if args == nil {
    90  		return nil, errors.New("missing one or more required arguments")
    91  	}
    92  
    93  	if args.AccountId == nil {
    94  		return nil, errors.New("invalid value for required argument 'AccountId'")
    95  	}
    96  	if args.EmailAddress == nil {
    97  		return nil, errors.New("invalid value for required argument 'EmailAddress'")
    98  	}
    99  	if args.GraphArn == nil {
   100  		return nil, errors.New("invalid value for required argument 'GraphArn'")
   101  	}
   102  	opts = internal.PkgResourceDefaultOpts(opts)
   103  	var resource Member
   104  	err := ctx.RegisterResource("aws:detective/member:Member", name, args, &resource, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return &resource, nil
   109  }
   110  
   111  // GetMember gets an existing Member resource's state with the given name, ID, and optional
   112  // state properties that are used to uniquely qualify the lookup (nil if not required).
   113  func GetMember(ctx *pulumi.Context,
   114  	name string, id pulumi.IDInput, state *MemberState, opts ...pulumi.ResourceOption) (*Member, error) {
   115  	var resource Member
   116  	err := ctx.ReadResource("aws:detective/member:Member", name, id, state, &resource, opts...)
   117  	if err != nil {
   118  		return nil, err
   119  	}
   120  	return &resource, nil
   121  }
   122  
   123  // Input properties used for looking up and filtering Member resources.
   124  type memberState struct {
   125  	// AWS account ID for the account.
   126  	AccountId *string `pulumi:"accountId"`
   127  	// AWS account ID for the administrator account.
   128  	AdministratorId *string `pulumi:"administratorId"`
   129  	// If set to true, then the root user of the invited account will _not_ receive an email notification. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. By default, this is set to `false`.
   130  	DisableEmailNotification *bool   `pulumi:"disableEmailNotification"`
   131  	DisabledReason           *string `pulumi:"disabledReason"`
   132  	// Email address for the account.
   133  	EmailAddress *string `pulumi:"emailAddress"`
   134  	// ARN of the behavior graph to invite the member accounts to contribute their data to.
   135  	GraphArn *string `pulumi:"graphArn"`
   136  	// Date and time, in UTC and extended RFC 3339 format, when an Amazon Detective membership invitation was last sent to the account.
   137  	InvitedTime *string `pulumi:"invitedTime"`
   138  	// A custom message to include in the invitation. Amazon Detective adds this message to the standard content that it sends for an invitation.
   139  	Message *string `pulumi:"message"`
   140  	// Current membership status of the member account.
   141  	Status *string `pulumi:"status"`
   142  	// Date and time, in UTC and extended RFC 3339 format, of the most recent change to the member account's status.
   143  	UpdatedTime *string `pulumi:"updatedTime"`
   144  	// Data volume in bytes per day for the member account.
   145  	VolumeUsageInBytes *string `pulumi:"volumeUsageInBytes"`
   146  }
   147  
   148  type MemberState struct {
   149  	// AWS account ID for the account.
   150  	AccountId pulumi.StringPtrInput
   151  	// AWS account ID for the administrator account.
   152  	AdministratorId pulumi.StringPtrInput
   153  	// If set to true, then the root user of the invited account will _not_ receive an email notification. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. By default, this is set to `false`.
   154  	DisableEmailNotification pulumi.BoolPtrInput
   155  	DisabledReason           pulumi.StringPtrInput
   156  	// Email address for the account.
   157  	EmailAddress pulumi.StringPtrInput
   158  	// ARN of the behavior graph to invite the member accounts to contribute their data to.
   159  	GraphArn pulumi.StringPtrInput
   160  	// Date and time, in UTC and extended RFC 3339 format, when an Amazon Detective membership invitation was last sent to the account.
   161  	InvitedTime pulumi.StringPtrInput
   162  	// A custom message to include in the invitation. Amazon Detective adds this message to the standard content that it sends for an invitation.
   163  	Message pulumi.StringPtrInput
   164  	// Current membership status of the member account.
   165  	Status pulumi.StringPtrInput
   166  	// Date and time, in UTC and extended RFC 3339 format, of the most recent change to the member account's status.
   167  	UpdatedTime pulumi.StringPtrInput
   168  	// Data volume in bytes per day for the member account.
   169  	VolumeUsageInBytes pulumi.StringPtrInput
   170  }
   171  
   172  func (MemberState) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*memberState)(nil)).Elem()
   174  }
   175  
   176  type memberArgs struct {
   177  	// AWS account ID for the account.
   178  	AccountId string `pulumi:"accountId"`
   179  	// If set to true, then the root user of the invited account will _not_ receive an email notification. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. By default, this is set to `false`.
   180  	DisableEmailNotification *bool `pulumi:"disableEmailNotification"`
   181  	// Email address for the account.
   182  	EmailAddress string `pulumi:"emailAddress"`
   183  	// ARN of the behavior graph to invite the member accounts to contribute their data to.
   184  	GraphArn string `pulumi:"graphArn"`
   185  	// A custom message to include in the invitation. Amazon Detective adds this message to the standard content that it sends for an invitation.
   186  	Message *string `pulumi:"message"`
   187  }
   188  
   189  // The set of arguments for constructing a Member resource.
   190  type MemberArgs struct {
   191  	// AWS account ID for the account.
   192  	AccountId pulumi.StringInput
   193  	// If set to true, then the root user of the invited account will _not_ receive an email notification. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. By default, this is set to `false`.
   194  	DisableEmailNotification pulumi.BoolPtrInput
   195  	// Email address for the account.
   196  	EmailAddress pulumi.StringInput
   197  	// ARN of the behavior graph to invite the member accounts to contribute their data to.
   198  	GraphArn pulumi.StringInput
   199  	// A custom message to include in the invitation. Amazon Detective adds this message to the standard content that it sends for an invitation.
   200  	Message pulumi.StringPtrInput
   201  }
   202  
   203  func (MemberArgs) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*memberArgs)(nil)).Elem()
   205  }
   206  
   207  type MemberInput interface {
   208  	pulumi.Input
   209  
   210  	ToMemberOutput() MemberOutput
   211  	ToMemberOutputWithContext(ctx context.Context) MemberOutput
   212  }
   213  
   214  func (*Member) ElementType() reflect.Type {
   215  	return reflect.TypeOf((**Member)(nil)).Elem()
   216  }
   217  
   218  func (i *Member) ToMemberOutput() MemberOutput {
   219  	return i.ToMemberOutputWithContext(context.Background())
   220  }
   221  
   222  func (i *Member) ToMemberOutputWithContext(ctx context.Context) MemberOutput {
   223  	return pulumi.ToOutputWithContext(ctx, i).(MemberOutput)
   224  }
   225  
   226  // MemberArrayInput is an input type that accepts MemberArray and MemberArrayOutput values.
   227  // You can construct a concrete instance of `MemberArrayInput` via:
   228  //
   229  //	MemberArray{ MemberArgs{...} }
   230  type MemberArrayInput interface {
   231  	pulumi.Input
   232  
   233  	ToMemberArrayOutput() MemberArrayOutput
   234  	ToMemberArrayOutputWithContext(context.Context) MemberArrayOutput
   235  }
   236  
   237  type MemberArray []MemberInput
   238  
   239  func (MemberArray) ElementType() reflect.Type {
   240  	return reflect.TypeOf((*[]*Member)(nil)).Elem()
   241  }
   242  
   243  func (i MemberArray) ToMemberArrayOutput() MemberArrayOutput {
   244  	return i.ToMemberArrayOutputWithContext(context.Background())
   245  }
   246  
   247  func (i MemberArray) ToMemberArrayOutputWithContext(ctx context.Context) MemberArrayOutput {
   248  	return pulumi.ToOutputWithContext(ctx, i).(MemberArrayOutput)
   249  }
   250  
   251  // MemberMapInput is an input type that accepts MemberMap and MemberMapOutput values.
   252  // You can construct a concrete instance of `MemberMapInput` via:
   253  //
   254  //	MemberMap{ "key": MemberArgs{...} }
   255  type MemberMapInput interface {
   256  	pulumi.Input
   257  
   258  	ToMemberMapOutput() MemberMapOutput
   259  	ToMemberMapOutputWithContext(context.Context) MemberMapOutput
   260  }
   261  
   262  type MemberMap map[string]MemberInput
   263  
   264  func (MemberMap) ElementType() reflect.Type {
   265  	return reflect.TypeOf((*map[string]*Member)(nil)).Elem()
   266  }
   267  
   268  func (i MemberMap) ToMemberMapOutput() MemberMapOutput {
   269  	return i.ToMemberMapOutputWithContext(context.Background())
   270  }
   271  
   272  func (i MemberMap) ToMemberMapOutputWithContext(ctx context.Context) MemberMapOutput {
   273  	return pulumi.ToOutputWithContext(ctx, i).(MemberMapOutput)
   274  }
   275  
   276  type MemberOutput struct{ *pulumi.OutputState }
   277  
   278  func (MemberOutput) ElementType() reflect.Type {
   279  	return reflect.TypeOf((**Member)(nil)).Elem()
   280  }
   281  
   282  func (o MemberOutput) ToMemberOutput() MemberOutput {
   283  	return o
   284  }
   285  
   286  func (o MemberOutput) ToMemberOutputWithContext(ctx context.Context) MemberOutput {
   287  	return o
   288  }
   289  
   290  // AWS account ID for the account.
   291  func (o MemberOutput) AccountId() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput)
   293  }
   294  
   295  // AWS account ID for the administrator account.
   296  func (o MemberOutput) AdministratorId() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.AdministratorId }).(pulumi.StringOutput)
   298  }
   299  
   300  // If set to true, then the root user of the invited account will _not_ receive an email notification. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. By default, this is set to `false`.
   301  func (o MemberOutput) DisableEmailNotification() pulumi.BoolPtrOutput {
   302  	return o.ApplyT(func(v *Member) pulumi.BoolPtrOutput { return v.DisableEmailNotification }).(pulumi.BoolPtrOutput)
   303  }
   304  
   305  func (o MemberOutput) DisabledReason() pulumi.StringOutput {
   306  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.DisabledReason }).(pulumi.StringOutput)
   307  }
   308  
   309  // Email address for the account.
   310  func (o MemberOutput) EmailAddress() pulumi.StringOutput {
   311  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.EmailAddress }).(pulumi.StringOutput)
   312  }
   313  
   314  // ARN of the behavior graph to invite the member accounts to contribute their data to.
   315  func (o MemberOutput) GraphArn() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.GraphArn }).(pulumi.StringOutput)
   317  }
   318  
   319  // Date and time, in UTC and extended RFC 3339 format, when an Amazon Detective membership invitation was last sent to the account.
   320  func (o MemberOutput) InvitedTime() pulumi.StringOutput {
   321  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.InvitedTime }).(pulumi.StringOutput)
   322  }
   323  
   324  // A custom message to include in the invitation. Amazon Detective adds this message to the standard content that it sends for an invitation.
   325  func (o MemberOutput) Message() pulumi.StringPtrOutput {
   326  	return o.ApplyT(func(v *Member) pulumi.StringPtrOutput { return v.Message }).(pulumi.StringPtrOutput)
   327  }
   328  
   329  // Current membership status of the member account.
   330  func (o MemberOutput) Status() pulumi.StringOutput {
   331  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   332  }
   333  
   334  // Date and time, in UTC and extended RFC 3339 format, of the most recent change to the member account's status.
   335  func (o MemberOutput) UpdatedTime() pulumi.StringOutput {
   336  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.UpdatedTime }).(pulumi.StringOutput)
   337  }
   338  
   339  // Data volume in bytes per day for the member account.
   340  func (o MemberOutput) VolumeUsageInBytes() pulumi.StringOutput {
   341  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.VolumeUsageInBytes }).(pulumi.StringOutput)
   342  }
   343  
   344  type MemberArrayOutput struct{ *pulumi.OutputState }
   345  
   346  func (MemberArrayOutput) ElementType() reflect.Type {
   347  	return reflect.TypeOf((*[]*Member)(nil)).Elem()
   348  }
   349  
   350  func (o MemberArrayOutput) ToMemberArrayOutput() MemberArrayOutput {
   351  	return o
   352  }
   353  
   354  func (o MemberArrayOutput) ToMemberArrayOutputWithContext(ctx context.Context) MemberArrayOutput {
   355  	return o
   356  }
   357  
   358  func (o MemberArrayOutput) Index(i pulumi.IntInput) MemberOutput {
   359  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Member {
   360  		return vs[0].([]*Member)[vs[1].(int)]
   361  	}).(MemberOutput)
   362  }
   363  
   364  type MemberMapOutput struct{ *pulumi.OutputState }
   365  
   366  func (MemberMapOutput) ElementType() reflect.Type {
   367  	return reflect.TypeOf((*map[string]*Member)(nil)).Elem()
   368  }
   369  
   370  func (o MemberMapOutput) ToMemberMapOutput() MemberMapOutput {
   371  	return o
   372  }
   373  
   374  func (o MemberMapOutput) ToMemberMapOutputWithContext(ctx context.Context) MemberMapOutput {
   375  	return o
   376  }
   377  
   378  func (o MemberMapOutput) MapIndex(k pulumi.StringInput) MemberOutput {
   379  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Member {
   380  		return vs[0].(map[string]*Member)[vs[1].(string)]
   381  	}).(MemberOutput)
   382  }
   383  
   384  func init() {
   385  	pulumi.RegisterInputType(reflect.TypeOf((*MemberInput)(nil)).Elem(), &Member{})
   386  	pulumi.RegisterInputType(reflect.TypeOf((*MemberArrayInput)(nil)).Elem(), MemberArray{})
   387  	pulumi.RegisterInputType(reflect.TypeOf((*MemberMapInput)(nil)).Elem(), MemberMap{})
   388  	pulumi.RegisterOutputType(MemberOutput{})
   389  	pulumi.RegisterOutputType(MemberArrayOutput{})
   390  	pulumi.RegisterOutputType(MemberMapOutput{})
   391  }