github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/transfer/connector.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 Connector 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.NewConnector(ctx, "example", &transfer.ConnectorArgs{
    35  //				AccessRole: pulumi.Any(test.Arn),
    36  //				As2Config: &transfer.ConnectorAs2ConfigArgs{
    37  //					Compression:         pulumi.String("DISABLED"),
    38  //					EncryptionAlgorithm: pulumi.String("AWS128_CBC"),
    39  //					MessageSubject:      pulumi.String("For Connector"),
    40  //					LocalProfileId:      pulumi.Any(local.ProfileId),
    41  //					MdnResponse:         pulumi.String("NONE"),
    42  //					MdnSigningAlgorithm: pulumi.String("NONE"),
    43  //					PartnerProfileId:    pulumi.Any(partner.ProfileId),
    44  //					SigningAlgorithm:    pulumi.String("NONE"),
    45  //				},
    46  //				Url: pulumi.String("http://www.test.com"),
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			return nil
    52  //		})
    53  //	}
    54  //
    55  // ```
    56  // <!--End PulumiCodeChooser -->
    57  //
    58  // ### SFTP Connector
    59  //
    60  // <!--Start PulumiCodeChooser -->
    61  // ```go
    62  // package main
    63  //
    64  // import (
    65  //
    66  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transfer"
    67  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    68  //
    69  // )
    70  //
    71  //	func main() {
    72  //		pulumi.Run(func(ctx *pulumi.Context) error {
    73  //			_, err := transfer.NewConnector(ctx, "example", &transfer.ConnectorArgs{
    74  //				AccessRole: pulumi.Any(test.Arn),
    75  //				SftpConfig: &transfer.ConnectorSftpConfigArgs{
    76  //					TrustedHostKeys: pulumi.StringArray{
    77  //						pulumi.String("ssh-rsa AAAAB3NYourKeysHere"),
    78  //					},
    79  //					UserSecretId: pulumi.Any(exampleAwsSecretsmanagerSecret.Id),
    80  //				},
    81  //				Url: pulumi.String("sftp://test.com"),
    82  //			})
    83  //			if err != nil {
    84  //				return err
    85  //			}
    86  //			return nil
    87  //		})
    88  //	}
    89  //
    90  // ```
    91  // <!--End PulumiCodeChooser -->
    92  //
    93  // ## Import
    94  //
    95  // Using `pulumi import`, import Transfer AS2 Connector using the `connector_id`. For example:
    96  //
    97  // ```sh
    98  // $ pulumi import aws:transfer/connector:Connector example c-4221a88afd5f4362a
    99  // ```
   100  type Connector struct {
   101  	pulumi.CustomResourceState
   102  
   103  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   104  	AccessRole pulumi.StringOutput `pulumi:"accessRole"`
   105  	// The ARN of the connector.
   106  	Arn pulumi.StringOutput `pulumi:"arn"`
   107  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   108  	As2Config ConnectorAs2ConfigPtrOutput `pulumi:"as2Config"`
   109  	// The unique identifier for the AS2 profile or SFTP Profile.
   110  	ConnectorId pulumi.StringOutput `pulumi:"connectorId"`
   111  	// The IAM Role which is required for allowing the connector to turn on CloudWatch logging for Amazon S3 events.
   112  	LoggingRole pulumi.StringPtrOutput `pulumi:"loggingRole"`
   113  	// Name of the security policy for the connector.
   114  	SecurityPolicyName pulumi.StringOutput `pulumi:"securityPolicyName"`
   115  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   116  	SftpConfig ConnectorSftpConfigPtrOutput `pulumi:"sftpConfig"`
   117  	// 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.
   118  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   119  	// Deprecated: Please use `tags` instead.
   120  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   121  	// The URL of the partners AS2 endpoint or SFTP endpoint.
   122  	Url pulumi.StringOutput `pulumi:"url"`
   123  }
   124  
   125  // NewConnector registers a new resource with the given unique name, arguments, and options.
   126  func NewConnector(ctx *pulumi.Context,
   127  	name string, args *ConnectorArgs, opts ...pulumi.ResourceOption) (*Connector, error) {
   128  	if args == nil {
   129  		return nil, errors.New("missing one or more required arguments")
   130  	}
   131  
   132  	if args.AccessRole == nil {
   133  		return nil, errors.New("invalid value for required argument 'AccessRole'")
   134  	}
   135  	if args.Url == nil {
   136  		return nil, errors.New("invalid value for required argument 'Url'")
   137  	}
   138  	opts = internal.PkgResourceDefaultOpts(opts)
   139  	var resource Connector
   140  	err := ctx.RegisterResource("aws:transfer/connector:Connector", name, args, &resource, opts...)
   141  	if err != nil {
   142  		return nil, err
   143  	}
   144  	return &resource, nil
   145  }
   146  
   147  // GetConnector gets an existing Connector resource's state with the given name, ID, and optional
   148  // state properties that are used to uniquely qualify the lookup (nil if not required).
   149  func GetConnector(ctx *pulumi.Context,
   150  	name string, id pulumi.IDInput, state *ConnectorState, opts ...pulumi.ResourceOption) (*Connector, error) {
   151  	var resource Connector
   152  	err := ctx.ReadResource("aws:transfer/connector:Connector", name, id, state, &resource, opts...)
   153  	if err != nil {
   154  		return nil, err
   155  	}
   156  	return &resource, nil
   157  }
   158  
   159  // Input properties used for looking up and filtering Connector resources.
   160  type connectorState struct {
   161  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   162  	AccessRole *string `pulumi:"accessRole"`
   163  	// The ARN of the connector.
   164  	Arn *string `pulumi:"arn"`
   165  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   166  	As2Config *ConnectorAs2Config `pulumi:"as2Config"`
   167  	// The unique identifier for the AS2 profile or SFTP Profile.
   168  	ConnectorId *string `pulumi:"connectorId"`
   169  	// The IAM Role which is required for allowing the connector to turn on CloudWatch logging for Amazon S3 events.
   170  	LoggingRole *string `pulumi:"loggingRole"`
   171  	// Name of the security policy for the connector.
   172  	SecurityPolicyName *string `pulumi:"securityPolicyName"`
   173  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   174  	SftpConfig *ConnectorSftpConfig `pulumi:"sftpConfig"`
   175  	// 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.
   176  	Tags map[string]string `pulumi:"tags"`
   177  	// Deprecated: Please use `tags` instead.
   178  	TagsAll map[string]string `pulumi:"tagsAll"`
   179  	// The URL of the partners AS2 endpoint or SFTP endpoint.
   180  	Url *string `pulumi:"url"`
   181  }
   182  
   183  type ConnectorState struct {
   184  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   185  	AccessRole pulumi.StringPtrInput
   186  	// The ARN of the connector.
   187  	Arn pulumi.StringPtrInput
   188  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   189  	As2Config ConnectorAs2ConfigPtrInput
   190  	// The unique identifier for the AS2 profile or SFTP Profile.
   191  	ConnectorId pulumi.StringPtrInput
   192  	// The IAM Role which is required for allowing the connector to turn on CloudWatch logging for Amazon S3 events.
   193  	LoggingRole pulumi.StringPtrInput
   194  	// Name of the security policy for the connector.
   195  	SecurityPolicyName pulumi.StringPtrInput
   196  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   197  	SftpConfig ConnectorSftpConfigPtrInput
   198  	// 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.
   199  	Tags pulumi.StringMapInput
   200  	// Deprecated: Please use `tags` instead.
   201  	TagsAll pulumi.StringMapInput
   202  	// The URL of the partners AS2 endpoint or SFTP endpoint.
   203  	Url pulumi.StringPtrInput
   204  }
   205  
   206  func (ConnectorState) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*connectorState)(nil)).Elem()
   208  }
   209  
   210  type connectorArgs struct {
   211  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   212  	AccessRole string `pulumi:"accessRole"`
   213  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   214  	As2Config *ConnectorAs2Config `pulumi:"as2Config"`
   215  	// The IAM Role which is required for allowing the connector to turn on CloudWatch logging for Amazon S3 events.
   216  	LoggingRole *string `pulumi:"loggingRole"`
   217  	// Name of the security policy for the connector.
   218  	SecurityPolicyName *string `pulumi:"securityPolicyName"`
   219  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   220  	SftpConfig *ConnectorSftpConfig `pulumi:"sftpConfig"`
   221  	// 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.
   222  	Tags map[string]string `pulumi:"tags"`
   223  	// The URL of the partners AS2 endpoint or SFTP endpoint.
   224  	Url string `pulumi:"url"`
   225  }
   226  
   227  // The set of arguments for constructing a Connector resource.
   228  type ConnectorArgs struct {
   229  	// The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   230  	AccessRole pulumi.StringInput
   231  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   232  	As2Config ConnectorAs2ConfigPtrInput
   233  	// The IAM Role which is required for allowing the connector to turn on CloudWatch logging for Amazon S3 events.
   234  	LoggingRole pulumi.StringPtrInput
   235  	// Name of the security policy for the connector.
   236  	SecurityPolicyName pulumi.StringPtrInput
   237  	// Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   238  	SftpConfig ConnectorSftpConfigPtrInput
   239  	// 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.
   240  	Tags pulumi.StringMapInput
   241  	// The URL of the partners AS2 endpoint or SFTP endpoint.
   242  	Url pulumi.StringInput
   243  }
   244  
   245  func (ConnectorArgs) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*connectorArgs)(nil)).Elem()
   247  }
   248  
   249  type ConnectorInput interface {
   250  	pulumi.Input
   251  
   252  	ToConnectorOutput() ConnectorOutput
   253  	ToConnectorOutputWithContext(ctx context.Context) ConnectorOutput
   254  }
   255  
   256  func (*Connector) ElementType() reflect.Type {
   257  	return reflect.TypeOf((**Connector)(nil)).Elem()
   258  }
   259  
   260  func (i *Connector) ToConnectorOutput() ConnectorOutput {
   261  	return i.ToConnectorOutputWithContext(context.Background())
   262  }
   263  
   264  func (i *Connector) ToConnectorOutputWithContext(ctx context.Context) ConnectorOutput {
   265  	return pulumi.ToOutputWithContext(ctx, i).(ConnectorOutput)
   266  }
   267  
   268  // ConnectorArrayInput is an input type that accepts ConnectorArray and ConnectorArrayOutput values.
   269  // You can construct a concrete instance of `ConnectorArrayInput` via:
   270  //
   271  //	ConnectorArray{ ConnectorArgs{...} }
   272  type ConnectorArrayInput interface {
   273  	pulumi.Input
   274  
   275  	ToConnectorArrayOutput() ConnectorArrayOutput
   276  	ToConnectorArrayOutputWithContext(context.Context) ConnectorArrayOutput
   277  }
   278  
   279  type ConnectorArray []ConnectorInput
   280  
   281  func (ConnectorArray) ElementType() reflect.Type {
   282  	return reflect.TypeOf((*[]*Connector)(nil)).Elem()
   283  }
   284  
   285  func (i ConnectorArray) ToConnectorArrayOutput() ConnectorArrayOutput {
   286  	return i.ToConnectorArrayOutputWithContext(context.Background())
   287  }
   288  
   289  func (i ConnectorArray) ToConnectorArrayOutputWithContext(ctx context.Context) ConnectorArrayOutput {
   290  	return pulumi.ToOutputWithContext(ctx, i).(ConnectorArrayOutput)
   291  }
   292  
   293  // ConnectorMapInput is an input type that accepts ConnectorMap and ConnectorMapOutput values.
   294  // You can construct a concrete instance of `ConnectorMapInput` via:
   295  //
   296  //	ConnectorMap{ "key": ConnectorArgs{...} }
   297  type ConnectorMapInput interface {
   298  	pulumi.Input
   299  
   300  	ToConnectorMapOutput() ConnectorMapOutput
   301  	ToConnectorMapOutputWithContext(context.Context) ConnectorMapOutput
   302  }
   303  
   304  type ConnectorMap map[string]ConnectorInput
   305  
   306  func (ConnectorMap) ElementType() reflect.Type {
   307  	return reflect.TypeOf((*map[string]*Connector)(nil)).Elem()
   308  }
   309  
   310  func (i ConnectorMap) ToConnectorMapOutput() ConnectorMapOutput {
   311  	return i.ToConnectorMapOutputWithContext(context.Background())
   312  }
   313  
   314  func (i ConnectorMap) ToConnectorMapOutputWithContext(ctx context.Context) ConnectorMapOutput {
   315  	return pulumi.ToOutputWithContext(ctx, i).(ConnectorMapOutput)
   316  }
   317  
   318  type ConnectorOutput struct{ *pulumi.OutputState }
   319  
   320  func (ConnectorOutput) ElementType() reflect.Type {
   321  	return reflect.TypeOf((**Connector)(nil)).Elem()
   322  }
   323  
   324  func (o ConnectorOutput) ToConnectorOutput() ConnectorOutput {
   325  	return o
   326  }
   327  
   328  func (o ConnectorOutput) ToConnectorOutputWithContext(ctx context.Context) ConnectorOutput {
   329  	return o
   330  }
   331  
   332  // The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
   333  func (o ConnectorOutput) AccessRole() pulumi.StringOutput {
   334  	return o.ApplyT(func(v *Connector) pulumi.StringOutput { return v.AccessRole }).(pulumi.StringOutput)
   335  }
   336  
   337  // The ARN of the connector.
   338  func (o ConnectorOutput) Arn() pulumi.StringOutput {
   339  	return o.ApplyT(func(v *Connector) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   340  }
   341  
   342  // Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   343  func (o ConnectorOutput) As2Config() ConnectorAs2ConfigPtrOutput {
   344  	return o.ApplyT(func(v *Connector) ConnectorAs2ConfigPtrOutput { return v.As2Config }).(ConnectorAs2ConfigPtrOutput)
   345  }
   346  
   347  // The unique identifier for the AS2 profile or SFTP Profile.
   348  func (o ConnectorOutput) ConnectorId() pulumi.StringOutput {
   349  	return o.ApplyT(func(v *Connector) pulumi.StringOutput { return v.ConnectorId }).(pulumi.StringOutput)
   350  }
   351  
   352  // The IAM Role which is required for allowing the connector to turn on CloudWatch logging for Amazon S3 events.
   353  func (o ConnectorOutput) LoggingRole() pulumi.StringPtrOutput {
   354  	return o.ApplyT(func(v *Connector) pulumi.StringPtrOutput { return v.LoggingRole }).(pulumi.StringPtrOutput)
   355  }
   356  
   357  // Name of the security policy for the connector.
   358  func (o ConnectorOutput) SecurityPolicyName() pulumi.StringOutput {
   359  	return o.ApplyT(func(v *Connector) pulumi.StringOutput { return v.SecurityPolicyName }).(pulumi.StringOutput)
   360  }
   361  
   362  // Either SFTP or AS2 is configured.The parameters to configure for the connector object. Fields documented below.
   363  func (o ConnectorOutput) SftpConfig() ConnectorSftpConfigPtrOutput {
   364  	return o.ApplyT(func(v *Connector) ConnectorSftpConfigPtrOutput { return v.SftpConfig }).(ConnectorSftpConfigPtrOutput)
   365  }
   366  
   367  // 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.
   368  func (o ConnectorOutput) Tags() pulumi.StringMapOutput {
   369  	return o.ApplyT(func(v *Connector) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   370  }
   371  
   372  // Deprecated: Please use `tags` instead.
   373  func (o ConnectorOutput) TagsAll() pulumi.StringMapOutput {
   374  	return o.ApplyT(func(v *Connector) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   375  }
   376  
   377  // The URL of the partners AS2 endpoint or SFTP endpoint.
   378  func (o ConnectorOutput) Url() pulumi.StringOutput {
   379  	return o.ApplyT(func(v *Connector) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
   380  }
   381  
   382  type ConnectorArrayOutput struct{ *pulumi.OutputState }
   383  
   384  func (ConnectorArrayOutput) ElementType() reflect.Type {
   385  	return reflect.TypeOf((*[]*Connector)(nil)).Elem()
   386  }
   387  
   388  func (o ConnectorArrayOutput) ToConnectorArrayOutput() ConnectorArrayOutput {
   389  	return o
   390  }
   391  
   392  func (o ConnectorArrayOutput) ToConnectorArrayOutputWithContext(ctx context.Context) ConnectorArrayOutput {
   393  	return o
   394  }
   395  
   396  func (o ConnectorArrayOutput) Index(i pulumi.IntInput) ConnectorOutput {
   397  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Connector {
   398  		return vs[0].([]*Connector)[vs[1].(int)]
   399  	}).(ConnectorOutput)
   400  }
   401  
   402  type ConnectorMapOutput struct{ *pulumi.OutputState }
   403  
   404  func (ConnectorMapOutput) ElementType() reflect.Type {
   405  	return reflect.TypeOf((*map[string]*Connector)(nil)).Elem()
   406  }
   407  
   408  func (o ConnectorMapOutput) ToConnectorMapOutput() ConnectorMapOutput {
   409  	return o
   410  }
   411  
   412  func (o ConnectorMapOutput) ToConnectorMapOutputWithContext(ctx context.Context) ConnectorMapOutput {
   413  	return o
   414  }
   415  
   416  func (o ConnectorMapOutput) MapIndex(k pulumi.StringInput) ConnectorOutput {
   417  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Connector {
   418  		return vs[0].(map[string]*Connector)[vs[1].(string)]
   419  	}).(ConnectorOutput)
   420  }
   421  
   422  func init() {
   423  	pulumi.RegisterInputType(reflect.TypeOf((*ConnectorInput)(nil)).Elem(), &Connector{})
   424  	pulumi.RegisterInputType(reflect.TypeOf((*ConnectorArrayInput)(nil)).Elem(), ConnectorArray{})
   425  	pulumi.RegisterInputType(reflect.TypeOf((*ConnectorMapInput)(nil)).Elem(), ConnectorMap{})
   426  	pulumi.RegisterOutputType(ConnectorOutput{})
   427  	pulumi.RegisterOutputType(ConnectorArrayOutput{})
   428  	pulumi.RegisterOutputType(ConnectorMapOutput{})
   429  }