github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/transfer/agreement.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 transfer
     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  // Provides a AWS Transfer AS2 Agreement resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transfer"
    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 := transfer.NewAgreement(ctx, "example", &transfer.AgreementArgs{
    35  //				AccessRole:       pulumi.Any(test.Arn),
    36  //				BaseDirectory:    pulumi.String("/DOC-EXAMPLE-BUCKET/home/mydirectory"),
    37  //				Description:      pulumi.String("example"),
    38  //				LocalProfileId:   pulumi.Any(local.ProfileId),
    39  //				PartnerProfileId: pulumi.Any(partner.ProfileId),
    40  //				ServerId:         pulumi.Any(testAwsTransferServer.Id),
    41  //			})
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			return nil
    46  //		})
    47  //	}
    48  //
    49  // ```
    50  // <!--End PulumiCodeChooser -->
    51  //
    52  // ## Import
    53  //
    54  // Using `pulumi import`, import Transfer AS2 Agreement using the `server_id/agreement_id`. For example:
    55  //
    56  // ```sh
    57  // $ pulumi import aws:transfer/agreement:Agreement example s-4221a88afd5f4362a/a-4221a88afd5f4362a
    58  // ```
    59  type Agreement struct {
    60  	pulumi.CustomResourceState
    61  
    62  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
    63  	AccessRole pulumi.StringOutput `pulumi:"accessRole"`
    64  	// The unique identifier for the AS2 agreement.
    65  	AgreementId pulumi.StringOutput `pulumi:"agreementId"`
    66  	// The ARN of the agreement.
    67  	Arn pulumi.StringOutput `pulumi:"arn"`
    68  	// The landing directory for the files transferred by using the AS2 protocol.
    69  	BaseDirectory pulumi.StringOutput `pulumi:"baseDirectory"`
    70  	// The Optional description of the transdfer.
    71  	Description pulumi.StringPtrOutput `pulumi:"description"`
    72  	// The unique identifier for the AS2 local profile.
    73  	LocalProfileId pulumi.StringOutput `pulumi:"localProfileId"`
    74  	// The unique identifier for the AS2 partner profile.
    75  	PartnerProfileId pulumi.StringOutput `pulumi:"partnerProfileId"`
    76  	// The unique server identifier for the server instance. This is the specific server the agreement uses.
    77  	ServerId pulumi.StringOutput `pulumi:"serverId"`
    78  	Status   pulumi.StringOutput `pulumi:"status"`
    79  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    80  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    81  	// Deprecated: Please use `tags` instead.
    82  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    83  }
    84  
    85  // NewAgreement registers a new resource with the given unique name, arguments, and options.
    86  func NewAgreement(ctx *pulumi.Context,
    87  	name string, args *AgreementArgs, opts ...pulumi.ResourceOption) (*Agreement, error) {
    88  	if args == nil {
    89  		return nil, errors.New("missing one or more required arguments")
    90  	}
    91  
    92  	if args.AccessRole == nil {
    93  		return nil, errors.New("invalid value for required argument 'AccessRole'")
    94  	}
    95  	if args.BaseDirectory == nil {
    96  		return nil, errors.New("invalid value for required argument 'BaseDirectory'")
    97  	}
    98  	if args.LocalProfileId == nil {
    99  		return nil, errors.New("invalid value for required argument 'LocalProfileId'")
   100  	}
   101  	if args.PartnerProfileId == nil {
   102  		return nil, errors.New("invalid value for required argument 'PartnerProfileId'")
   103  	}
   104  	if args.ServerId == nil {
   105  		return nil, errors.New("invalid value for required argument 'ServerId'")
   106  	}
   107  	opts = internal.PkgResourceDefaultOpts(opts)
   108  	var resource Agreement
   109  	err := ctx.RegisterResource("aws:transfer/agreement:Agreement", name, args, &resource, opts...)
   110  	if err != nil {
   111  		return nil, err
   112  	}
   113  	return &resource, nil
   114  }
   115  
   116  // GetAgreement gets an existing Agreement resource's state with the given name, ID, and optional
   117  // state properties that are used to uniquely qualify the lookup (nil if not required).
   118  func GetAgreement(ctx *pulumi.Context,
   119  	name string, id pulumi.IDInput, state *AgreementState, opts ...pulumi.ResourceOption) (*Agreement, error) {
   120  	var resource Agreement
   121  	err := ctx.ReadResource("aws:transfer/agreement:Agreement", name, id, state, &resource, opts...)
   122  	if err != nil {
   123  		return nil, err
   124  	}
   125  	return &resource, nil
   126  }
   127  
   128  // Input properties used for looking up and filtering Agreement resources.
   129  type agreementState struct {
   130  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   131  	AccessRole *string `pulumi:"accessRole"`
   132  	// The unique identifier for the AS2 agreement.
   133  	AgreementId *string `pulumi:"agreementId"`
   134  	// The ARN of the agreement.
   135  	Arn *string `pulumi:"arn"`
   136  	// The landing directory for the files transferred by using the AS2 protocol.
   137  	BaseDirectory *string `pulumi:"baseDirectory"`
   138  	// The Optional description of the transdfer.
   139  	Description *string `pulumi:"description"`
   140  	// The unique identifier for the AS2 local profile.
   141  	LocalProfileId *string `pulumi:"localProfileId"`
   142  	// The unique identifier for the AS2 partner profile.
   143  	PartnerProfileId *string `pulumi:"partnerProfileId"`
   144  	// The unique server identifier for the server instance. This is the specific server the agreement uses.
   145  	ServerId *string `pulumi:"serverId"`
   146  	Status   *string `pulumi:"status"`
   147  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   148  	Tags map[string]string `pulumi:"tags"`
   149  	// Deprecated: Please use `tags` instead.
   150  	TagsAll map[string]string `pulumi:"tagsAll"`
   151  }
   152  
   153  type AgreementState struct {
   154  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   155  	AccessRole pulumi.StringPtrInput
   156  	// The unique identifier for the AS2 agreement.
   157  	AgreementId pulumi.StringPtrInput
   158  	// The ARN of the agreement.
   159  	Arn pulumi.StringPtrInput
   160  	// The landing directory for the files transferred by using the AS2 protocol.
   161  	BaseDirectory pulumi.StringPtrInput
   162  	// The Optional description of the transdfer.
   163  	Description pulumi.StringPtrInput
   164  	// The unique identifier for the AS2 local profile.
   165  	LocalProfileId pulumi.StringPtrInput
   166  	// The unique identifier for the AS2 partner profile.
   167  	PartnerProfileId pulumi.StringPtrInput
   168  	// The unique server identifier for the server instance. This is the specific server the agreement uses.
   169  	ServerId pulumi.StringPtrInput
   170  	Status   pulumi.StringPtrInput
   171  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   172  	Tags pulumi.StringMapInput
   173  	// Deprecated: Please use `tags` instead.
   174  	TagsAll pulumi.StringMapInput
   175  }
   176  
   177  func (AgreementState) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*agreementState)(nil)).Elem()
   179  }
   180  
   181  type agreementArgs struct {
   182  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   183  	AccessRole string `pulumi:"accessRole"`
   184  	// The landing directory for the files transferred by using the AS2 protocol.
   185  	BaseDirectory string `pulumi:"baseDirectory"`
   186  	// The Optional description of the transdfer.
   187  	Description *string `pulumi:"description"`
   188  	// The unique identifier for the AS2 local profile.
   189  	LocalProfileId string `pulumi:"localProfileId"`
   190  	// The unique identifier for the AS2 partner profile.
   191  	PartnerProfileId string `pulumi:"partnerProfileId"`
   192  	// The unique server identifier for the server instance. This is the specific server the agreement uses.
   193  	ServerId string `pulumi:"serverId"`
   194  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   195  	Tags map[string]string `pulumi:"tags"`
   196  }
   197  
   198  // The set of arguments for constructing a Agreement resource.
   199  type AgreementArgs struct {
   200  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   201  	AccessRole pulumi.StringInput
   202  	// The landing directory for the files transferred by using the AS2 protocol.
   203  	BaseDirectory pulumi.StringInput
   204  	// The Optional description of the transdfer.
   205  	Description pulumi.StringPtrInput
   206  	// The unique identifier for the AS2 local profile.
   207  	LocalProfileId pulumi.StringInput
   208  	// The unique identifier for the AS2 partner profile.
   209  	PartnerProfileId pulumi.StringInput
   210  	// The unique server identifier for the server instance. This is the specific server the agreement uses.
   211  	ServerId pulumi.StringInput
   212  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   213  	Tags pulumi.StringMapInput
   214  }
   215  
   216  func (AgreementArgs) ElementType() reflect.Type {
   217  	return reflect.TypeOf((*agreementArgs)(nil)).Elem()
   218  }
   219  
   220  type AgreementInput interface {
   221  	pulumi.Input
   222  
   223  	ToAgreementOutput() AgreementOutput
   224  	ToAgreementOutputWithContext(ctx context.Context) AgreementOutput
   225  }
   226  
   227  func (*Agreement) ElementType() reflect.Type {
   228  	return reflect.TypeOf((**Agreement)(nil)).Elem()
   229  }
   230  
   231  func (i *Agreement) ToAgreementOutput() AgreementOutput {
   232  	return i.ToAgreementOutputWithContext(context.Background())
   233  }
   234  
   235  func (i *Agreement) ToAgreementOutputWithContext(ctx context.Context) AgreementOutput {
   236  	return pulumi.ToOutputWithContext(ctx, i).(AgreementOutput)
   237  }
   238  
   239  // AgreementArrayInput is an input type that accepts AgreementArray and AgreementArrayOutput values.
   240  // You can construct a concrete instance of `AgreementArrayInput` via:
   241  //
   242  //	AgreementArray{ AgreementArgs{...} }
   243  type AgreementArrayInput interface {
   244  	pulumi.Input
   245  
   246  	ToAgreementArrayOutput() AgreementArrayOutput
   247  	ToAgreementArrayOutputWithContext(context.Context) AgreementArrayOutput
   248  }
   249  
   250  type AgreementArray []AgreementInput
   251  
   252  func (AgreementArray) ElementType() reflect.Type {
   253  	return reflect.TypeOf((*[]*Agreement)(nil)).Elem()
   254  }
   255  
   256  func (i AgreementArray) ToAgreementArrayOutput() AgreementArrayOutput {
   257  	return i.ToAgreementArrayOutputWithContext(context.Background())
   258  }
   259  
   260  func (i AgreementArray) ToAgreementArrayOutputWithContext(ctx context.Context) AgreementArrayOutput {
   261  	return pulumi.ToOutputWithContext(ctx, i).(AgreementArrayOutput)
   262  }
   263  
   264  // AgreementMapInput is an input type that accepts AgreementMap and AgreementMapOutput values.
   265  // You can construct a concrete instance of `AgreementMapInput` via:
   266  //
   267  //	AgreementMap{ "key": AgreementArgs{...} }
   268  type AgreementMapInput interface {
   269  	pulumi.Input
   270  
   271  	ToAgreementMapOutput() AgreementMapOutput
   272  	ToAgreementMapOutputWithContext(context.Context) AgreementMapOutput
   273  }
   274  
   275  type AgreementMap map[string]AgreementInput
   276  
   277  func (AgreementMap) ElementType() reflect.Type {
   278  	return reflect.TypeOf((*map[string]*Agreement)(nil)).Elem()
   279  }
   280  
   281  func (i AgreementMap) ToAgreementMapOutput() AgreementMapOutput {
   282  	return i.ToAgreementMapOutputWithContext(context.Background())
   283  }
   284  
   285  func (i AgreementMap) ToAgreementMapOutputWithContext(ctx context.Context) AgreementMapOutput {
   286  	return pulumi.ToOutputWithContext(ctx, i).(AgreementMapOutput)
   287  }
   288  
   289  type AgreementOutput struct{ *pulumi.OutputState }
   290  
   291  func (AgreementOutput) ElementType() reflect.Type {
   292  	return reflect.TypeOf((**Agreement)(nil)).Elem()
   293  }
   294  
   295  func (o AgreementOutput) ToAgreementOutput() AgreementOutput {
   296  	return o
   297  }
   298  
   299  func (o AgreementOutput) ToAgreementOutputWithContext(ctx context.Context) AgreementOutput {
   300  	return o
   301  }
   302  
   303  // The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   304  func (o AgreementOutput) AccessRole() pulumi.StringOutput {
   305  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.AccessRole }).(pulumi.StringOutput)
   306  }
   307  
   308  // The unique identifier for the AS2 agreement.
   309  func (o AgreementOutput) AgreementId() pulumi.StringOutput {
   310  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.AgreementId }).(pulumi.StringOutput)
   311  }
   312  
   313  // The ARN of the agreement.
   314  func (o AgreementOutput) Arn() pulumi.StringOutput {
   315  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   316  }
   317  
   318  // The landing directory for the files transferred by using the AS2 protocol.
   319  func (o AgreementOutput) BaseDirectory() pulumi.StringOutput {
   320  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.BaseDirectory }).(pulumi.StringOutput)
   321  }
   322  
   323  // The Optional description of the transdfer.
   324  func (o AgreementOutput) Description() pulumi.StringPtrOutput {
   325  	return o.ApplyT(func(v *Agreement) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   326  }
   327  
   328  // The unique identifier for the AS2 local profile.
   329  func (o AgreementOutput) LocalProfileId() pulumi.StringOutput {
   330  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.LocalProfileId }).(pulumi.StringOutput)
   331  }
   332  
   333  // The unique identifier for the AS2 partner profile.
   334  func (o AgreementOutput) PartnerProfileId() pulumi.StringOutput {
   335  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.PartnerProfileId }).(pulumi.StringOutput)
   336  }
   337  
   338  // The unique server identifier for the server instance. This is the specific server the agreement uses.
   339  func (o AgreementOutput) ServerId() pulumi.StringOutput {
   340  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.ServerId }).(pulumi.StringOutput)
   341  }
   342  
   343  func (o AgreementOutput) Status() pulumi.StringOutput {
   344  	return o.ApplyT(func(v *Agreement) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   345  }
   346  
   347  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   348  func (o AgreementOutput) Tags() pulumi.StringMapOutput {
   349  	return o.ApplyT(func(v *Agreement) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   350  }
   351  
   352  // Deprecated: Please use `tags` instead.
   353  func (o AgreementOutput) TagsAll() pulumi.StringMapOutput {
   354  	return o.ApplyT(func(v *Agreement) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   355  }
   356  
   357  type AgreementArrayOutput struct{ *pulumi.OutputState }
   358  
   359  func (AgreementArrayOutput) ElementType() reflect.Type {
   360  	return reflect.TypeOf((*[]*Agreement)(nil)).Elem()
   361  }
   362  
   363  func (o AgreementArrayOutput) ToAgreementArrayOutput() AgreementArrayOutput {
   364  	return o
   365  }
   366  
   367  func (o AgreementArrayOutput) ToAgreementArrayOutputWithContext(ctx context.Context) AgreementArrayOutput {
   368  	return o
   369  }
   370  
   371  func (o AgreementArrayOutput) Index(i pulumi.IntInput) AgreementOutput {
   372  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Agreement {
   373  		return vs[0].([]*Agreement)[vs[1].(int)]
   374  	}).(AgreementOutput)
   375  }
   376  
   377  type AgreementMapOutput struct{ *pulumi.OutputState }
   378  
   379  func (AgreementMapOutput) ElementType() reflect.Type {
   380  	return reflect.TypeOf((*map[string]*Agreement)(nil)).Elem()
   381  }
   382  
   383  func (o AgreementMapOutput) ToAgreementMapOutput() AgreementMapOutput {
   384  	return o
   385  }
   386  
   387  func (o AgreementMapOutput) ToAgreementMapOutputWithContext(ctx context.Context) AgreementMapOutput {
   388  	return o
   389  }
   390  
   391  func (o AgreementMapOutput) MapIndex(k pulumi.StringInput) AgreementOutput {
   392  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Agreement {
   393  		return vs[0].(map[string]*Agreement)[vs[1].(string)]
   394  	}).(AgreementOutput)
   395  }
   396  
   397  func init() {
   398  	pulumi.RegisterInputType(reflect.TypeOf((*AgreementInput)(nil)).Elem(), &Agreement{})
   399  	pulumi.RegisterInputType(reflect.TypeOf((*AgreementArrayInput)(nil)).Elem(), AgreementArray{})
   400  	pulumi.RegisterInputType(reflect.TypeOf((*AgreementMapInput)(nil)).Elem(), AgreementMap{})
   401  	pulumi.RegisterOutputType(AgreementOutput{})
   402  	pulumi.RegisterOutputType(AgreementArrayOutput{})
   403  	pulumi.RegisterOutputType(AgreementMapOutput{})
   404  }