github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rds/getCertificate.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 rds
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Information about an RDS Certificate.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := rds.GetCertificate(ctx, &rds.GetCertificateArgs{
    32  //				LatestValidTill: pulumi.BoolRef(true),
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func GetCertificate(ctx *pulumi.Context, args *GetCertificateArgs, opts ...pulumi.InvokeOption) (*GetCertificateResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv GetCertificateResult
    46  	err := ctx.Invoke("aws:rds/getCertificate:getCertificate", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getCertificate.
    54  type GetCertificateArgs struct {
    55  	// Certificate identifier. For example, `rds-ca-2019`.
    56  	Id *string `pulumi:"id"`
    57  	// When enabled, returns the certificate with the latest `ValidTill`.
    58  	LatestValidTill *bool `pulumi:"latestValidTill"`
    59  }
    60  
    61  // A collection of values returned by getCertificate.
    62  type GetCertificateResult struct {
    63  	// ARN of the certificate.
    64  	Arn string `pulumi:"arn"`
    65  	// Type of certificate. For example, `CA`.
    66  	CertificateType string `pulumi:"certificateType"`
    67  	// Boolean whether there is an override for the default certificate identifier.
    68  	CustomerOverride bool `pulumi:"customerOverride"`
    69  	// If there is an override for the default certificate identifier, when the override expires.
    70  	CustomerOverrideValidTill string `pulumi:"customerOverrideValidTill"`
    71  	Id                        string `pulumi:"id"`
    72  	LatestValidTill           *bool  `pulumi:"latestValidTill"`
    73  	// Thumbprint of the certificate.
    74  	Thumbprint string `pulumi:"thumbprint"`
    75  	// [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of certificate starting validity date.
    76  	ValidFrom string `pulumi:"validFrom"`
    77  	// [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of certificate ending validity date.
    78  	ValidTill string `pulumi:"validTill"`
    79  }
    80  
    81  func GetCertificateOutput(ctx *pulumi.Context, args GetCertificateOutputArgs, opts ...pulumi.InvokeOption) GetCertificateResultOutput {
    82  	return pulumi.ToOutputWithContext(context.Background(), args).
    83  		ApplyT(func(v interface{}) (GetCertificateResult, error) {
    84  			args := v.(GetCertificateArgs)
    85  			r, err := GetCertificate(ctx, &args, opts...)
    86  			var s GetCertificateResult
    87  			if r != nil {
    88  				s = *r
    89  			}
    90  			return s, err
    91  		}).(GetCertificateResultOutput)
    92  }
    93  
    94  // A collection of arguments for invoking getCertificate.
    95  type GetCertificateOutputArgs struct {
    96  	// Certificate identifier. For example, `rds-ca-2019`.
    97  	Id pulumi.StringPtrInput `pulumi:"id"`
    98  	// When enabled, returns the certificate with the latest `ValidTill`.
    99  	LatestValidTill pulumi.BoolPtrInput `pulumi:"latestValidTill"`
   100  }
   101  
   102  func (GetCertificateOutputArgs) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*GetCertificateArgs)(nil)).Elem()
   104  }
   105  
   106  // A collection of values returned by getCertificate.
   107  type GetCertificateResultOutput struct{ *pulumi.OutputState }
   108  
   109  func (GetCertificateResultOutput) ElementType() reflect.Type {
   110  	return reflect.TypeOf((*GetCertificateResult)(nil)).Elem()
   111  }
   112  
   113  func (o GetCertificateResultOutput) ToGetCertificateResultOutput() GetCertificateResultOutput {
   114  	return o
   115  }
   116  
   117  func (o GetCertificateResultOutput) ToGetCertificateResultOutputWithContext(ctx context.Context) GetCertificateResultOutput {
   118  	return o
   119  }
   120  
   121  // ARN of the certificate.
   122  func (o GetCertificateResultOutput) Arn() pulumi.StringOutput {
   123  	return o.ApplyT(func(v GetCertificateResult) string { return v.Arn }).(pulumi.StringOutput)
   124  }
   125  
   126  // Type of certificate. For example, `CA`.
   127  func (o GetCertificateResultOutput) CertificateType() pulumi.StringOutput {
   128  	return o.ApplyT(func(v GetCertificateResult) string { return v.CertificateType }).(pulumi.StringOutput)
   129  }
   130  
   131  // Boolean whether there is an override for the default certificate identifier.
   132  func (o GetCertificateResultOutput) CustomerOverride() pulumi.BoolOutput {
   133  	return o.ApplyT(func(v GetCertificateResult) bool { return v.CustomerOverride }).(pulumi.BoolOutput)
   134  }
   135  
   136  // If there is an override for the default certificate identifier, when the override expires.
   137  func (o GetCertificateResultOutput) CustomerOverrideValidTill() pulumi.StringOutput {
   138  	return o.ApplyT(func(v GetCertificateResult) string { return v.CustomerOverrideValidTill }).(pulumi.StringOutput)
   139  }
   140  
   141  func (o GetCertificateResultOutput) Id() pulumi.StringOutput {
   142  	return o.ApplyT(func(v GetCertificateResult) string { return v.Id }).(pulumi.StringOutput)
   143  }
   144  
   145  func (o GetCertificateResultOutput) LatestValidTill() pulumi.BoolPtrOutput {
   146  	return o.ApplyT(func(v GetCertificateResult) *bool { return v.LatestValidTill }).(pulumi.BoolPtrOutput)
   147  }
   148  
   149  // Thumbprint of the certificate.
   150  func (o GetCertificateResultOutput) Thumbprint() pulumi.StringOutput {
   151  	return o.ApplyT(func(v GetCertificateResult) string { return v.Thumbprint }).(pulumi.StringOutput)
   152  }
   153  
   154  // [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of certificate starting validity date.
   155  func (o GetCertificateResultOutput) ValidFrom() pulumi.StringOutput {
   156  	return o.ApplyT(func(v GetCertificateResult) string { return v.ValidFrom }).(pulumi.StringOutput)
   157  }
   158  
   159  // [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of certificate ending validity date.
   160  func (o GetCertificateResultOutput) ValidTill() pulumi.StringOutput {
   161  	return o.ApplyT(func(v GetCertificateResult) string { return v.ValidTill }).(pulumi.StringOutput)
   162  }
   163  
   164  func init() {
   165  	pulumi.RegisterOutputType(GetCertificateResultOutput{})
   166  }