github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/signer/signingProfile.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 signer
     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  // Creates a Signer Signing Profile. A signing profile contains information about the code signing configuration parameters that can be used by a given code signing user.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/signer"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := signer.NewSigningProfile(ctx, "test_sp", &signer.SigningProfileArgs{
    33  //				PlatformId: pulumi.String("AWSLambda-SHA384-ECDSA"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			_, err = signer.NewSigningProfile(ctx, "prod_sp", &signer.SigningProfileArgs{
    39  //				PlatformId: pulumi.String("AWSLambda-SHA384-ECDSA"),
    40  //				NamePrefix: pulumi.String("prod_sp_"),
    41  //				SignatureValidityPeriod: &signer.SigningProfileSignatureValidityPeriodArgs{
    42  //					Value: pulumi.Int(5),
    43  //					Type:  pulumi.String("YEARS"),
    44  //				},
    45  //				Tags: pulumi.StringMap{
    46  //					"tag1": pulumi.String("value1"),
    47  //					"tag2": pulumi.String("value2"),
    48  //				},
    49  //			})
    50  //			if err != nil {
    51  //				return err
    52  //			}
    53  //			return nil
    54  //		})
    55  //	}
    56  //
    57  // ```
    58  // <!--End PulumiCodeChooser -->
    59  //
    60  // ## Import
    61  //
    62  // Using `pulumi import`, import Signer signing profiles using the `name`. For example:
    63  //
    64  // ```sh
    65  // $ pulumi import aws:signer/signingProfile:SigningProfile test_signer_signing_profile test_sp_DdW3Mk1foYL88fajut4mTVFGpuwfd4ACO6ANL0D1uIj7lrn8adK
    66  // ```
    67  type SigningProfile struct {
    68  	pulumi.CustomResourceState
    69  
    70  	// The Amazon Resource Name (ARN) for the signing profile.
    71  	Arn        pulumi.StringOutput `pulumi:"arn"`
    72  	Name       pulumi.StringOutput `pulumi:"name"`
    73  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
    74  	// A human-readable name for the signing platform associated with the signing profile.
    75  	PlatformDisplayName pulumi.StringOutput `pulumi:"platformDisplayName"`
    76  	// The ID of the platform that is used by the target signing profile.
    77  	PlatformId pulumi.StringOutput `pulumi:"platformId"`
    78  	// Revocation information for a signing profile. See `revocationRecord` Block below for details.
    79  	RevocationRecords SigningProfileRevocationRecordArrayOutput `pulumi:"revocationRecords"`
    80  	// The validity period for a signing job. See `signatureValidityPeriod` Block below for details.
    81  	SignatureValidityPeriod SigningProfileSignatureValidityPeriodOutput `pulumi:"signatureValidityPeriod"`
    82  	// The AWS Certificate Manager certificate that will be used to sign code with the new signing profile. See `signingMaterial` Block below for details.
    83  	SigningMaterial SigningProfileSigningMaterialOutput `pulumi:"signingMaterial"`
    84  	// The status of the target signing profile.
    85  	Status pulumi.StringOutput `pulumi:"status"`
    86  	// A list of tags associated with the signing profile. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    87  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    88  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    89  	//
    90  	// Deprecated: Please use `tags` instead.
    91  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    92  	// The current version of the signing profile.
    93  	Version pulumi.StringOutput `pulumi:"version"`
    94  	// The signing profile ARN, including the profile version.
    95  	VersionArn pulumi.StringOutput `pulumi:"versionArn"`
    96  }
    97  
    98  // NewSigningProfile registers a new resource with the given unique name, arguments, and options.
    99  func NewSigningProfile(ctx *pulumi.Context,
   100  	name string, args *SigningProfileArgs, opts ...pulumi.ResourceOption) (*SigningProfile, error) {
   101  	if args == nil {
   102  		return nil, errors.New("missing one or more required arguments")
   103  	}
   104  
   105  	if args.PlatformId == nil {
   106  		return nil, errors.New("invalid value for required argument 'PlatformId'")
   107  	}
   108  	opts = internal.PkgResourceDefaultOpts(opts)
   109  	var resource SigningProfile
   110  	err := ctx.RegisterResource("aws:signer/signingProfile:SigningProfile", name, args, &resource, opts...)
   111  	if err != nil {
   112  		return nil, err
   113  	}
   114  	return &resource, nil
   115  }
   116  
   117  // GetSigningProfile gets an existing SigningProfile resource's state with the given name, ID, and optional
   118  // state properties that are used to uniquely qualify the lookup (nil if not required).
   119  func GetSigningProfile(ctx *pulumi.Context,
   120  	name string, id pulumi.IDInput, state *SigningProfileState, opts ...pulumi.ResourceOption) (*SigningProfile, error) {
   121  	var resource SigningProfile
   122  	err := ctx.ReadResource("aws:signer/signingProfile:SigningProfile", name, id, state, &resource, opts...)
   123  	if err != nil {
   124  		return nil, err
   125  	}
   126  	return &resource, nil
   127  }
   128  
   129  // Input properties used for looking up and filtering SigningProfile resources.
   130  type signingProfileState struct {
   131  	// The Amazon Resource Name (ARN) for the signing profile.
   132  	Arn        *string `pulumi:"arn"`
   133  	Name       *string `pulumi:"name"`
   134  	NamePrefix *string `pulumi:"namePrefix"`
   135  	// A human-readable name for the signing platform associated with the signing profile.
   136  	PlatformDisplayName *string `pulumi:"platformDisplayName"`
   137  	// The ID of the platform that is used by the target signing profile.
   138  	PlatformId *string `pulumi:"platformId"`
   139  	// Revocation information for a signing profile. See `revocationRecord` Block below for details.
   140  	RevocationRecords []SigningProfileRevocationRecord `pulumi:"revocationRecords"`
   141  	// The validity period for a signing job. See `signatureValidityPeriod` Block below for details.
   142  	SignatureValidityPeriod *SigningProfileSignatureValidityPeriod `pulumi:"signatureValidityPeriod"`
   143  	// The AWS Certificate Manager certificate that will be used to sign code with the new signing profile. See `signingMaterial` Block below for details.
   144  	SigningMaterial *SigningProfileSigningMaterial `pulumi:"signingMaterial"`
   145  	// The status of the target signing profile.
   146  	Status *string `pulumi:"status"`
   147  	// A list of tags associated with the signing profile. 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  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   150  	//
   151  	// Deprecated: Please use `tags` instead.
   152  	TagsAll map[string]string `pulumi:"tagsAll"`
   153  	// The current version of the signing profile.
   154  	Version *string `pulumi:"version"`
   155  	// The signing profile ARN, including the profile version.
   156  	VersionArn *string `pulumi:"versionArn"`
   157  }
   158  
   159  type SigningProfileState struct {
   160  	// The Amazon Resource Name (ARN) for the signing profile.
   161  	Arn        pulumi.StringPtrInput
   162  	Name       pulumi.StringPtrInput
   163  	NamePrefix pulumi.StringPtrInput
   164  	// A human-readable name for the signing platform associated with the signing profile.
   165  	PlatformDisplayName pulumi.StringPtrInput
   166  	// The ID of the platform that is used by the target signing profile.
   167  	PlatformId pulumi.StringPtrInput
   168  	// Revocation information for a signing profile. See `revocationRecord` Block below for details.
   169  	RevocationRecords SigningProfileRevocationRecordArrayInput
   170  	// The validity period for a signing job. See `signatureValidityPeriod` Block below for details.
   171  	SignatureValidityPeriod SigningProfileSignatureValidityPeriodPtrInput
   172  	// The AWS Certificate Manager certificate that will be used to sign code with the new signing profile. See `signingMaterial` Block below for details.
   173  	SigningMaterial SigningProfileSigningMaterialPtrInput
   174  	// The status of the target signing profile.
   175  	Status pulumi.StringPtrInput
   176  	// A list of tags associated with the signing profile. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   177  	Tags pulumi.StringMapInput
   178  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   179  	//
   180  	// Deprecated: Please use `tags` instead.
   181  	TagsAll pulumi.StringMapInput
   182  	// The current version of the signing profile.
   183  	Version pulumi.StringPtrInput
   184  	// The signing profile ARN, including the profile version.
   185  	VersionArn pulumi.StringPtrInput
   186  }
   187  
   188  func (SigningProfileState) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*signingProfileState)(nil)).Elem()
   190  }
   191  
   192  type signingProfileArgs struct {
   193  	Name       *string `pulumi:"name"`
   194  	NamePrefix *string `pulumi:"namePrefix"`
   195  	// The ID of the platform that is used by the target signing profile.
   196  	PlatformId string `pulumi:"platformId"`
   197  	// The validity period for a signing job. See `signatureValidityPeriod` Block below for details.
   198  	SignatureValidityPeriod *SigningProfileSignatureValidityPeriod `pulumi:"signatureValidityPeriod"`
   199  	// The AWS Certificate Manager certificate that will be used to sign code with the new signing profile. See `signingMaterial` Block below for details.
   200  	SigningMaterial *SigningProfileSigningMaterial `pulumi:"signingMaterial"`
   201  	// A list of tags associated with the signing profile. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   202  	Tags map[string]string `pulumi:"tags"`
   203  }
   204  
   205  // The set of arguments for constructing a SigningProfile resource.
   206  type SigningProfileArgs struct {
   207  	Name       pulumi.StringPtrInput
   208  	NamePrefix pulumi.StringPtrInput
   209  	// The ID of the platform that is used by the target signing profile.
   210  	PlatformId pulumi.StringInput
   211  	// The validity period for a signing job. See `signatureValidityPeriod` Block below for details.
   212  	SignatureValidityPeriod SigningProfileSignatureValidityPeriodPtrInput
   213  	// The AWS Certificate Manager certificate that will be used to sign code with the new signing profile. See `signingMaterial` Block below for details.
   214  	SigningMaterial SigningProfileSigningMaterialPtrInput
   215  	// A list of tags associated with the signing profile. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   216  	Tags pulumi.StringMapInput
   217  }
   218  
   219  func (SigningProfileArgs) ElementType() reflect.Type {
   220  	return reflect.TypeOf((*signingProfileArgs)(nil)).Elem()
   221  }
   222  
   223  type SigningProfileInput interface {
   224  	pulumi.Input
   225  
   226  	ToSigningProfileOutput() SigningProfileOutput
   227  	ToSigningProfileOutputWithContext(ctx context.Context) SigningProfileOutput
   228  }
   229  
   230  func (*SigningProfile) ElementType() reflect.Type {
   231  	return reflect.TypeOf((**SigningProfile)(nil)).Elem()
   232  }
   233  
   234  func (i *SigningProfile) ToSigningProfileOutput() SigningProfileOutput {
   235  	return i.ToSigningProfileOutputWithContext(context.Background())
   236  }
   237  
   238  func (i *SigningProfile) ToSigningProfileOutputWithContext(ctx context.Context) SigningProfileOutput {
   239  	return pulumi.ToOutputWithContext(ctx, i).(SigningProfileOutput)
   240  }
   241  
   242  // SigningProfileArrayInput is an input type that accepts SigningProfileArray and SigningProfileArrayOutput values.
   243  // You can construct a concrete instance of `SigningProfileArrayInput` via:
   244  //
   245  //	SigningProfileArray{ SigningProfileArgs{...} }
   246  type SigningProfileArrayInput interface {
   247  	pulumi.Input
   248  
   249  	ToSigningProfileArrayOutput() SigningProfileArrayOutput
   250  	ToSigningProfileArrayOutputWithContext(context.Context) SigningProfileArrayOutput
   251  }
   252  
   253  type SigningProfileArray []SigningProfileInput
   254  
   255  func (SigningProfileArray) ElementType() reflect.Type {
   256  	return reflect.TypeOf((*[]*SigningProfile)(nil)).Elem()
   257  }
   258  
   259  func (i SigningProfileArray) ToSigningProfileArrayOutput() SigningProfileArrayOutput {
   260  	return i.ToSigningProfileArrayOutputWithContext(context.Background())
   261  }
   262  
   263  func (i SigningProfileArray) ToSigningProfileArrayOutputWithContext(ctx context.Context) SigningProfileArrayOutput {
   264  	return pulumi.ToOutputWithContext(ctx, i).(SigningProfileArrayOutput)
   265  }
   266  
   267  // SigningProfileMapInput is an input type that accepts SigningProfileMap and SigningProfileMapOutput values.
   268  // You can construct a concrete instance of `SigningProfileMapInput` via:
   269  //
   270  //	SigningProfileMap{ "key": SigningProfileArgs{...} }
   271  type SigningProfileMapInput interface {
   272  	pulumi.Input
   273  
   274  	ToSigningProfileMapOutput() SigningProfileMapOutput
   275  	ToSigningProfileMapOutputWithContext(context.Context) SigningProfileMapOutput
   276  }
   277  
   278  type SigningProfileMap map[string]SigningProfileInput
   279  
   280  func (SigningProfileMap) ElementType() reflect.Type {
   281  	return reflect.TypeOf((*map[string]*SigningProfile)(nil)).Elem()
   282  }
   283  
   284  func (i SigningProfileMap) ToSigningProfileMapOutput() SigningProfileMapOutput {
   285  	return i.ToSigningProfileMapOutputWithContext(context.Background())
   286  }
   287  
   288  func (i SigningProfileMap) ToSigningProfileMapOutputWithContext(ctx context.Context) SigningProfileMapOutput {
   289  	return pulumi.ToOutputWithContext(ctx, i).(SigningProfileMapOutput)
   290  }
   291  
   292  type SigningProfileOutput struct{ *pulumi.OutputState }
   293  
   294  func (SigningProfileOutput) ElementType() reflect.Type {
   295  	return reflect.TypeOf((**SigningProfile)(nil)).Elem()
   296  }
   297  
   298  func (o SigningProfileOutput) ToSigningProfileOutput() SigningProfileOutput {
   299  	return o
   300  }
   301  
   302  func (o SigningProfileOutput) ToSigningProfileOutputWithContext(ctx context.Context) SigningProfileOutput {
   303  	return o
   304  }
   305  
   306  // The Amazon Resource Name (ARN) for the signing profile.
   307  func (o SigningProfileOutput) Arn() pulumi.StringOutput {
   308  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   309  }
   310  
   311  func (o SigningProfileOutput) Name() pulumi.StringOutput {
   312  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   313  }
   314  
   315  func (o SigningProfileOutput) NamePrefix() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   317  }
   318  
   319  // A human-readable name for the signing platform associated with the signing profile.
   320  func (o SigningProfileOutput) PlatformDisplayName() pulumi.StringOutput {
   321  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.PlatformDisplayName }).(pulumi.StringOutput)
   322  }
   323  
   324  // The ID of the platform that is used by the target signing profile.
   325  func (o SigningProfileOutput) PlatformId() pulumi.StringOutput {
   326  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.PlatformId }).(pulumi.StringOutput)
   327  }
   328  
   329  // Revocation information for a signing profile. See `revocationRecord` Block below for details.
   330  func (o SigningProfileOutput) RevocationRecords() SigningProfileRevocationRecordArrayOutput {
   331  	return o.ApplyT(func(v *SigningProfile) SigningProfileRevocationRecordArrayOutput { return v.RevocationRecords }).(SigningProfileRevocationRecordArrayOutput)
   332  }
   333  
   334  // The validity period for a signing job. See `signatureValidityPeriod` Block below for details.
   335  func (o SigningProfileOutput) SignatureValidityPeriod() SigningProfileSignatureValidityPeriodOutput {
   336  	return o.ApplyT(func(v *SigningProfile) SigningProfileSignatureValidityPeriodOutput { return v.SignatureValidityPeriod }).(SigningProfileSignatureValidityPeriodOutput)
   337  }
   338  
   339  // The AWS Certificate Manager certificate that will be used to sign code with the new signing profile. See `signingMaterial` Block below for details.
   340  func (o SigningProfileOutput) SigningMaterial() SigningProfileSigningMaterialOutput {
   341  	return o.ApplyT(func(v *SigningProfile) SigningProfileSigningMaterialOutput { return v.SigningMaterial }).(SigningProfileSigningMaterialOutput)
   342  }
   343  
   344  // The status of the target signing profile.
   345  func (o SigningProfileOutput) Status() pulumi.StringOutput {
   346  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   347  }
   348  
   349  // A list of tags associated with the signing profile. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   350  func (o SigningProfileOutput) Tags() pulumi.StringMapOutput {
   351  	return o.ApplyT(func(v *SigningProfile) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   352  }
   353  
   354  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   355  //
   356  // Deprecated: Please use `tags` instead.
   357  func (o SigningProfileOutput) TagsAll() pulumi.StringMapOutput {
   358  	return o.ApplyT(func(v *SigningProfile) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   359  }
   360  
   361  // The current version of the signing profile.
   362  func (o SigningProfileOutput) Version() pulumi.StringOutput {
   363  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
   364  }
   365  
   366  // The signing profile ARN, including the profile version.
   367  func (o SigningProfileOutput) VersionArn() pulumi.StringOutput {
   368  	return o.ApplyT(func(v *SigningProfile) pulumi.StringOutput { return v.VersionArn }).(pulumi.StringOutput)
   369  }
   370  
   371  type SigningProfileArrayOutput struct{ *pulumi.OutputState }
   372  
   373  func (SigningProfileArrayOutput) ElementType() reflect.Type {
   374  	return reflect.TypeOf((*[]*SigningProfile)(nil)).Elem()
   375  }
   376  
   377  func (o SigningProfileArrayOutput) ToSigningProfileArrayOutput() SigningProfileArrayOutput {
   378  	return o
   379  }
   380  
   381  func (o SigningProfileArrayOutput) ToSigningProfileArrayOutputWithContext(ctx context.Context) SigningProfileArrayOutput {
   382  	return o
   383  }
   384  
   385  func (o SigningProfileArrayOutput) Index(i pulumi.IntInput) SigningProfileOutput {
   386  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SigningProfile {
   387  		return vs[0].([]*SigningProfile)[vs[1].(int)]
   388  	}).(SigningProfileOutput)
   389  }
   390  
   391  type SigningProfileMapOutput struct{ *pulumi.OutputState }
   392  
   393  func (SigningProfileMapOutput) ElementType() reflect.Type {
   394  	return reflect.TypeOf((*map[string]*SigningProfile)(nil)).Elem()
   395  }
   396  
   397  func (o SigningProfileMapOutput) ToSigningProfileMapOutput() SigningProfileMapOutput {
   398  	return o
   399  }
   400  
   401  func (o SigningProfileMapOutput) ToSigningProfileMapOutputWithContext(ctx context.Context) SigningProfileMapOutput {
   402  	return o
   403  }
   404  
   405  func (o SigningProfileMapOutput) MapIndex(k pulumi.StringInput) SigningProfileOutput {
   406  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SigningProfile {
   407  		return vs[0].(map[string]*SigningProfile)[vs[1].(string)]
   408  	}).(SigningProfileOutput)
   409  }
   410  
   411  func init() {
   412  	pulumi.RegisterInputType(reflect.TypeOf((*SigningProfileInput)(nil)).Elem(), &SigningProfile{})
   413  	pulumi.RegisterInputType(reflect.TypeOf((*SigningProfileArrayInput)(nil)).Elem(), SigningProfileArray{})
   414  	pulumi.RegisterInputType(reflect.TypeOf((*SigningProfileMapInput)(nil)).Elem(), SigningProfileMap{})
   415  	pulumi.RegisterOutputType(SigningProfileOutput{})
   416  	pulumi.RegisterOutputType(SigningProfileArrayOutput{})
   417  	pulumi.RegisterOutputType(SigningProfileMapOutput{})
   418  }