src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

api_op_CreateKeySigningKey.go (4487B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 
      8 	"github.com/aws/aws-sdk-go-v2/service/route53/types"
      9 	"github.com/aws/smithy-go/middleware"
     10 )
     11 
     12 // Creates a new key-signing key (KSK) associated with a hosted zone. You can only
     13 // have two KSKs per hosted zone.
     14 func (c *Client) CreateKeySigningKey(ctx context.Context, params *CreateKeySigningKeyInput, optFns ...func(*Options)) (*CreateKeySigningKeyOutput, error) {
     15 	if params == nil {
     16 		params = &CreateKeySigningKeyInput{}
     17 	}
     18 
     19 	result, metadata, err := c.invokeOperation(ctx, "CreateKeySigningKey", params, optFns, c.addOperationCreateKeySigningKeyMiddlewares)
     20 	if err != nil {
     21 		return nil, err
     22 	}
     23 
     24 	out := result.(*CreateKeySigningKeyOutput)
     25 	out.ResultMetadata = metadata
     26 	return out, nil
     27 }
     28 
     29 type CreateKeySigningKeyInput struct {
     30 
     31 	// A unique string that identifies the request.
     32 	//
     33 	// This member is required.
     34 	CallerReference *string
     35 
     36 	// The unique string (ID) used to identify a hosted zone.
     37 	//
     38 	// This member is required.
     39 	HostedZoneId *string
     40 
     41 	// The Amazon resource name (ARN) for a customer managed key in Key Management
     42 	// Service (KMS). The KeyManagementServiceArn must be unique for each key-signing
     43 	// key (KSK) in a single hosted zone. To see an example of KeyManagementServiceArn
     44 	// that grants the correct permissions for DNSSEC, scroll down to Example.
     45 	//
     46 	// You must configure the customer managed customer managed key as follows:
     47 	//
     48 	// Status Enabled
     49 	//
     50 	// Key spec ECC_NIST_P256
     51 	//
     52 	// Key usage Sign and verify
     53 	//
     54 	// Key policy The key policy must give permission for the following actions:
     55 	//
     56 	//   - DescribeKey
     57 	//
     58 	//   - GetPublicKey
     59 	//
     60 	//   - Sign
     61 	//
     62 	// The key policy must also include the Amazon Route 53 service in the principal
     63 	// for your account. Specify the following:
     64 	//
     65 	//   - "Service": "dnssec-route53.amazonaws.com"
     66 	//
     67 	// For more information about working with a customer managed key in KMS, see [Key Management Service concepts].
     68 	//
     69 	// [Key Management Service concepts]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html
     70 	//
     71 	// This member is required.
     72 	KeyManagementServiceArn *string
     73 
     74 	// A string used to identify a key-signing key (KSK). Name can include numbers,
     75 	// letters, and underscores (_). Name must be unique for each key-signing key in
     76 	// the same hosted zone.
     77 	//
     78 	// This member is required.
     79 	Name *string
     80 
     81 	// A string specifying the initial status of the key-signing key (KSK). You can
     82 	// set the value to ACTIVE or INACTIVE .
     83 	//
     84 	// This member is required.
     85 	Status *string
     86 
     87 	noSmithyDocumentSerde
     88 }
     89 
     90 type CreateKeySigningKeyOutput struct {
     91 
     92 	// A complex type that describes change information about changes made to your
     93 	// hosted zone.
     94 	//
     95 	// This member is required.
     96 	ChangeInfo *types.ChangeInfo
     97 
     98 	// The key-signing key (KSK) that the request creates.
     99 	//
    100 	// This member is required.
    101 	KeySigningKey *types.KeySigningKey
    102 
    103 	// The unique URL representing the new key-signing key (KSK).
    104 	//
    105 	// This member is required.
    106 	Location *string
    107 
    108 	// Metadata pertaining to the operation's result.
    109 	ResultMetadata middleware.Metadata
    110 
    111 	noSmithyDocumentSerde
    112 }
    113 
    114 func (c *Client) addOperationCreateKeySigningKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
    115 	err = stack.Serialize.Add(&awsRestxml_serializeOpCreateKeySigningKey{}, middleware.After)
    116 	if err != nil {
    117 		return err
    118 	}
    119 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateKeySigningKey{}, middleware.After)
    120 	if err != nil {
    121 		return err
    122 	}
    123 
    124 	if err = addComputeContentLength(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    128 		return err
    129 	}
    130 	if err = addComputePayloadSHA256(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = addRecordResponseTiming(stack, options); err != nil {
    134 		return err
    135 	}
    136 	if err = addCredentialSource(stack, options); err != nil {
    137 		return err
    138 	}
    139 	if err = addOpCreateKeySigningKeyValidationMiddleware(stack); err != nil {
    140 		return err
    141 	}
    142 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    143 		return err
    144 	}
    145 	if err = addResponseErrorMiddleware(stack); err != nil {
    146 		return err
    147 	}
    148 	if err = addSanitizeURLMiddleware(stack); err != nil {
    149 		return err
    150 	}
    151 	if err = addRequestResponseLogging(stack, options); err != nil {
    152 		return err
    153 	}
    154 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    155 		return err
    156 	}
    157 	if err = addInterceptors(stack, options); err != nil {
    158 		return err
    159 	}
    160 	return nil
    161 }