github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/transfer/certificate.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 Certificate resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // ## Import
    20  //
    21  // Using `pulumi import`, import Transfer AS2 Certificate using the `certificate_id`. For example:
    22  //
    23  // ```sh
    24  // $ pulumi import aws:transfer/certificate:Certificate example c-4221a88afd5f4362a
    25  // ```
    26  type Certificate struct {
    27  	pulumi.CustomResourceState
    28  
    29  	// An date when the certificate becomes active
    30  	ActiveDate pulumi.StringOutput `pulumi:"activeDate"`
    31  	// The ARN of the certificate
    32  	Arn pulumi.StringOutput `pulumi:"arn"`
    33  	// The valid certificate file required for the transfer.
    34  	Certificate pulumi.StringOutput `pulumi:"certificate"`
    35  	// The optional list of certificate that make up the chain for the certificate that is being imported.
    36  	CertificateChain pulumi.StringPtrOutput `pulumi:"certificateChain"`
    37  	// The unique identifier for the AS2 certificate
    38  	CertificateId pulumi.StringOutput `pulumi:"certificateId"`
    39  	// A short description that helps identify the certificate.
    40  	Description pulumi.StringPtrOutput `pulumi:"description"`
    41  	// An date when the certificate becomes inactive
    42  	InactiveDate pulumi.StringOutput `pulumi:"inactiveDate"`
    43  	// The private key associated with the certificate being imported.
    44  	PrivateKey pulumi.StringPtrOutput `pulumi:"privateKey"`
    45  	// 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.
    46  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    47  	// Deprecated: Please use `tags` instead.
    48  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    49  	// Specifies if a certificate is being used for signing or encryption. The valid values are SIGNING and ENCRYPTION.
    50  	Usage pulumi.StringOutput `pulumi:"usage"`
    51  }
    52  
    53  // NewCertificate registers a new resource with the given unique name, arguments, and options.
    54  func NewCertificate(ctx *pulumi.Context,
    55  	name string, args *CertificateArgs, opts ...pulumi.ResourceOption) (*Certificate, error) {
    56  	if args == nil {
    57  		return nil, errors.New("missing one or more required arguments")
    58  	}
    59  
    60  	if args.Certificate == nil {
    61  		return nil, errors.New("invalid value for required argument 'Certificate'")
    62  	}
    63  	if args.Usage == nil {
    64  		return nil, errors.New("invalid value for required argument 'Usage'")
    65  	}
    66  	if args.Certificate != nil {
    67  		args.Certificate = pulumi.ToSecret(args.Certificate).(pulumi.StringInput)
    68  	}
    69  	if args.CertificateChain != nil {
    70  		args.CertificateChain = pulumi.ToSecret(args.CertificateChain).(pulumi.StringPtrInput)
    71  	}
    72  	if args.PrivateKey != nil {
    73  		args.PrivateKey = pulumi.ToSecret(args.PrivateKey).(pulumi.StringPtrInput)
    74  	}
    75  	secrets := pulumi.AdditionalSecretOutputs([]string{
    76  		"certificate",
    77  		"certificateChain",
    78  		"privateKey",
    79  	})
    80  	opts = append(opts, secrets)
    81  	opts = internal.PkgResourceDefaultOpts(opts)
    82  	var resource Certificate
    83  	err := ctx.RegisterResource("aws:transfer/certificate:Certificate", name, args, &resource, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &resource, nil
    88  }
    89  
    90  // GetCertificate gets an existing Certificate resource's state with the given name, ID, and optional
    91  // state properties that are used to uniquely qualify the lookup (nil if not required).
    92  func GetCertificate(ctx *pulumi.Context,
    93  	name string, id pulumi.IDInput, state *CertificateState, opts ...pulumi.ResourceOption) (*Certificate, error) {
    94  	var resource Certificate
    95  	err := ctx.ReadResource("aws:transfer/certificate:Certificate", name, id, state, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // Input properties used for looking up and filtering Certificate resources.
   103  type certificateState struct {
   104  	// An date when the certificate becomes active
   105  	ActiveDate *string `pulumi:"activeDate"`
   106  	// The ARN of the certificate
   107  	Arn *string `pulumi:"arn"`
   108  	// The valid certificate file required for the transfer.
   109  	Certificate *string `pulumi:"certificate"`
   110  	// The optional list of certificate that make up the chain for the certificate that is being imported.
   111  	CertificateChain *string `pulumi:"certificateChain"`
   112  	// The unique identifier for the AS2 certificate
   113  	CertificateId *string `pulumi:"certificateId"`
   114  	// A short description that helps identify the certificate.
   115  	Description *string `pulumi:"description"`
   116  	// An date when the certificate becomes inactive
   117  	InactiveDate *string `pulumi:"inactiveDate"`
   118  	// The private key associated with the certificate being imported.
   119  	PrivateKey *string `pulumi:"privateKey"`
   120  	// 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.
   121  	Tags map[string]string `pulumi:"tags"`
   122  	// Deprecated: Please use `tags` instead.
   123  	TagsAll map[string]string `pulumi:"tagsAll"`
   124  	// Specifies if a certificate is being used for signing or encryption. The valid values are SIGNING and ENCRYPTION.
   125  	Usage *string `pulumi:"usage"`
   126  }
   127  
   128  type CertificateState struct {
   129  	// An date when the certificate becomes active
   130  	ActiveDate pulumi.StringPtrInput
   131  	// The ARN of the certificate
   132  	Arn pulumi.StringPtrInput
   133  	// The valid certificate file required for the transfer.
   134  	Certificate pulumi.StringPtrInput
   135  	// The optional list of certificate that make up the chain for the certificate that is being imported.
   136  	CertificateChain pulumi.StringPtrInput
   137  	// The unique identifier for the AS2 certificate
   138  	CertificateId pulumi.StringPtrInput
   139  	// A short description that helps identify the certificate.
   140  	Description pulumi.StringPtrInput
   141  	// An date when the certificate becomes inactive
   142  	InactiveDate pulumi.StringPtrInput
   143  	// The private key associated with the certificate being imported.
   144  	PrivateKey pulumi.StringPtrInput
   145  	// 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.
   146  	Tags pulumi.StringMapInput
   147  	// Deprecated: Please use `tags` instead.
   148  	TagsAll pulumi.StringMapInput
   149  	// Specifies if a certificate is being used for signing or encryption. The valid values are SIGNING and ENCRYPTION.
   150  	Usage pulumi.StringPtrInput
   151  }
   152  
   153  func (CertificateState) ElementType() reflect.Type {
   154  	return reflect.TypeOf((*certificateState)(nil)).Elem()
   155  }
   156  
   157  type certificateArgs struct {
   158  	// The valid certificate file required for the transfer.
   159  	Certificate string `pulumi:"certificate"`
   160  	// The optional list of certificate that make up the chain for the certificate that is being imported.
   161  	CertificateChain *string `pulumi:"certificateChain"`
   162  	// A short description that helps identify the certificate.
   163  	Description *string `pulumi:"description"`
   164  	// The private key associated with the certificate being imported.
   165  	PrivateKey *string `pulumi:"privateKey"`
   166  	// 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.
   167  	Tags map[string]string `pulumi:"tags"`
   168  	// Specifies if a certificate is being used for signing or encryption. The valid values are SIGNING and ENCRYPTION.
   169  	Usage string `pulumi:"usage"`
   170  }
   171  
   172  // The set of arguments for constructing a Certificate resource.
   173  type CertificateArgs struct {
   174  	// The valid certificate file required for the transfer.
   175  	Certificate pulumi.StringInput
   176  	// The optional list of certificate that make up the chain for the certificate that is being imported.
   177  	CertificateChain pulumi.StringPtrInput
   178  	// A short description that helps identify the certificate.
   179  	Description pulumi.StringPtrInput
   180  	// The private key associated with the certificate being imported.
   181  	PrivateKey pulumi.StringPtrInput
   182  	// 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.
   183  	Tags pulumi.StringMapInput
   184  	// Specifies if a certificate is being used for signing or encryption. The valid values are SIGNING and ENCRYPTION.
   185  	Usage pulumi.StringInput
   186  }
   187  
   188  func (CertificateArgs) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*certificateArgs)(nil)).Elem()
   190  }
   191  
   192  type CertificateInput interface {
   193  	pulumi.Input
   194  
   195  	ToCertificateOutput() CertificateOutput
   196  	ToCertificateOutputWithContext(ctx context.Context) CertificateOutput
   197  }
   198  
   199  func (*Certificate) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**Certificate)(nil)).Elem()
   201  }
   202  
   203  func (i *Certificate) ToCertificateOutput() CertificateOutput {
   204  	return i.ToCertificateOutputWithContext(context.Background())
   205  }
   206  
   207  func (i *Certificate) ToCertificateOutputWithContext(ctx context.Context) CertificateOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(CertificateOutput)
   209  }
   210  
   211  // CertificateArrayInput is an input type that accepts CertificateArray and CertificateArrayOutput values.
   212  // You can construct a concrete instance of `CertificateArrayInput` via:
   213  //
   214  //	CertificateArray{ CertificateArgs{...} }
   215  type CertificateArrayInput interface {
   216  	pulumi.Input
   217  
   218  	ToCertificateArrayOutput() CertificateArrayOutput
   219  	ToCertificateArrayOutputWithContext(context.Context) CertificateArrayOutput
   220  }
   221  
   222  type CertificateArray []CertificateInput
   223  
   224  func (CertificateArray) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*[]*Certificate)(nil)).Elem()
   226  }
   227  
   228  func (i CertificateArray) ToCertificateArrayOutput() CertificateArrayOutput {
   229  	return i.ToCertificateArrayOutputWithContext(context.Background())
   230  }
   231  
   232  func (i CertificateArray) ToCertificateArrayOutputWithContext(ctx context.Context) CertificateArrayOutput {
   233  	return pulumi.ToOutputWithContext(ctx, i).(CertificateArrayOutput)
   234  }
   235  
   236  // CertificateMapInput is an input type that accepts CertificateMap and CertificateMapOutput values.
   237  // You can construct a concrete instance of `CertificateMapInput` via:
   238  //
   239  //	CertificateMap{ "key": CertificateArgs{...} }
   240  type CertificateMapInput interface {
   241  	pulumi.Input
   242  
   243  	ToCertificateMapOutput() CertificateMapOutput
   244  	ToCertificateMapOutputWithContext(context.Context) CertificateMapOutput
   245  }
   246  
   247  type CertificateMap map[string]CertificateInput
   248  
   249  func (CertificateMap) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*map[string]*Certificate)(nil)).Elem()
   251  }
   252  
   253  func (i CertificateMap) ToCertificateMapOutput() CertificateMapOutput {
   254  	return i.ToCertificateMapOutputWithContext(context.Background())
   255  }
   256  
   257  func (i CertificateMap) ToCertificateMapOutputWithContext(ctx context.Context) CertificateMapOutput {
   258  	return pulumi.ToOutputWithContext(ctx, i).(CertificateMapOutput)
   259  }
   260  
   261  type CertificateOutput struct{ *pulumi.OutputState }
   262  
   263  func (CertificateOutput) ElementType() reflect.Type {
   264  	return reflect.TypeOf((**Certificate)(nil)).Elem()
   265  }
   266  
   267  func (o CertificateOutput) ToCertificateOutput() CertificateOutput {
   268  	return o
   269  }
   270  
   271  func (o CertificateOutput) ToCertificateOutputWithContext(ctx context.Context) CertificateOutput {
   272  	return o
   273  }
   274  
   275  // An date when the certificate becomes active
   276  func (o CertificateOutput) ActiveDate() pulumi.StringOutput {
   277  	return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.ActiveDate }).(pulumi.StringOutput)
   278  }
   279  
   280  // The ARN of the certificate
   281  func (o CertificateOutput) Arn() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   283  }
   284  
   285  // The valid certificate file required for the transfer.
   286  func (o CertificateOutput) Certificate() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Certificate }).(pulumi.StringOutput)
   288  }
   289  
   290  // The optional list of certificate that make up the chain for the certificate that is being imported.
   291  func (o CertificateOutput) CertificateChain() pulumi.StringPtrOutput {
   292  	return o.ApplyT(func(v *Certificate) pulumi.StringPtrOutput { return v.CertificateChain }).(pulumi.StringPtrOutput)
   293  }
   294  
   295  // The unique identifier for the AS2 certificate
   296  func (o CertificateOutput) CertificateId() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.CertificateId }).(pulumi.StringOutput)
   298  }
   299  
   300  // A short description that helps identify the certificate.
   301  func (o CertificateOutput) Description() pulumi.StringPtrOutput {
   302  	return o.ApplyT(func(v *Certificate) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   303  }
   304  
   305  // An date when the certificate becomes inactive
   306  func (o CertificateOutput) InactiveDate() pulumi.StringOutput {
   307  	return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.InactiveDate }).(pulumi.StringOutput)
   308  }
   309  
   310  // The private key associated with the certificate being imported.
   311  func (o CertificateOutput) PrivateKey() pulumi.StringPtrOutput {
   312  	return o.ApplyT(func(v *Certificate) pulumi.StringPtrOutput { return v.PrivateKey }).(pulumi.StringPtrOutput)
   313  }
   314  
   315  // 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.
   316  func (o CertificateOutput) Tags() pulumi.StringMapOutput {
   317  	return o.ApplyT(func(v *Certificate) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   318  }
   319  
   320  // Deprecated: Please use `tags` instead.
   321  func (o CertificateOutput) TagsAll() pulumi.StringMapOutput {
   322  	return o.ApplyT(func(v *Certificate) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   323  }
   324  
   325  // Specifies if a certificate is being used for signing or encryption. The valid values are SIGNING and ENCRYPTION.
   326  func (o CertificateOutput) Usage() pulumi.StringOutput {
   327  	return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Usage }).(pulumi.StringOutput)
   328  }
   329  
   330  type CertificateArrayOutput struct{ *pulumi.OutputState }
   331  
   332  func (CertificateArrayOutput) ElementType() reflect.Type {
   333  	return reflect.TypeOf((*[]*Certificate)(nil)).Elem()
   334  }
   335  
   336  func (o CertificateArrayOutput) ToCertificateArrayOutput() CertificateArrayOutput {
   337  	return o
   338  }
   339  
   340  func (o CertificateArrayOutput) ToCertificateArrayOutputWithContext(ctx context.Context) CertificateArrayOutput {
   341  	return o
   342  }
   343  
   344  func (o CertificateArrayOutput) Index(i pulumi.IntInput) CertificateOutput {
   345  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Certificate {
   346  		return vs[0].([]*Certificate)[vs[1].(int)]
   347  	}).(CertificateOutput)
   348  }
   349  
   350  type CertificateMapOutput struct{ *pulumi.OutputState }
   351  
   352  func (CertificateMapOutput) ElementType() reflect.Type {
   353  	return reflect.TypeOf((*map[string]*Certificate)(nil)).Elem()
   354  }
   355  
   356  func (o CertificateMapOutput) ToCertificateMapOutput() CertificateMapOutput {
   357  	return o
   358  }
   359  
   360  func (o CertificateMapOutput) ToCertificateMapOutputWithContext(ctx context.Context) CertificateMapOutput {
   361  	return o
   362  }
   363  
   364  func (o CertificateMapOutput) MapIndex(k pulumi.StringInput) CertificateOutput {
   365  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Certificate {
   366  		return vs[0].(map[string]*Certificate)[vs[1].(string)]
   367  	}).(CertificateOutput)
   368  }
   369  
   370  func init() {
   371  	pulumi.RegisterInputType(reflect.TypeOf((*CertificateInput)(nil)).Elem(), &Certificate{})
   372  	pulumi.RegisterInputType(reflect.TypeOf((*CertificateArrayInput)(nil)).Elem(), CertificateArray{})
   373  	pulumi.RegisterInputType(reflect.TypeOf((*CertificateMapInput)(nil)).Elem(), CertificateMap{})
   374  	pulumi.RegisterOutputType(CertificateOutput{})
   375  	pulumi.RegisterOutputType(CertificateArrayOutput{})
   376  	pulumi.RegisterOutputType(CertificateMapOutput{})
   377  }