github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/macie2/account.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  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides a resource to manage an [AWS Macie Account](https://docs.aws.amazon.com/macie/latest/APIReference/macie.html).
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/macie2"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := macie2.NewAccount(ctx, "test", &macie2.AccountArgs{
    32  //				FindingPublishingFrequency: pulumi.String("FIFTEEN_MINUTES"),
    33  //				Status:                     pulumi.String("ENABLED"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import `aws_macie2_account` using the id. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:macie2/account:Account example abcd1
    51  // ```
    52  type Account struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// The date and time, in UTC and extended RFC 3339 format, when the Amazon Macie account was created.
    56  	CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
    57  	// Specifies how often to publish updates to policy findings for the account. This includes publishing updates to AWS Security Hub and Amazon EventBridge (formerly called Amazon CloudWatch Events). Valid values are `FIFTEEN_MINUTES`, `ONE_HOUR` or `SIX_HOURS`.
    58  	FindingPublishingFrequency pulumi.StringOutput `pulumi:"findingPublishingFrequency"`
    59  	// The Amazon Resource Name (ARN) of the service-linked role that allows Macie to monitor and analyze data in AWS resources for the account.
    60  	ServiceRole pulumi.StringOutput `pulumi:"serviceRole"`
    61  	// 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`.
    62  	Status pulumi.StringOutput `pulumi:"status"`
    63  	// The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the Macie account.
    64  	UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
    65  }
    66  
    67  // NewAccount registers a new resource with the given unique name, arguments, and options.
    68  func NewAccount(ctx *pulumi.Context,
    69  	name string, args *AccountArgs, opts ...pulumi.ResourceOption) (*Account, error) {
    70  	if args == nil {
    71  		args = &AccountArgs{}
    72  	}
    73  
    74  	opts = internal.PkgResourceDefaultOpts(opts)
    75  	var resource Account
    76  	err := ctx.RegisterResource("aws:macie2/account:Account", name, args, &resource, opts...)
    77  	if err != nil {
    78  		return nil, err
    79  	}
    80  	return &resource, nil
    81  }
    82  
    83  // GetAccount gets an existing Account resource's state with the given name, ID, and optional
    84  // state properties that are used to uniquely qualify the lookup (nil if not required).
    85  func GetAccount(ctx *pulumi.Context,
    86  	name string, id pulumi.IDInput, state *AccountState, opts ...pulumi.ResourceOption) (*Account, error) {
    87  	var resource Account
    88  	err := ctx.ReadResource("aws:macie2/account:Account", name, id, state, &resource, opts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return &resource, nil
    93  }
    94  
    95  // Input properties used for looking up and filtering Account resources.
    96  type accountState struct {
    97  	// The date and time, in UTC and extended RFC 3339 format, when the Amazon Macie account was created.
    98  	CreatedAt *string `pulumi:"createdAt"`
    99  	// Specifies how often to publish updates to policy findings for the account. This includes publishing updates to AWS Security Hub and Amazon EventBridge (formerly called Amazon CloudWatch Events). Valid values are `FIFTEEN_MINUTES`, `ONE_HOUR` or `SIX_HOURS`.
   100  	FindingPublishingFrequency *string `pulumi:"findingPublishingFrequency"`
   101  	// The Amazon Resource Name (ARN) of the service-linked role that allows Macie to monitor and analyze data in AWS resources for the account.
   102  	ServiceRole *string `pulumi:"serviceRole"`
   103  	// 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`.
   104  	Status *string `pulumi:"status"`
   105  	// The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the Macie account.
   106  	UpdatedAt *string `pulumi:"updatedAt"`
   107  }
   108  
   109  type AccountState struct {
   110  	// The date and time, in UTC and extended RFC 3339 format, when the Amazon Macie account was created.
   111  	CreatedAt pulumi.StringPtrInput
   112  	// Specifies how often to publish updates to policy findings for the account. This includes publishing updates to AWS Security Hub and Amazon EventBridge (formerly called Amazon CloudWatch Events). Valid values are `FIFTEEN_MINUTES`, `ONE_HOUR` or `SIX_HOURS`.
   113  	FindingPublishingFrequency pulumi.StringPtrInput
   114  	// The Amazon Resource Name (ARN) of the service-linked role that allows Macie to monitor and analyze data in AWS resources for the account.
   115  	ServiceRole pulumi.StringPtrInput
   116  	// 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`.
   117  	Status pulumi.StringPtrInput
   118  	// The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the Macie account.
   119  	UpdatedAt pulumi.StringPtrInput
   120  }
   121  
   122  func (AccountState) ElementType() reflect.Type {
   123  	return reflect.TypeOf((*accountState)(nil)).Elem()
   124  }
   125  
   126  type accountArgs struct {
   127  	// Specifies how often to publish updates to policy findings for the account. This includes publishing updates to AWS Security Hub and Amazon EventBridge (formerly called Amazon CloudWatch Events). Valid values are `FIFTEEN_MINUTES`, `ONE_HOUR` or `SIX_HOURS`.
   128  	FindingPublishingFrequency *string `pulumi:"findingPublishingFrequency"`
   129  	// 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`.
   130  	Status *string `pulumi:"status"`
   131  }
   132  
   133  // The set of arguments for constructing a Account resource.
   134  type AccountArgs struct {
   135  	// Specifies how often to publish updates to policy findings for the account. This includes publishing updates to AWS Security Hub and Amazon EventBridge (formerly called Amazon CloudWatch Events). Valid values are `FIFTEEN_MINUTES`, `ONE_HOUR` or `SIX_HOURS`.
   136  	FindingPublishingFrequency pulumi.StringPtrInput
   137  	// 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`.
   138  	Status pulumi.StringPtrInput
   139  }
   140  
   141  func (AccountArgs) ElementType() reflect.Type {
   142  	return reflect.TypeOf((*accountArgs)(nil)).Elem()
   143  }
   144  
   145  type AccountInput interface {
   146  	pulumi.Input
   147  
   148  	ToAccountOutput() AccountOutput
   149  	ToAccountOutputWithContext(ctx context.Context) AccountOutput
   150  }
   151  
   152  func (*Account) ElementType() reflect.Type {
   153  	return reflect.TypeOf((**Account)(nil)).Elem()
   154  }
   155  
   156  func (i *Account) ToAccountOutput() AccountOutput {
   157  	return i.ToAccountOutputWithContext(context.Background())
   158  }
   159  
   160  func (i *Account) ToAccountOutputWithContext(ctx context.Context) AccountOutput {
   161  	return pulumi.ToOutputWithContext(ctx, i).(AccountOutput)
   162  }
   163  
   164  // AccountArrayInput is an input type that accepts AccountArray and AccountArrayOutput values.
   165  // You can construct a concrete instance of `AccountArrayInput` via:
   166  //
   167  //	AccountArray{ AccountArgs{...} }
   168  type AccountArrayInput interface {
   169  	pulumi.Input
   170  
   171  	ToAccountArrayOutput() AccountArrayOutput
   172  	ToAccountArrayOutputWithContext(context.Context) AccountArrayOutput
   173  }
   174  
   175  type AccountArray []AccountInput
   176  
   177  func (AccountArray) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*[]*Account)(nil)).Elem()
   179  }
   180  
   181  func (i AccountArray) ToAccountArrayOutput() AccountArrayOutput {
   182  	return i.ToAccountArrayOutputWithContext(context.Background())
   183  }
   184  
   185  func (i AccountArray) ToAccountArrayOutputWithContext(ctx context.Context) AccountArrayOutput {
   186  	return pulumi.ToOutputWithContext(ctx, i).(AccountArrayOutput)
   187  }
   188  
   189  // AccountMapInput is an input type that accepts AccountMap and AccountMapOutput values.
   190  // You can construct a concrete instance of `AccountMapInput` via:
   191  //
   192  //	AccountMap{ "key": AccountArgs{...} }
   193  type AccountMapInput interface {
   194  	pulumi.Input
   195  
   196  	ToAccountMapOutput() AccountMapOutput
   197  	ToAccountMapOutputWithContext(context.Context) AccountMapOutput
   198  }
   199  
   200  type AccountMap map[string]AccountInput
   201  
   202  func (AccountMap) ElementType() reflect.Type {
   203  	return reflect.TypeOf((*map[string]*Account)(nil)).Elem()
   204  }
   205  
   206  func (i AccountMap) ToAccountMapOutput() AccountMapOutput {
   207  	return i.ToAccountMapOutputWithContext(context.Background())
   208  }
   209  
   210  func (i AccountMap) ToAccountMapOutputWithContext(ctx context.Context) AccountMapOutput {
   211  	return pulumi.ToOutputWithContext(ctx, i).(AccountMapOutput)
   212  }
   213  
   214  type AccountOutput struct{ *pulumi.OutputState }
   215  
   216  func (AccountOutput) ElementType() reflect.Type {
   217  	return reflect.TypeOf((**Account)(nil)).Elem()
   218  }
   219  
   220  func (o AccountOutput) ToAccountOutput() AccountOutput {
   221  	return o
   222  }
   223  
   224  func (o AccountOutput) ToAccountOutputWithContext(ctx context.Context) AccountOutput {
   225  	return o
   226  }
   227  
   228  // The date and time, in UTC and extended RFC 3339 format, when the Amazon Macie account was created.
   229  func (o AccountOutput) CreatedAt() pulumi.StringOutput {
   230  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
   231  }
   232  
   233  // Specifies how often to publish updates to policy findings for the account. This includes publishing updates to AWS Security Hub and Amazon EventBridge (formerly called Amazon CloudWatch Events). Valid values are `FIFTEEN_MINUTES`, `ONE_HOUR` or `SIX_HOURS`.
   234  func (o AccountOutput) FindingPublishingFrequency() pulumi.StringOutput {
   235  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.FindingPublishingFrequency }).(pulumi.StringOutput)
   236  }
   237  
   238  // The Amazon Resource Name (ARN) of the service-linked role that allows Macie to monitor and analyze data in AWS resources for the account.
   239  func (o AccountOutput) ServiceRole() pulumi.StringOutput {
   240  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.ServiceRole }).(pulumi.StringOutput)
   241  }
   242  
   243  // 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`.
   244  func (o AccountOutput) Status() pulumi.StringOutput {
   245  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   246  }
   247  
   248  // The date and time, in UTC and extended RFC 3339 format, of the most recent change to the status of the Macie account.
   249  func (o AccountOutput) UpdatedAt() pulumi.StringOutput {
   250  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput)
   251  }
   252  
   253  type AccountArrayOutput struct{ *pulumi.OutputState }
   254  
   255  func (AccountArrayOutput) ElementType() reflect.Type {
   256  	return reflect.TypeOf((*[]*Account)(nil)).Elem()
   257  }
   258  
   259  func (o AccountArrayOutput) ToAccountArrayOutput() AccountArrayOutput {
   260  	return o
   261  }
   262  
   263  func (o AccountArrayOutput) ToAccountArrayOutputWithContext(ctx context.Context) AccountArrayOutput {
   264  	return o
   265  }
   266  
   267  func (o AccountArrayOutput) Index(i pulumi.IntInput) AccountOutput {
   268  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Account {
   269  		return vs[0].([]*Account)[vs[1].(int)]
   270  	}).(AccountOutput)
   271  }
   272  
   273  type AccountMapOutput struct{ *pulumi.OutputState }
   274  
   275  func (AccountMapOutput) ElementType() reflect.Type {
   276  	return reflect.TypeOf((*map[string]*Account)(nil)).Elem()
   277  }
   278  
   279  func (o AccountMapOutput) ToAccountMapOutput() AccountMapOutput {
   280  	return o
   281  }
   282  
   283  func (o AccountMapOutput) ToAccountMapOutputWithContext(ctx context.Context) AccountMapOutput {
   284  	return o
   285  }
   286  
   287  func (o AccountMapOutput) MapIndex(k pulumi.StringInput) AccountOutput {
   288  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Account {
   289  		return vs[0].(map[string]*Account)[vs[1].(string)]
   290  	}).(AccountOutput)
   291  }
   292  
   293  func init() {
   294  	pulumi.RegisterInputType(reflect.TypeOf((*AccountInput)(nil)).Elem(), &Account{})
   295  	pulumi.RegisterInputType(reflect.TypeOf((*AccountArrayInput)(nil)).Elem(), AccountArray{})
   296  	pulumi.RegisterInputType(reflect.TypeOf((*AccountMapInput)(nil)).Elem(), AccountMap{})
   297  	pulumi.RegisterOutputType(AccountOutput{})
   298  	pulumi.RegisterOutputType(AccountArrayOutput{})
   299  	pulumi.RegisterOutputType(AccountMapOutput{})
   300  }