github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/macie2/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 macie2
     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 Macie Member](https://docs.aws.amazon.com/macie/latest/APIReference/members-id.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/macie2"
    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 := macie2.NewAccount(ctx, "example", nil)
    33  //			if err != nil {
    34  //				return err
    35  //			}
    36  //			_, err = macie2.NewMember(ctx, "example", &macie2.MemberArgs{
    37  //				AccountId:                          pulumi.String("AWS ACCOUNT ID"),
    38  //				Email:                              pulumi.String("EMAIL"),
    39  //				Invite:                             pulumi.Bool(true),
    40  //				InvitationMessage:                  pulumi.String("Message of the invitation"),
    41  //				InvitationDisableEmailNotification: pulumi.Bool(true),
    42  //			}, pulumi.DependsOn([]pulumi.Resource{
    43  //				example,
    44  //			}))
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ## Import
    56  //
    57  // Using `pulumi import`, import `aws_macie2_member` using the account ID of the member account. For example:
    58  //
    59  // ```sh
    60  // $ pulumi import aws:macie2/member:Member example 123456789012
    61  // ```
    62  type Member struct {
    63  	pulumi.CustomResourceState
    64  
    65  	// The AWS account ID for the account.
    66  	AccountId pulumi.StringOutput `pulumi:"accountId"`
    67  	// The AWS account ID for the administrator account.
    68  	AdministratorAccountId pulumi.StringOutput `pulumi:"administratorAccountId"`
    69  	// The Amazon Resource Name (ARN) of the account.
    70  	Arn pulumi.StringOutput `pulumi:"arn"`
    71  	// The email address for the account.
    72  	Email pulumi.StringOutput `pulumi:"email"`
    73  	// Specifies whether to send an email notification to the root user of each account that the invitation will be sent to. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. To send an email notification to the root user of each account, set this value to `true`.
    74  	InvitationDisableEmailNotification pulumi.BoolPtrOutput `pulumi:"invitationDisableEmailNotification"`
    75  	// A custom message to include in the invitation. Amazon Macie adds this message to the standard content that it sends for an invitation.
    76  	InvitationMessage pulumi.StringPtrOutput `pulumi:"invitationMessage"`
    77  	// Send an invitation to a member
    78  	Invite pulumi.BoolOutput `pulumi:"invite"`
    79  	// The date and time, in UTC and extended RFC 3339 format, when an Amazon Macie membership invitation was last sent to the account. This value is null if a Macie invitation hasn't been sent to the account.
    80  	InvitedAt       pulumi.StringOutput `pulumi:"invitedAt"`
    81  	MasterAccountId pulumi.StringOutput `pulumi:"masterAccountId"`
    82  	// The current status of the relationship between the account and the administrator account.
    83  	RelationshipStatus pulumi.StringOutput `pulumi:"relationshipStatus"`
    84  	// Specifies the status for the account. To enable Amazon Macie and start all Macie activities for the account, set this value to `ENABLED`. Valid values are `ENABLED` or `PAUSED`.
    85  	Status pulumi.StringOutput `pulumi:"status"`
    86  	// A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.
    87  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    88  	// Deprecated: Please use `tags` instead.
    89  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    90  	// The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the relationship between the account and the administrator account.
    91  	UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
    92  }
    93  
    94  // NewMember registers a new resource with the given unique name, arguments, and options.
    95  func NewMember(ctx *pulumi.Context,
    96  	name string, args *MemberArgs, opts ...pulumi.ResourceOption) (*Member, error) {
    97  	if args == nil {
    98  		return nil, errors.New("missing one or more required arguments")
    99  	}
   100  
   101  	if args.AccountId == nil {
   102  		return nil, errors.New("invalid value for required argument 'AccountId'")
   103  	}
   104  	if args.Email == nil {
   105  		return nil, errors.New("invalid value for required argument 'Email'")
   106  	}
   107  	opts = internal.PkgResourceDefaultOpts(opts)
   108  	var resource Member
   109  	err := ctx.RegisterResource("aws:macie2/member:Member", name, args, &resource, opts...)
   110  	if err != nil {
   111  		return nil, err
   112  	}
   113  	return &resource, nil
   114  }
   115  
   116  // GetMember gets an existing Member resource's state with the given name, ID, and optional
   117  // state properties that are used to uniquely qualify the lookup (nil if not required).
   118  func GetMember(ctx *pulumi.Context,
   119  	name string, id pulumi.IDInput, state *MemberState, opts ...pulumi.ResourceOption) (*Member, error) {
   120  	var resource Member
   121  	err := ctx.ReadResource("aws:macie2/member:Member", name, id, state, &resource, opts...)
   122  	if err != nil {
   123  		return nil, err
   124  	}
   125  	return &resource, nil
   126  }
   127  
   128  // Input properties used for looking up and filtering Member resources.
   129  type memberState struct {
   130  	// The AWS account ID for the account.
   131  	AccountId *string `pulumi:"accountId"`
   132  	// The AWS account ID for the administrator account.
   133  	AdministratorAccountId *string `pulumi:"administratorAccountId"`
   134  	// The Amazon Resource Name (ARN) of the account.
   135  	Arn *string `pulumi:"arn"`
   136  	// The email address for the account.
   137  	Email *string `pulumi:"email"`
   138  	// Specifies whether to send an email notification to the root user of each account that the invitation will be sent to. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. To send an email notification to the root user of each account, set this value to `true`.
   139  	InvitationDisableEmailNotification *bool `pulumi:"invitationDisableEmailNotification"`
   140  	// A custom message to include in the invitation. Amazon Macie adds this message to the standard content that it sends for an invitation.
   141  	InvitationMessage *string `pulumi:"invitationMessage"`
   142  	// Send an invitation to a member
   143  	Invite *bool `pulumi:"invite"`
   144  	// The date and time, in UTC and extended RFC 3339 format, when an Amazon Macie membership invitation was last sent to the account. This value is null if a Macie invitation hasn't been sent to the account.
   145  	InvitedAt       *string `pulumi:"invitedAt"`
   146  	MasterAccountId *string `pulumi:"masterAccountId"`
   147  	// The current status of the relationship between the account and the administrator account.
   148  	RelationshipStatus *string `pulumi:"relationshipStatus"`
   149  	// Specifies the status for the account. To enable Amazon Macie and start all Macie activities for the account, set this value to `ENABLED`. Valid values are `ENABLED` or `PAUSED`.
   150  	Status *string `pulumi:"status"`
   151  	// A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.
   152  	Tags map[string]string `pulumi:"tags"`
   153  	// Deprecated: Please use `tags` instead.
   154  	TagsAll map[string]string `pulumi:"tagsAll"`
   155  	// The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the relationship between the account and the administrator account.
   156  	UpdatedAt *string `pulumi:"updatedAt"`
   157  }
   158  
   159  type MemberState struct {
   160  	// The AWS account ID for the account.
   161  	AccountId pulumi.StringPtrInput
   162  	// The AWS account ID for the administrator account.
   163  	AdministratorAccountId pulumi.StringPtrInput
   164  	// The Amazon Resource Name (ARN) of the account.
   165  	Arn pulumi.StringPtrInput
   166  	// The email address for the account.
   167  	Email pulumi.StringPtrInput
   168  	// Specifies whether to send an email notification to the root user of each account that the invitation will be sent to. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. To send an email notification to the root user of each account, set this value to `true`.
   169  	InvitationDisableEmailNotification pulumi.BoolPtrInput
   170  	// A custom message to include in the invitation. Amazon Macie adds this message to the standard content that it sends for an invitation.
   171  	InvitationMessage pulumi.StringPtrInput
   172  	// Send an invitation to a member
   173  	Invite pulumi.BoolPtrInput
   174  	// The date and time, in UTC and extended RFC 3339 format, when an Amazon Macie membership invitation was last sent to the account. This value is null if a Macie invitation hasn't been sent to the account.
   175  	InvitedAt       pulumi.StringPtrInput
   176  	MasterAccountId pulumi.StringPtrInput
   177  	// The current status of the relationship between the account and the administrator account.
   178  	RelationshipStatus pulumi.StringPtrInput
   179  	// Specifies the status for the account. To enable Amazon Macie and start all Macie activities for the account, set this value to `ENABLED`. Valid values are `ENABLED` or `PAUSED`.
   180  	Status pulumi.StringPtrInput
   181  	// A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.
   182  	Tags pulumi.StringMapInput
   183  	// Deprecated: Please use `tags` instead.
   184  	TagsAll pulumi.StringMapInput
   185  	// The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the relationship between the account and the administrator account.
   186  	UpdatedAt pulumi.StringPtrInput
   187  }
   188  
   189  func (MemberState) ElementType() reflect.Type {
   190  	return reflect.TypeOf((*memberState)(nil)).Elem()
   191  }
   192  
   193  type memberArgs struct {
   194  	// The AWS account ID for the account.
   195  	AccountId string `pulumi:"accountId"`
   196  	// The email address for the account.
   197  	Email string `pulumi:"email"`
   198  	// Specifies whether to send an email notification to the root user of each account that the invitation will be sent to. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. To send an email notification to the root user of each account, set this value to `true`.
   199  	InvitationDisableEmailNotification *bool `pulumi:"invitationDisableEmailNotification"`
   200  	// A custom message to include in the invitation. Amazon Macie adds this message to the standard content that it sends for an invitation.
   201  	InvitationMessage *string `pulumi:"invitationMessage"`
   202  	// Send an invitation to a member
   203  	Invite *bool `pulumi:"invite"`
   204  	// Specifies the status for the account. To enable Amazon Macie and start all Macie activities for the account, set this value to `ENABLED`. Valid values are `ENABLED` or `PAUSED`.
   205  	Status *string `pulumi:"status"`
   206  	// A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.
   207  	Tags map[string]string `pulumi:"tags"`
   208  }
   209  
   210  // The set of arguments for constructing a Member resource.
   211  type MemberArgs struct {
   212  	// The AWS account ID for the account.
   213  	AccountId pulumi.StringInput
   214  	// The email address for the account.
   215  	Email pulumi.StringInput
   216  	// Specifies whether to send an email notification to the root user of each account that the invitation will be sent to. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. To send an email notification to the root user of each account, set this value to `true`.
   217  	InvitationDisableEmailNotification pulumi.BoolPtrInput
   218  	// A custom message to include in the invitation. Amazon Macie adds this message to the standard content that it sends for an invitation.
   219  	InvitationMessage pulumi.StringPtrInput
   220  	// Send an invitation to a member
   221  	Invite pulumi.BoolPtrInput
   222  	// Specifies the status for the account. To enable Amazon Macie and start all Macie activities for the account, set this value to `ENABLED`. Valid values are `ENABLED` or `PAUSED`.
   223  	Status pulumi.StringPtrInput
   224  	// A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.
   225  	Tags pulumi.StringMapInput
   226  }
   227  
   228  func (MemberArgs) ElementType() reflect.Type {
   229  	return reflect.TypeOf((*memberArgs)(nil)).Elem()
   230  }
   231  
   232  type MemberInput interface {
   233  	pulumi.Input
   234  
   235  	ToMemberOutput() MemberOutput
   236  	ToMemberOutputWithContext(ctx context.Context) MemberOutput
   237  }
   238  
   239  func (*Member) ElementType() reflect.Type {
   240  	return reflect.TypeOf((**Member)(nil)).Elem()
   241  }
   242  
   243  func (i *Member) ToMemberOutput() MemberOutput {
   244  	return i.ToMemberOutputWithContext(context.Background())
   245  }
   246  
   247  func (i *Member) ToMemberOutputWithContext(ctx context.Context) MemberOutput {
   248  	return pulumi.ToOutputWithContext(ctx, i).(MemberOutput)
   249  }
   250  
   251  // MemberArrayInput is an input type that accepts MemberArray and MemberArrayOutput values.
   252  // You can construct a concrete instance of `MemberArrayInput` via:
   253  //
   254  //	MemberArray{ MemberArgs{...} }
   255  type MemberArrayInput interface {
   256  	pulumi.Input
   257  
   258  	ToMemberArrayOutput() MemberArrayOutput
   259  	ToMemberArrayOutputWithContext(context.Context) MemberArrayOutput
   260  }
   261  
   262  type MemberArray []MemberInput
   263  
   264  func (MemberArray) ElementType() reflect.Type {
   265  	return reflect.TypeOf((*[]*Member)(nil)).Elem()
   266  }
   267  
   268  func (i MemberArray) ToMemberArrayOutput() MemberArrayOutput {
   269  	return i.ToMemberArrayOutputWithContext(context.Background())
   270  }
   271  
   272  func (i MemberArray) ToMemberArrayOutputWithContext(ctx context.Context) MemberArrayOutput {
   273  	return pulumi.ToOutputWithContext(ctx, i).(MemberArrayOutput)
   274  }
   275  
   276  // MemberMapInput is an input type that accepts MemberMap and MemberMapOutput values.
   277  // You can construct a concrete instance of `MemberMapInput` via:
   278  //
   279  //	MemberMap{ "key": MemberArgs{...} }
   280  type MemberMapInput interface {
   281  	pulumi.Input
   282  
   283  	ToMemberMapOutput() MemberMapOutput
   284  	ToMemberMapOutputWithContext(context.Context) MemberMapOutput
   285  }
   286  
   287  type MemberMap map[string]MemberInput
   288  
   289  func (MemberMap) ElementType() reflect.Type {
   290  	return reflect.TypeOf((*map[string]*Member)(nil)).Elem()
   291  }
   292  
   293  func (i MemberMap) ToMemberMapOutput() MemberMapOutput {
   294  	return i.ToMemberMapOutputWithContext(context.Background())
   295  }
   296  
   297  func (i MemberMap) ToMemberMapOutputWithContext(ctx context.Context) MemberMapOutput {
   298  	return pulumi.ToOutputWithContext(ctx, i).(MemberMapOutput)
   299  }
   300  
   301  type MemberOutput struct{ *pulumi.OutputState }
   302  
   303  func (MemberOutput) ElementType() reflect.Type {
   304  	return reflect.TypeOf((**Member)(nil)).Elem()
   305  }
   306  
   307  func (o MemberOutput) ToMemberOutput() MemberOutput {
   308  	return o
   309  }
   310  
   311  func (o MemberOutput) ToMemberOutputWithContext(ctx context.Context) MemberOutput {
   312  	return o
   313  }
   314  
   315  // The AWS account ID for the account.
   316  func (o MemberOutput) AccountId() pulumi.StringOutput {
   317  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput)
   318  }
   319  
   320  // The AWS account ID for the administrator account.
   321  func (o MemberOutput) AdministratorAccountId() pulumi.StringOutput {
   322  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.AdministratorAccountId }).(pulumi.StringOutput)
   323  }
   324  
   325  // The Amazon Resource Name (ARN) of the account.
   326  func (o MemberOutput) Arn() pulumi.StringOutput {
   327  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   328  }
   329  
   330  // The email address for the account.
   331  func (o MemberOutput) Email() pulumi.StringOutput {
   332  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.Email }).(pulumi.StringOutput)
   333  }
   334  
   335  // Specifies whether to send an email notification to the root user of each account that the invitation will be sent to. This notification is in addition to an alert that the root user receives in AWS Personal Health Dashboard. To send an email notification to the root user of each account, set this value to `true`.
   336  func (o MemberOutput) InvitationDisableEmailNotification() pulumi.BoolPtrOutput {
   337  	return o.ApplyT(func(v *Member) pulumi.BoolPtrOutput { return v.InvitationDisableEmailNotification }).(pulumi.BoolPtrOutput)
   338  }
   339  
   340  // A custom message to include in the invitation. Amazon Macie adds this message to the standard content that it sends for an invitation.
   341  func (o MemberOutput) InvitationMessage() pulumi.StringPtrOutput {
   342  	return o.ApplyT(func(v *Member) pulumi.StringPtrOutput { return v.InvitationMessage }).(pulumi.StringPtrOutput)
   343  }
   344  
   345  // Send an invitation to a member
   346  func (o MemberOutput) Invite() pulumi.BoolOutput {
   347  	return o.ApplyT(func(v *Member) pulumi.BoolOutput { return v.Invite }).(pulumi.BoolOutput)
   348  }
   349  
   350  // The date and time, in UTC and extended RFC 3339 format, when an Amazon Macie membership invitation was last sent to the account. This value is null if a Macie invitation hasn't been sent to the account.
   351  func (o MemberOutput) InvitedAt() pulumi.StringOutput {
   352  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.InvitedAt }).(pulumi.StringOutput)
   353  }
   354  
   355  func (o MemberOutput) MasterAccountId() pulumi.StringOutput {
   356  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.MasterAccountId }).(pulumi.StringOutput)
   357  }
   358  
   359  // The current status of the relationship between the account and the administrator account.
   360  func (o MemberOutput) RelationshipStatus() pulumi.StringOutput {
   361  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.RelationshipStatus }).(pulumi.StringOutput)
   362  }
   363  
   364  // Specifies the status for the account. To enable Amazon Macie and start all Macie activities for the account, set this value to `ENABLED`. Valid values are `ENABLED` or `PAUSED`.
   365  func (o MemberOutput) Status() pulumi.StringOutput {
   366  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   367  }
   368  
   369  // A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.
   370  func (o MemberOutput) Tags() pulumi.StringMapOutput {
   371  	return o.ApplyT(func(v *Member) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   372  }
   373  
   374  // Deprecated: Please use `tags` instead.
   375  func (o MemberOutput) TagsAll() pulumi.StringMapOutput {
   376  	return o.ApplyT(func(v *Member) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   377  }
   378  
   379  // The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the relationship between the account and the administrator account.
   380  func (o MemberOutput) UpdatedAt() pulumi.StringOutput {
   381  	return o.ApplyT(func(v *Member) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput)
   382  }
   383  
   384  type MemberArrayOutput struct{ *pulumi.OutputState }
   385  
   386  func (MemberArrayOutput) ElementType() reflect.Type {
   387  	return reflect.TypeOf((*[]*Member)(nil)).Elem()
   388  }
   389  
   390  func (o MemberArrayOutput) ToMemberArrayOutput() MemberArrayOutput {
   391  	return o
   392  }
   393  
   394  func (o MemberArrayOutput) ToMemberArrayOutputWithContext(ctx context.Context) MemberArrayOutput {
   395  	return o
   396  }
   397  
   398  func (o MemberArrayOutput) Index(i pulumi.IntInput) MemberOutput {
   399  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Member {
   400  		return vs[0].([]*Member)[vs[1].(int)]
   401  	}).(MemberOutput)
   402  }
   403  
   404  type MemberMapOutput struct{ *pulumi.OutputState }
   405  
   406  func (MemberMapOutput) ElementType() reflect.Type {
   407  	return reflect.TypeOf((*map[string]*Member)(nil)).Elem()
   408  }
   409  
   410  func (o MemberMapOutput) ToMemberMapOutput() MemberMapOutput {
   411  	return o
   412  }
   413  
   414  func (o MemberMapOutput) ToMemberMapOutputWithContext(ctx context.Context) MemberMapOutput {
   415  	return o
   416  }
   417  
   418  func (o MemberMapOutput) MapIndex(k pulumi.StringInput) MemberOutput {
   419  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Member {
   420  		return vs[0].(map[string]*Member)[vs[1].(string)]
   421  	}).(MemberOutput)
   422  }
   423  
   424  func init() {
   425  	pulumi.RegisterInputType(reflect.TypeOf((*MemberInput)(nil)).Elem(), &Member{})
   426  	pulumi.RegisterInputType(reflect.TypeOf((*MemberArrayInput)(nil)).Elem(), MemberArray{})
   427  	pulumi.RegisterInputType(reflect.TypeOf((*MemberMapInput)(nil)).Elem(), MemberMap{})
   428  	pulumi.RegisterOutputType(MemberOutput{})
   429  	pulumi.RegisterOutputType(MemberArrayOutput{})
   430  	pulumi.RegisterOutputType(MemberMapOutput{})
   431  }