github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/fms/adminAccount.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 fms
     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 associate/disassociate an AWS Firewall Manager administrator account. This operation must be performed in the `us-east-1` region.
    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/fms"
    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 := fms.NewAdminAccount(ctx, "example", nil)
    32  //			if err != nil {
    33  //				return err
    34  //			}
    35  //			return nil
    36  //		})
    37  //	}
    38  //
    39  // ```
    40  // <!--End PulumiCodeChooser -->
    41  //
    42  // ## Import
    43  //
    44  // Using `pulumi import`, import Firewall Manager administrator account association using the account ID. For example:
    45  //
    46  // ```sh
    47  // $ pulumi import aws:fms/adminAccount:AdminAccount example 123456789012
    48  // ```
    49  type AdminAccount struct {
    50  	pulumi.CustomResourceState
    51  
    52  	// The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. Defaults to the current account. Must be configured to perform drift detection.
    53  	AccountId pulumi.StringOutput `pulumi:"accountId"`
    54  }
    55  
    56  // NewAdminAccount registers a new resource with the given unique name, arguments, and options.
    57  func NewAdminAccount(ctx *pulumi.Context,
    58  	name string, args *AdminAccountArgs, opts ...pulumi.ResourceOption) (*AdminAccount, error) {
    59  	if args == nil {
    60  		args = &AdminAccountArgs{}
    61  	}
    62  
    63  	opts = internal.PkgResourceDefaultOpts(opts)
    64  	var resource AdminAccount
    65  	err := ctx.RegisterResource("aws:fms/adminAccount:AdminAccount", name, args, &resource, opts...)
    66  	if err != nil {
    67  		return nil, err
    68  	}
    69  	return &resource, nil
    70  }
    71  
    72  // GetAdminAccount gets an existing AdminAccount resource's state with the given name, ID, and optional
    73  // state properties that are used to uniquely qualify the lookup (nil if not required).
    74  func GetAdminAccount(ctx *pulumi.Context,
    75  	name string, id pulumi.IDInput, state *AdminAccountState, opts ...pulumi.ResourceOption) (*AdminAccount, error) {
    76  	var resource AdminAccount
    77  	err := ctx.ReadResource("aws:fms/adminAccount:AdminAccount", name, id, state, &resource, opts...)
    78  	if err != nil {
    79  		return nil, err
    80  	}
    81  	return &resource, nil
    82  }
    83  
    84  // Input properties used for looking up and filtering AdminAccount resources.
    85  type adminAccountState struct {
    86  	// The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. Defaults to the current account. Must be configured to perform drift detection.
    87  	AccountId *string `pulumi:"accountId"`
    88  }
    89  
    90  type AdminAccountState struct {
    91  	// The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. Defaults to the current account. Must be configured to perform drift detection.
    92  	AccountId pulumi.StringPtrInput
    93  }
    94  
    95  func (AdminAccountState) ElementType() reflect.Type {
    96  	return reflect.TypeOf((*adminAccountState)(nil)).Elem()
    97  }
    98  
    99  type adminAccountArgs struct {
   100  	// The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. Defaults to the current account. Must be configured to perform drift detection.
   101  	AccountId *string `pulumi:"accountId"`
   102  }
   103  
   104  // The set of arguments for constructing a AdminAccount resource.
   105  type AdminAccountArgs struct {
   106  	// The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. Defaults to the current account. Must be configured to perform drift detection.
   107  	AccountId pulumi.StringPtrInput
   108  }
   109  
   110  func (AdminAccountArgs) ElementType() reflect.Type {
   111  	return reflect.TypeOf((*adminAccountArgs)(nil)).Elem()
   112  }
   113  
   114  type AdminAccountInput interface {
   115  	pulumi.Input
   116  
   117  	ToAdminAccountOutput() AdminAccountOutput
   118  	ToAdminAccountOutputWithContext(ctx context.Context) AdminAccountOutput
   119  }
   120  
   121  func (*AdminAccount) ElementType() reflect.Type {
   122  	return reflect.TypeOf((**AdminAccount)(nil)).Elem()
   123  }
   124  
   125  func (i *AdminAccount) ToAdminAccountOutput() AdminAccountOutput {
   126  	return i.ToAdminAccountOutputWithContext(context.Background())
   127  }
   128  
   129  func (i *AdminAccount) ToAdminAccountOutputWithContext(ctx context.Context) AdminAccountOutput {
   130  	return pulumi.ToOutputWithContext(ctx, i).(AdminAccountOutput)
   131  }
   132  
   133  // AdminAccountArrayInput is an input type that accepts AdminAccountArray and AdminAccountArrayOutput values.
   134  // You can construct a concrete instance of `AdminAccountArrayInput` via:
   135  //
   136  //	AdminAccountArray{ AdminAccountArgs{...} }
   137  type AdminAccountArrayInput interface {
   138  	pulumi.Input
   139  
   140  	ToAdminAccountArrayOutput() AdminAccountArrayOutput
   141  	ToAdminAccountArrayOutputWithContext(context.Context) AdminAccountArrayOutput
   142  }
   143  
   144  type AdminAccountArray []AdminAccountInput
   145  
   146  func (AdminAccountArray) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*[]*AdminAccount)(nil)).Elem()
   148  }
   149  
   150  func (i AdminAccountArray) ToAdminAccountArrayOutput() AdminAccountArrayOutput {
   151  	return i.ToAdminAccountArrayOutputWithContext(context.Background())
   152  }
   153  
   154  func (i AdminAccountArray) ToAdminAccountArrayOutputWithContext(ctx context.Context) AdminAccountArrayOutput {
   155  	return pulumi.ToOutputWithContext(ctx, i).(AdminAccountArrayOutput)
   156  }
   157  
   158  // AdminAccountMapInput is an input type that accepts AdminAccountMap and AdminAccountMapOutput values.
   159  // You can construct a concrete instance of `AdminAccountMapInput` via:
   160  //
   161  //	AdminAccountMap{ "key": AdminAccountArgs{...} }
   162  type AdminAccountMapInput interface {
   163  	pulumi.Input
   164  
   165  	ToAdminAccountMapOutput() AdminAccountMapOutput
   166  	ToAdminAccountMapOutputWithContext(context.Context) AdminAccountMapOutput
   167  }
   168  
   169  type AdminAccountMap map[string]AdminAccountInput
   170  
   171  func (AdminAccountMap) ElementType() reflect.Type {
   172  	return reflect.TypeOf((*map[string]*AdminAccount)(nil)).Elem()
   173  }
   174  
   175  func (i AdminAccountMap) ToAdminAccountMapOutput() AdminAccountMapOutput {
   176  	return i.ToAdminAccountMapOutputWithContext(context.Background())
   177  }
   178  
   179  func (i AdminAccountMap) ToAdminAccountMapOutputWithContext(ctx context.Context) AdminAccountMapOutput {
   180  	return pulumi.ToOutputWithContext(ctx, i).(AdminAccountMapOutput)
   181  }
   182  
   183  type AdminAccountOutput struct{ *pulumi.OutputState }
   184  
   185  func (AdminAccountOutput) ElementType() reflect.Type {
   186  	return reflect.TypeOf((**AdminAccount)(nil)).Elem()
   187  }
   188  
   189  func (o AdminAccountOutput) ToAdminAccountOutput() AdminAccountOutput {
   190  	return o
   191  }
   192  
   193  func (o AdminAccountOutput) ToAdminAccountOutputWithContext(ctx context.Context) AdminAccountOutput {
   194  	return o
   195  }
   196  
   197  // The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. Defaults to the current account. Must be configured to perform drift detection.
   198  func (o AdminAccountOutput) AccountId() pulumi.StringOutput {
   199  	return o.ApplyT(func(v *AdminAccount) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput)
   200  }
   201  
   202  type AdminAccountArrayOutput struct{ *pulumi.OutputState }
   203  
   204  func (AdminAccountArrayOutput) ElementType() reflect.Type {
   205  	return reflect.TypeOf((*[]*AdminAccount)(nil)).Elem()
   206  }
   207  
   208  func (o AdminAccountArrayOutput) ToAdminAccountArrayOutput() AdminAccountArrayOutput {
   209  	return o
   210  }
   211  
   212  func (o AdminAccountArrayOutput) ToAdminAccountArrayOutputWithContext(ctx context.Context) AdminAccountArrayOutput {
   213  	return o
   214  }
   215  
   216  func (o AdminAccountArrayOutput) Index(i pulumi.IntInput) AdminAccountOutput {
   217  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AdminAccount {
   218  		return vs[0].([]*AdminAccount)[vs[1].(int)]
   219  	}).(AdminAccountOutput)
   220  }
   221  
   222  type AdminAccountMapOutput struct{ *pulumi.OutputState }
   223  
   224  func (AdminAccountMapOutput) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*map[string]*AdminAccount)(nil)).Elem()
   226  }
   227  
   228  func (o AdminAccountMapOutput) ToAdminAccountMapOutput() AdminAccountMapOutput {
   229  	return o
   230  }
   231  
   232  func (o AdminAccountMapOutput) ToAdminAccountMapOutputWithContext(ctx context.Context) AdminAccountMapOutput {
   233  	return o
   234  }
   235  
   236  func (o AdminAccountMapOutput) MapIndex(k pulumi.StringInput) AdminAccountOutput {
   237  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AdminAccount {
   238  		return vs[0].(map[string]*AdminAccount)[vs[1].(string)]
   239  	}).(AdminAccountOutput)
   240  }
   241  
   242  func init() {
   243  	pulumi.RegisterInputType(reflect.TypeOf((*AdminAccountInput)(nil)).Elem(), &AdminAccount{})
   244  	pulumi.RegisterInputType(reflect.TypeOf((*AdminAccountArrayInput)(nil)).Elem(), AdminAccountArray{})
   245  	pulumi.RegisterInputType(reflect.TypeOf((*AdminAccountMapInput)(nil)).Elem(), AdminAccountMap{})
   246  	pulumi.RegisterOutputType(AdminAccountOutput{})
   247  	pulumi.RegisterOutputType(AdminAccountArrayOutput{})
   248  	pulumi.RegisterOutputType(AdminAccountMapOutput{})
   249  }