github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/auditmanager/frameworkShare.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 auditmanager
     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 managing an AWS Audit Manager Framework Share.
    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/auditmanager"
    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 := auditmanager.NewFrameworkShare(ctx, "example", &auditmanager.FrameworkShareArgs{
    35  //				DestinationAccount: pulumi.String("012345678901"),
    36  //				DestinationRegion:  pulumi.String("us-east-1"),
    37  //				FrameworkId:        pulumi.Any(exampleAwsAuditmanagerFramework.Id),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import Audit Manager Framework Share using the `id`. For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:auditmanager/frameworkShare:FrameworkShare example abcdef-123456
    55  // ```
    56  type FrameworkShare struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// Comment from the sender about the share request.
    60  	Comment pulumi.StringPtrOutput `pulumi:"comment"`
    61  	// Amazon Web Services account of the recipient.
    62  	DestinationAccount pulumi.StringOutput `pulumi:"destinationAccount"`
    63  	// Amazon Web Services region of the recipient.
    64  	DestinationRegion pulumi.StringOutput `pulumi:"destinationRegion"`
    65  	// Unique identifier for the shared custom framework.
    66  	//
    67  	// The following arguments are optional:
    68  	FrameworkId pulumi.StringOutput `pulumi:"frameworkId"`
    69  	// Status of the share request.
    70  	Status pulumi.StringOutput `pulumi:"status"`
    71  }
    72  
    73  // NewFrameworkShare registers a new resource with the given unique name, arguments, and options.
    74  func NewFrameworkShare(ctx *pulumi.Context,
    75  	name string, args *FrameworkShareArgs, opts ...pulumi.ResourceOption) (*FrameworkShare, error) {
    76  	if args == nil {
    77  		return nil, errors.New("missing one or more required arguments")
    78  	}
    79  
    80  	if args.DestinationAccount == nil {
    81  		return nil, errors.New("invalid value for required argument 'DestinationAccount'")
    82  	}
    83  	if args.DestinationRegion == nil {
    84  		return nil, errors.New("invalid value for required argument 'DestinationRegion'")
    85  	}
    86  	if args.FrameworkId == nil {
    87  		return nil, errors.New("invalid value for required argument 'FrameworkId'")
    88  	}
    89  	opts = internal.PkgResourceDefaultOpts(opts)
    90  	var resource FrameworkShare
    91  	err := ctx.RegisterResource("aws:auditmanager/frameworkShare:FrameworkShare", name, args, &resource, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return &resource, nil
    96  }
    97  
    98  // GetFrameworkShare gets an existing FrameworkShare resource's state with the given name, ID, and optional
    99  // state properties that are used to uniquely qualify the lookup (nil if not required).
   100  func GetFrameworkShare(ctx *pulumi.Context,
   101  	name string, id pulumi.IDInput, state *FrameworkShareState, opts ...pulumi.ResourceOption) (*FrameworkShare, error) {
   102  	var resource FrameworkShare
   103  	err := ctx.ReadResource("aws:auditmanager/frameworkShare:FrameworkShare", name, id, state, &resource, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return &resource, nil
   108  }
   109  
   110  // Input properties used for looking up and filtering FrameworkShare resources.
   111  type frameworkShareState struct {
   112  	// Comment from the sender about the share request.
   113  	Comment *string `pulumi:"comment"`
   114  	// Amazon Web Services account of the recipient.
   115  	DestinationAccount *string `pulumi:"destinationAccount"`
   116  	// Amazon Web Services region of the recipient.
   117  	DestinationRegion *string `pulumi:"destinationRegion"`
   118  	// Unique identifier for the shared custom framework.
   119  	//
   120  	// The following arguments are optional:
   121  	FrameworkId *string `pulumi:"frameworkId"`
   122  	// Status of the share request.
   123  	Status *string `pulumi:"status"`
   124  }
   125  
   126  type FrameworkShareState struct {
   127  	// Comment from the sender about the share request.
   128  	Comment pulumi.StringPtrInput
   129  	// Amazon Web Services account of the recipient.
   130  	DestinationAccount pulumi.StringPtrInput
   131  	// Amazon Web Services region of the recipient.
   132  	DestinationRegion pulumi.StringPtrInput
   133  	// Unique identifier for the shared custom framework.
   134  	//
   135  	// The following arguments are optional:
   136  	FrameworkId pulumi.StringPtrInput
   137  	// Status of the share request.
   138  	Status pulumi.StringPtrInput
   139  }
   140  
   141  func (FrameworkShareState) ElementType() reflect.Type {
   142  	return reflect.TypeOf((*frameworkShareState)(nil)).Elem()
   143  }
   144  
   145  type frameworkShareArgs struct {
   146  	// Comment from the sender about the share request.
   147  	Comment *string `pulumi:"comment"`
   148  	// Amazon Web Services account of the recipient.
   149  	DestinationAccount string `pulumi:"destinationAccount"`
   150  	// Amazon Web Services region of the recipient.
   151  	DestinationRegion string `pulumi:"destinationRegion"`
   152  	// Unique identifier for the shared custom framework.
   153  	//
   154  	// The following arguments are optional:
   155  	FrameworkId string `pulumi:"frameworkId"`
   156  }
   157  
   158  // The set of arguments for constructing a FrameworkShare resource.
   159  type FrameworkShareArgs struct {
   160  	// Comment from the sender about the share request.
   161  	Comment pulumi.StringPtrInput
   162  	// Amazon Web Services account of the recipient.
   163  	DestinationAccount pulumi.StringInput
   164  	// Amazon Web Services region of the recipient.
   165  	DestinationRegion pulumi.StringInput
   166  	// Unique identifier for the shared custom framework.
   167  	//
   168  	// The following arguments are optional:
   169  	FrameworkId pulumi.StringInput
   170  }
   171  
   172  func (FrameworkShareArgs) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*frameworkShareArgs)(nil)).Elem()
   174  }
   175  
   176  type FrameworkShareInput interface {
   177  	pulumi.Input
   178  
   179  	ToFrameworkShareOutput() FrameworkShareOutput
   180  	ToFrameworkShareOutputWithContext(ctx context.Context) FrameworkShareOutput
   181  }
   182  
   183  func (*FrameworkShare) ElementType() reflect.Type {
   184  	return reflect.TypeOf((**FrameworkShare)(nil)).Elem()
   185  }
   186  
   187  func (i *FrameworkShare) ToFrameworkShareOutput() FrameworkShareOutput {
   188  	return i.ToFrameworkShareOutputWithContext(context.Background())
   189  }
   190  
   191  func (i *FrameworkShare) ToFrameworkShareOutputWithContext(ctx context.Context) FrameworkShareOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(FrameworkShareOutput)
   193  }
   194  
   195  // FrameworkShareArrayInput is an input type that accepts FrameworkShareArray and FrameworkShareArrayOutput values.
   196  // You can construct a concrete instance of `FrameworkShareArrayInput` via:
   197  //
   198  //	FrameworkShareArray{ FrameworkShareArgs{...} }
   199  type FrameworkShareArrayInput interface {
   200  	pulumi.Input
   201  
   202  	ToFrameworkShareArrayOutput() FrameworkShareArrayOutput
   203  	ToFrameworkShareArrayOutputWithContext(context.Context) FrameworkShareArrayOutput
   204  }
   205  
   206  type FrameworkShareArray []FrameworkShareInput
   207  
   208  func (FrameworkShareArray) ElementType() reflect.Type {
   209  	return reflect.TypeOf((*[]*FrameworkShare)(nil)).Elem()
   210  }
   211  
   212  func (i FrameworkShareArray) ToFrameworkShareArrayOutput() FrameworkShareArrayOutput {
   213  	return i.ToFrameworkShareArrayOutputWithContext(context.Background())
   214  }
   215  
   216  func (i FrameworkShareArray) ToFrameworkShareArrayOutputWithContext(ctx context.Context) FrameworkShareArrayOutput {
   217  	return pulumi.ToOutputWithContext(ctx, i).(FrameworkShareArrayOutput)
   218  }
   219  
   220  // FrameworkShareMapInput is an input type that accepts FrameworkShareMap and FrameworkShareMapOutput values.
   221  // You can construct a concrete instance of `FrameworkShareMapInput` via:
   222  //
   223  //	FrameworkShareMap{ "key": FrameworkShareArgs{...} }
   224  type FrameworkShareMapInput interface {
   225  	pulumi.Input
   226  
   227  	ToFrameworkShareMapOutput() FrameworkShareMapOutput
   228  	ToFrameworkShareMapOutputWithContext(context.Context) FrameworkShareMapOutput
   229  }
   230  
   231  type FrameworkShareMap map[string]FrameworkShareInput
   232  
   233  func (FrameworkShareMap) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*map[string]*FrameworkShare)(nil)).Elem()
   235  }
   236  
   237  func (i FrameworkShareMap) ToFrameworkShareMapOutput() FrameworkShareMapOutput {
   238  	return i.ToFrameworkShareMapOutputWithContext(context.Background())
   239  }
   240  
   241  func (i FrameworkShareMap) ToFrameworkShareMapOutputWithContext(ctx context.Context) FrameworkShareMapOutput {
   242  	return pulumi.ToOutputWithContext(ctx, i).(FrameworkShareMapOutput)
   243  }
   244  
   245  type FrameworkShareOutput struct{ *pulumi.OutputState }
   246  
   247  func (FrameworkShareOutput) ElementType() reflect.Type {
   248  	return reflect.TypeOf((**FrameworkShare)(nil)).Elem()
   249  }
   250  
   251  func (o FrameworkShareOutput) ToFrameworkShareOutput() FrameworkShareOutput {
   252  	return o
   253  }
   254  
   255  func (o FrameworkShareOutput) ToFrameworkShareOutputWithContext(ctx context.Context) FrameworkShareOutput {
   256  	return o
   257  }
   258  
   259  // Comment from the sender about the share request.
   260  func (o FrameworkShareOutput) Comment() pulumi.StringPtrOutput {
   261  	return o.ApplyT(func(v *FrameworkShare) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput)
   262  }
   263  
   264  // Amazon Web Services account of the recipient.
   265  func (o FrameworkShareOutput) DestinationAccount() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *FrameworkShare) pulumi.StringOutput { return v.DestinationAccount }).(pulumi.StringOutput)
   267  }
   268  
   269  // Amazon Web Services region of the recipient.
   270  func (o FrameworkShareOutput) DestinationRegion() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *FrameworkShare) pulumi.StringOutput { return v.DestinationRegion }).(pulumi.StringOutput)
   272  }
   273  
   274  // Unique identifier for the shared custom framework.
   275  //
   276  // The following arguments are optional:
   277  func (o FrameworkShareOutput) FrameworkId() pulumi.StringOutput {
   278  	return o.ApplyT(func(v *FrameworkShare) pulumi.StringOutput { return v.FrameworkId }).(pulumi.StringOutput)
   279  }
   280  
   281  // Status of the share request.
   282  func (o FrameworkShareOutput) Status() pulumi.StringOutput {
   283  	return o.ApplyT(func(v *FrameworkShare) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   284  }
   285  
   286  type FrameworkShareArrayOutput struct{ *pulumi.OutputState }
   287  
   288  func (FrameworkShareArrayOutput) ElementType() reflect.Type {
   289  	return reflect.TypeOf((*[]*FrameworkShare)(nil)).Elem()
   290  }
   291  
   292  func (o FrameworkShareArrayOutput) ToFrameworkShareArrayOutput() FrameworkShareArrayOutput {
   293  	return o
   294  }
   295  
   296  func (o FrameworkShareArrayOutput) ToFrameworkShareArrayOutputWithContext(ctx context.Context) FrameworkShareArrayOutput {
   297  	return o
   298  }
   299  
   300  func (o FrameworkShareArrayOutput) Index(i pulumi.IntInput) FrameworkShareOutput {
   301  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FrameworkShare {
   302  		return vs[0].([]*FrameworkShare)[vs[1].(int)]
   303  	}).(FrameworkShareOutput)
   304  }
   305  
   306  type FrameworkShareMapOutput struct{ *pulumi.OutputState }
   307  
   308  func (FrameworkShareMapOutput) ElementType() reflect.Type {
   309  	return reflect.TypeOf((*map[string]*FrameworkShare)(nil)).Elem()
   310  }
   311  
   312  func (o FrameworkShareMapOutput) ToFrameworkShareMapOutput() FrameworkShareMapOutput {
   313  	return o
   314  }
   315  
   316  func (o FrameworkShareMapOutput) ToFrameworkShareMapOutputWithContext(ctx context.Context) FrameworkShareMapOutput {
   317  	return o
   318  }
   319  
   320  func (o FrameworkShareMapOutput) MapIndex(k pulumi.StringInput) FrameworkShareOutput {
   321  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FrameworkShare {
   322  		return vs[0].(map[string]*FrameworkShare)[vs[1].(string)]
   323  	}).(FrameworkShareOutput)
   324  }
   325  
   326  func init() {
   327  	pulumi.RegisterInputType(reflect.TypeOf((*FrameworkShareInput)(nil)).Elem(), &FrameworkShare{})
   328  	pulumi.RegisterInputType(reflect.TypeOf((*FrameworkShareArrayInput)(nil)).Elem(), FrameworkShareArray{})
   329  	pulumi.RegisterInputType(reflect.TypeOf((*FrameworkShareMapInput)(nil)).Elem(), FrameworkShareMap{})
   330  	pulumi.RegisterOutputType(FrameworkShareOutput{})
   331  	pulumi.RegisterOutputType(FrameworkShareArrayOutput{})
   332  	pulumi.RegisterOutputType(FrameworkShareMapOutput{})
   333  }