github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/securityhub/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 securityhub
     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  // Enables Security Hub for this AWS account.
    15  //
    16  // > **NOTE:** Destroying this resource will disable Security Hub for this AWS account.
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/securityhub"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := securityhub.NewAccount(ctx, "example", nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  //
    44  // ## Import
    45  //
    46  // Using `pulumi import`, import an existing Security Hub enabled account using the AWS account ID. For example:
    47  //
    48  // ```sh
    49  // $ pulumi import aws:securityhub/account:Account example 123456789012
    50  // ```
    51  type Account struct {
    52  	pulumi.CustomResourceState
    53  
    54  	// ARN of the SecurityHub Hub created in the account.
    55  	Arn pulumi.StringOutput `pulumi:"arn"`
    56  	// Whether to automatically enable new controls when they are added to standards that are enabled. By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.
    57  	AutoEnableControls pulumi.BoolPtrOutput `pulumi:"autoEnableControls"`
    58  	// Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to `SECURITY_CONTROL`, Security Hub generates a single finding for a control check even when the check applies to multiple enabled standards. If the value for this field is set to `STANDARD_CONTROL`, Security Hub generates separate findings for a control check when the check applies to multiple enabled standards. For accounts that are part of an organization, this value can only be updated in the administrator account.
    59  	ControlFindingGenerator pulumi.StringOutput `pulumi:"controlFindingGenerator"`
    60  	// Whether to enable the security standards that Security Hub has designated as automatically enabled including: `  AWS Foundational Security Best Practices v1.0.0 ` and `CIS AWS Foundations Benchmark v1.2.0`. Defaults to `true`.
    61  	EnableDefaultStandards pulumi.BoolPtrOutput `pulumi:"enableDefaultStandards"`
    62  }
    63  
    64  // NewAccount registers a new resource with the given unique name, arguments, and options.
    65  func NewAccount(ctx *pulumi.Context,
    66  	name string, args *AccountArgs, opts ...pulumi.ResourceOption) (*Account, error) {
    67  	if args == nil {
    68  		args = &AccountArgs{}
    69  	}
    70  
    71  	opts = internal.PkgResourceDefaultOpts(opts)
    72  	var resource Account
    73  	err := ctx.RegisterResource("aws:securityhub/account:Account", name, args, &resource, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return &resource, nil
    78  }
    79  
    80  // GetAccount gets an existing Account resource's state with the given name, ID, and optional
    81  // state properties that are used to uniquely qualify the lookup (nil if not required).
    82  func GetAccount(ctx *pulumi.Context,
    83  	name string, id pulumi.IDInput, state *AccountState, opts ...pulumi.ResourceOption) (*Account, error) {
    84  	var resource Account
    85  	err := ctx.ReadResource("aws:securityhub/account:Account", name, id, state, &resource, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return &resource, nil
    90  }
    91  
    92  // Input properties used for looking up and filtering Account resources.
    93  type accountState struct {
    94  	// ARN of the SecurityHub Hub created in the account.
    95  	Arn *string `pulumi:"arn"`
    96  	// Whether to automatically enable new controls when they are added to standards that are enabled. By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.
    97  	AutoEnableControls *bool `pulumi:"autoEnableControls"`
    98  	// Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to `SECURITY_CONTROL`, Security Hub generates a single finding for a control check even when the check applies to multiple enabled standards. If the value for this field is set to `STANDARD_CONTROL`, Security Hub generates separate findings for a control check when the check applies to multiple enabled standards. For accounts that are part of an organization, this value can only be updated in the administrator account.
    99  	ControlFindingGenerator *string `pulumi:"controlFindingGenerator"`
   100  	// Whether to enable the security standards that Security Hub has designated as automatically enabled including: `  AWS Foundational Security Best Practices v1.0.0 ` and `CIS AWS Foundations Benchmark v1.2.0`. Defaults to `true`.
   101  	EnableDefaultStandards *bool `pulumi:"enableDefaultStandards"`
   102  }
   103  
   104  type AccountState struct {
   105  	// ARN of the SecurityHub Hub created in the account.
   106  	Arn pulumi.StringPtrInput
   107  	// Whether to automatically enable new controls when they are added to standards that are enabled. By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.
   108  	AutoEnableControls pulumi.BoolPtrInput
   109  	// Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to `SECURITY_CONTROL`, Security Hub generates a single finding for a control check even when the check applies to multiple enabled standards. If the value for this field is set to `STANDARD_CONTROL`, Security Hub generates separate findings for a control check when the check applies to multiple enabled standards. For accounts that are part of an organization, this value can only be updated in the administrator account.
   110  	ControlFindingGenerator pulumi.StringPtrInput
   111  	// Whether to enable the security standards that Security Hub has designated as automatically enabled including: `  AWS Foundational Security Best Practices v1.0.0 ` and `CIS AWS Foundations Benchmark v1.2.0`. Defaults to `true`.
   112  	EnableDefaultStandards pulumi.BoolPtrInput
   113  }
   114  
   115  func (AccountState) ElementType() reflect.Type {
   116  	return reflect.TypeOf((*accountState)(nil)).Elem()
   117  }
   118  
   119  type accountArgs struct {
   120  	// Whether to automatically enable new controls when they are added to standards that are enabled. By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.
   121  	AutoEnableControls *bool `pulumi:"autoEnableControls"`
   122  	// Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to `SECURITY_CONTROL`, Security Hub generates a single finding for a control check even when the check applies to multiple enabled standards. If the value for this field is set to `STANDARD_CONTROL`, Security Hub generates separate findings for a control check when the check applies to multiple enabled standards. For accounts that are part of an organization, this value can only be updated in the administrator account.
   123  	ControlFindingGenerator *string `pulumi:"controlFindingGenerator"`
   124  	// Whether to enable the security standards that Security Hub has designated as automatically enabled including: `  AWS Foundational Security Best Practices v1.0.0 ` and `CIS AWS Foundations Benchmark v1.2.0`. Defaults to `true`.
   125  	EnableDefaultStandards *bool `pulumi:"enableDefaultStandards"`
   126  }
   127  
   128  // The set of arguments for constructing a Account resource.
   129  type AccountArgs struct {
   130  	// Whether to automatically enable new controls when they are added to standards that are enabled. By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.
   131  	AutoEnableControls pulumi.BoolPtrInput
   132  	// Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to `SECURITY_CONTROL`, Security Hub generates a single finding for a control check even when the check applies to multiple enabled standards. If the value for this field is set to `STANDARD_CONTROL`, Security Hub generates separate findings for a control check when the check applies to multiple enabled standards. For accounts that are part of an organization, this value can only be updated in the administrator account.
   133  	ControlFindingGenerator pulumi.StringPtrInput
   134  	// Whether to enable the security standards that Security Hub has designated as automatically enabled including: `  AWS Foundational Security Best Practices v1.0.0 ` and `CIS AWS Foundations Benchmark v1.2.0`. Defaults to `true`.
   135  	EnableDefaultStandards pulumi.BoolPtrInput
   136  }
   137  
   138  func (AccountArgs) ElementType() reflect.Type {
   139  	return reflect.TypeOf((*accountArgs)(nil)).Elem()
   140  }
   141  
   142  type AccountInput interface {
   143  	pulumi.Input
   144  
   145  	ToAccountOutput() AccountOutput
   146  	ToAccountOutputWithContext(ctx context.Context) AccountOutput
   147  }
   148  
   149  func (*Account) ElementType() reflect.Type {
   150  	return reflect.TypeOf((**Account)(nil)).Elem()
   151  }
   152  
   153  func (i *Account) ToAccountOutput() AccountOutput {
   154  	return i.ToAccountOutputWithContext(context.Background())
   155  }
   156  
   157  func (i *Account) ToAccountOutputWithContext(ctx context.Context) AccountOutput {
   158  	return pulumi.ToOutputWithContext(ctx, i).(AccountOutput)
   159  }
   160  
   161  // AccountArrayInput is an input type that accepts AccountArray and AccountArrayOutput values.
   162  // You can construct a concrete instance of `AccountArrayInput` via:
   163  //
   164  //	AccountArray{ AccountArgs{...} }
   165  type AccountArrayInput interface {
   166  	pulumi.Input
   167  
   168  	ToAccountArrayOutput() AccountArrayOutput
   169  	ToAccountArrayOutputWithContext(context.Context) AccountArrayOutput
   170  }
   171  
   172  type AccountArray []AccountInput
   173  
   174  func (AccountArray) ElementType() reflect.Type {
   175  	return reflect.TypeOf((*[]*Account)(nil)).Elem()
   176  }
   177  
   178  func (i AccountArray) ToAccountArrayOutput() AccountArrayOutput {
   179  	return i.ToAccountArrayOutputWithContext(context.Background())
   180  }
   181  
   182  func (i AccountArray) ToAccountArrayOutputWithContext(ctx context.Context) AccountArrayOutput {
   183  	return pulumi.ToOutputWithContext(ctx, i).(AccountArrayOutput)
   184  }
   185  
   186  // AccountMapInput is an input type that accepts AccountMap and AccountMapOutput values.
   187  // You can construct a concrete instance of `AccountMapInput` via:
   188  //
   189  //	AccountMap{ "key": AccountArgs{...} }
   190  type AccountMapInput interface {
   191  	pulumi.Input
   192  
   193  	ToAccountMapOutput() AccountMapOutput
   194  	ToAccountMapOutputWithContext(context.Context) AccountMapOutput
   195  }
   196  
   197  type AccountMap map[string]AccountInput
   198  
   199  func (AccountMap) ElementType() reflect.Type {
   200  	return reflect.TypeOf((*map[string]*Account)(nil)).Elem()
   201  }
   202  
   203  func (i AccountMap) ToAccountMapOutput() AccountMapOutput {
   204  	return i.ToAccountMapOutputWithContext(context.Background())
   205  }
   206  
   207  func (i AccountMap) ToAccountMapOutputWithContext(ctx context.Context) AccountMapOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(AccountMapOutput)
   209  }
   210  
   211  type AccountOutput struct{ *pulumi.OutputState }
   212  
   213  func (AccountOutput) ElementType() reflect.Type {
   214  	return reflect.TypeOf((**Account)(nil)).Elem()
   215  }
   216  
   217  func (o AccountOutput) ToAccountOutput() AccountOutput {
   218  	return o
   219  }
   220  
   221  func (o AccountOutput) ToAccountOutputWithContext(ctx context.Context) AccountOutput {
   222  	return o
   223  }
   224  
   225  // ARN of the SecurityHub Hub created in the account.
   226  func (o AccountOutput) Arn() pulumi.StringOutput {
   227  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   228  }
   229  
   230  // Whether to automatically enable new controls when they are added to standards that are enabled. By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.
   231  func (o AccountOutput) AutoEnableControls() pulumi.BoolPtrOutput {
   232  	return o.ApplyT(func(v *Account) pulumi.BoolPtrOutput { return v.AutoEnableControls }).(pulumi.BoolPtrOutput)
   233  }
   234  
   235  // Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to `SECURITY_CONTROL`, Security Hub generates a single finding for a control check even when the check applies to multiple enabled standards. If the value for this field is set to `STANDARD_CONTROL`, Security Hub generates separate findings for a control check when the check applies to multiple enabled standards. For accounts that are part of an organization, this value can only be updated in the administrator account.
   236  func (o AccountOutput) ControlFindingGenerator() pulumi.StringOutput {
   237  	return o.ApplyT(func(v *Account) pulumi.StringOutput { return v.ControlFindingGenerator }).(pulumi.StringOutput)
   238  }
   239  
   240  // Whether to enable the security standards that Security Hub has designated as automatically enabled including: `  AWS Foundational Security Best Practices v1.0.0 ` and `CIS AWS Foundations Benchmark v1.2.0`. Defaults to `true`.
   241  func (o AccountOutput) EnableDefaultStandards() pulumi.BoolPtrOutput {
   242  	return o.ApplyT(func(v *Account) pulumi.BoolPtrOutput { return v.EnableDefaultStandards }).(pulumi.BoolPtrOutput)
   243  }
   244  
   245  type AccountArrayOutput struct{ *pulumi.OutputState }
   246  
   247  func (AccountArrayOutput) ElementType() reflect.Type {
   248  	return reflect.TypeOf((*[]*Account)(nil)).Elem()
   249  }
   250  
   251  func (o AccountArrayOutput) ToAccountArrayOutput() AccountArrayOutput {
   252  	return o
   253  }
   254  
   255  func (o AccountArrayOutput) ToAccountArrayOutputWithContext(ctx context.Context) AccountArrayOutput {
   256  	return o
   257  }
   258  
   259  func (o AccountArrayOutput) Index(i pulumi.IntInput) AccountOutput {
   260  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Account {
   261  		return vs[0].([]*Account)[vs[1].(int)]
   262  	}).(AccountOutput)
   263  }
   264  
   265  type AccountMapOutput struct{ *pulumi.OutputState }
   266  
   267  func (AccountMapOutput) ElementType() reflect.Type {
   268  	return reflect.TypeOf((*map[string]*Account)(nil)).Elem()
   269  }
   270  
   271  func (o AccountMapOutput) ToAccountMapOutput() AccountMapOutput {
   272  	return o
   273  }
   274  
   275  func (o AccountMapOutput) ToAccountMapOutputWithContext(ctx context.Context) AccountMapOutput {
   276  	return o
   277  }
   278  
   279  func (o AccountMapOutput) MapIndex(k pulumi.StringInput) AccountOutput {
   280  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Account {
   281  		return vs[0].(map[string]*Account)[vs[1].(string)]
   282  	}).(AccountOutput)
   283  }
   284  
   285  func init() {
   286  	pulumi.RegisterInputType(reflect.TypeOf((*AccountInput)(nil)).Elem(), &Account{})
   287  	pulumi.RegisterInputType(reflect.TypeOf((*AccountArrayInput)(nil)).Elem(), AccountArray{})
   288  	pulumi.RegisterInputType(reflect.TypeOf((*AccountMapInput)(nil)).Elem(), AccountMap{})
   289  	pulumi.RegisterOutputType(AccountOutput{})
   290  	pulumi.RegisterOutputType(AccountArrayOutput{})
   291  	pulumi.RegisterOutputType(AccountMapOutput{})
   292  }