github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/inspector2/memberAssociation.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 inspector2
     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  // Resource for associating accounts to existing Inspector instances.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/inspector2"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := inspector2.NewMemberAssociation(ctx, "example", &inspector2.MemberAssociationArgs{
    35  //				AccountId: pulumi.String("123456789012"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import Amazon Inspector Member Association using the `account_id`. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:inspector2/memberAssociation:MemberAssociation example 123456789012
    53  // ```
    54  type MemberAssociation struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// ID of the account to associate
    58  	AccountId pulumi.StringOutput `pulumi:"accountId"`
    59  	// Account ID of the delegated administrator account
    60  	DelegatedAdminAccountId pulumi.StringOutput `pulumi:"delegatedAdminAccountId"`
    61  	// Status of the member relationship
    62  	RelationshipStatus pulumi.StringOutput `pulumi:"relationshipStatus"`
    63  	// Date and time of the last update of the relationship
    64  	UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
    65  }
    66  
    67  // NewMemberAssociation registers a new resource with the given unique name, arguments, and options.
    68  func NewMemberAssociation(ctx *pulumi.Context,
    69  	name string, args *MemberAssociationArgs, opts ...pulumi.ResourceOption) (*MemberAssociation, error) {
    70  	if args == nil {
    71  		return nil, errors.New("missing one or more required arguments")
    72  	}
    73  
    74  	if args.AccountId == nil {
    75  		return nil, errors.New("invalid value for required argument 'AccountId'")
    76  	}
    77  	opts = internal.PkgResourceDefaultOpts(opts)
    78  	var resource MemberAssociation
    79  	err := ctx.RegisterResource("aws:inspector2/memberAssociation:MemberAssociation", name, args, &resource, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return &resource, nil
    84  }
    85  
    86  // GetMemberAssociation gets an existing MemberAssociation resource's state with the given name, ID, and optional
    87  // state properties that are used to uniquely qualify the lookup (nil if not required).
    88  func GetMemberAssociation(ctx *pulumi.Context,
    89  	name string, id pulumi.IDInput, state *MemberAssociationState, opts ...pulumi.ResourceOption) (*MemberAssociation, error) {
    90  	var resource MemberAssociation
    91  	err := ctx.ReadResource("aws:inspector2/memberAssociation:MemberAssociation", name, id, state, &resource, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return &resource, nil
    96  }
    97  
    98  // Input properties used for looking up and filtering MemberAssociation resources.
    99  type memberAssociationState struct {
   100  	// ID of the account to associate
   101  	AccountId *string `pulumi:"accountId"`
   102  	// Account ID of the delegated administrator account
   103  	DelegatedAdminAccountId *string `pulumi:"delegatedAdminAccountId"`
   104  	// Status of the member relationship
   105  	RelationshipStatus *string `pulumi:"relationshipStatus"`
   106  	// Date and time of the last update of the relationship
   107  	UpdatedAt *string `pulumi:"updatedAt"`
   108  }
   109  
   110  type MemberAssociationState struct {
   111  	// ID of the account to associate
   112  	AccountId pulumi.StringPtrInput
   113  	// Account ID of the delegated administrator account
   114  	DelegatedAdminAccountId pulumi.StringPtrInput
   115  	// Status of the member relationship
   116  	RelationshipStatus pulumi.StringPtrInput
   117  	// Date and time of the last update of the relationship
   118  	UpdatedAt pulumi.StringPtrInput
   119  }
   120  
   121  func (MemberAssociationState) ElementType() reflect.Type {
   122  	return reflect.TypeOf((*memberAssociationState)(nil)).Elem()
   123  }
   124  
   125  type memberAssociationArgs struct {
   126  	// ID of the account to associate
   127  	AccountId string `pulumi:"accountId"`
   128  }
   129  
   130  // The set of arguments for constructing a MemberAssociation resource.
   131  type MemberAssociationArgs struct {
   132  	// ID of the account to associate
   133  	AccountId pulumi.StringInput
   134  }
   135  
   136  func (MemberAssociationArgs) ElementType() reflect.Type {
   137  	return reflect.TypeOf((*memberAssociationArgs)(nil)).Elem()
   138  }
   139  
   140  type MemberAssociationInput interface {
   141  	pulumi.Input
   142  
   143  	ToMemberAssociationOutput() MemberAssociationOutput
   144  	ToMemberAssociationOutputWithContext(ctx context.Context) MemberAssociationOutput
   145  }
   146  
   147  func (*MemberAssociation) ElementType() reflect.Type {
   148  	return reflect.TypeOf((**MemberAssociation)(nil)).Elem()
   149  }
   150  
   151  func (i *MemberAssociation) ToMemberAssociationOutput() MemberAssociationOutput {
   152  	return i.ToMemberAssociationOutputWithContext(context.Background())
   153  }
   154  
   155  func (i *MemberAssociation) ToMemberAssociationOutputWithContext(ctx context.Context) MemberAssociationOutput {
   156  	return pulumi.ToOutputWithContext(ctx, i).(MemberAssociationOutput)
   157  }
   158  
   159  // MemberAssociationArrayInput is an input type that accepts MemberAssociationArray and MemberAssociationArrayOutput values.
   160  // You can construct a concrete instance of `MemberAssociationArrayInput` via:
   161  //
   162  //	MemberAssociationArray{ MemberAssociationArgs{...} }
   163  type MemberAssociationArrayInput interface {
   164  	pulumi.Input
   165  
   166  	ToMemberAssociationArrayOutput() MemberAssociationArrayOutput
   167  	ToMemberAssociationArrayOutputWithContext(context.Context) MemberAssociationArrayOutput
   168  }
   169  
   170  type MemberAssociationArray []MemberAssociationInput
   171  
   172  func (MemberAssociationArray) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*[]*MemberAssociation)(nil)).Elem()
   174  }
   175  
   176  func (i MemberAssociationArray) ToMemberAssociationArrayOutput() MemberAssociationArrayOutput {
   177  	return i.ToMemberAssociationArrayOutputWithContext(context.Background())
   178  }
   179  
   180  func (i MemberAssociationArray) ToMemberAssociationArrayOutputWithContext(ctx context.Context) MemberAssociationArrayOutput {
   181  	return pulumi.ToOutputWithContext(ctx, i).(MemberAssociationArrayOutput)
   182  }
   183  
   184  // MemberAssociationMapInput is an input type that accepts MemberAssociationMap and MemberAssociationMapOutput values.
   185  // You can construct a concrete instance of `MemberAssociationMapInput` via:
   186  //
   187  //	MemberAssociationMap{ "key": MemberAssociationArgs{...} }
   188  type MemberAssociationMapInput interface {
   189  	pulumi.Input
   190  
   191  	ToMemberAssociationMapOutput() MemberAssociationMapOutput
   192  	ToMemberAssociationMapOutputWithContext(context.Context) MemberAssociationMapOutput
   193  }
   194  
   195  type MemberAssociationMap map[string]MemberAssociationInput
   196  
   197  func (MemberAssociationMap) ElementType() reflect.Type {
   198  	return reflect.TypeOf((*map[string]*MemberAssociation)(nil)).Elem()
   199  }
   200  
   201  func (i MemberAssociationMap) ToMemberAssociationMapOutput() MemberAssociationMapOutput {
   202  	return i.ToMemberAssociationMapOutputWithContext(context.Background())
   203  }
   204  
   205  func (i MemberAssociationMap) ToMemberAssociationMapOutputWithContext(ctx context.Context) MemberAssociationMapOutput {
   206  	return pulumi.ToOutputWithContext(ctx, i).(MemberAssociationMapOutput)
   207  }
   208  
   209  type MemberAssociationOutput struct{ *pulumi.OutputState }
   210  
   211  func (MemberAssociationOutput) ElementType() reflect.Type {
   212  	return reflect.TypeOf((**MemberAssociation)(nil)).Elem()
   213  }
   214  
   215  func (o MemberAssociationOutput) ToMemberAssociationOutput() MemberAssociationOutput {
   216  	return o
   217  }
   218  
   219  func (o MemberAssociationOutput) ToMemberAssociationOutputWithContext(ctx context.Context) MemberAssociationOutput {
   220  	return o
   221  }
   222  
   223  // ID of the account to associate
   224  func (o MemberAssociationOutput) AccountId() pulumi.StringOutput {
   225  	return o.ApplyT(func(v *MemberAssociation) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput)
   226  }
   227  
   228  // Account ID of the delegated administrator account
   229  func (o MemberAssociationOutput) DelegatedAdminAccountId() pulumi.StringOutput {
   230  	return o.ApplyT(func(v *MemberAssociation) pulumi.StringOutput { return v.DelegatedAdminAccountId }).(pulumi.StringOutput)
   231  }
   232  
   233  // Status of the member relationship
   234  func (o MemberAssociationOutput) RelationshipStatus() pulumi.StringOutput {
   235  	return o.ApplyT(func(v *MemberAssociation) pulumi.StringOutput { return v.RelationshipStatus }).(pulumi.StringOutput)
   236  }
   237  
   238  // Date and time of the last update of the relationship
   239  func (o MemberAssociationOutput) UpdatedAt() pulumi.StringOutput {
   240  	return o.ApplyT(func(v *MemberAssociation) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput)
   241  }
   242  
   243  type MemberAssociationArrayOutput struct{ *pulumi.OutputState }
   244  
   245  func (MemberAssociationArrayOutput) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*[]*MemberAssociation)(nil)).Elem()
   247  }
   248  
   249  func (o MemberAssociationArrayOutput) ToMemberAssociationArrayOutput() MemberAssociationArrayOutput {
   250  	return o
   251  }
   252  
   253  func (o MemberAssociationArrayOutput) ToMemberAssociationArrayOutputWithContext(ctx context.Context) MemberAssociationArrayOutput {
   254  	return o
   255  }
   256  
   257  func (o MemberAssociationArrayOutput) Index(i pulumi.IntInput) MemberAssociationOutput {
   258  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MemberAssociation {
   259  		return vs[0].([]*MemberAssociation)[vs[1].(int)]
   260  	}).(MemberAssociationOutput)
   261  }
   262  
   263  type MemberAssociationMapOutput struct{ *pulumi.OutputState }
   264  
   265  func (MemberAssociationMapOutput) ElementType() reflect.Type {
   266  	return reflect.TypeOf((*map[string]*MemberAssociation)(nil)).Elem()
   267  }
   268  
   269  func (o MemberAssociationMapOutput) ToMemberAssociationMapOutput() MemberAssociationMapOutput {
   270  	return o
   271  }
   272  
   273  func (o MemberAssociationMapOutput) ToMemberAssociationMapOutputWithContext(ctx context.Context) MemberAssociationMapOutput {
   274  	return o
   275  }
   276  
   277  func (o MemberAssociationMapOutput) MapIndex(k pulumi.StringInput) MemberAssociationOutput {
   278  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MemberAssociation {
   279  		return vs[0].(map[string]*MemberAssociation)[vs[1].(string)]
   280  	}).(MemberAssociationOutput)
   281  }
   282  
   283  func init() {
   284  	pulumi.RegisterInputType(reflect.TypeOf((*MemberAssociationInput)(nil)).Elem(), &MemberAssociation{})
   285  	pulumi.RegisterInputType(reflect.TypeOf((*MemberAssociationArrayInput)(nil)).Elem(), MemberAssociationArray{})
   286  	pulumi.RegisterInputType(reflect.TypeOf((*MemberAssociationMapInput)(nil)).Elem(), MemberAssociationMap{})
   287  	pulumi.RegisterOutputType(MemberAssociationOutput{})
   288  	pulumi.RegisterOutputType(MemberAssociationArrayOutput{})
   289  	pulumi.RegisterOutputType(MemberAssociationMapOutput{})
   290  }