src

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

api_op_CreateReusableDelegationSet.go (5454B)


      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 delegation set (a group of four name servers) that can be reused by
     13 // multiple hosted zones that were created by the same Amazon Web Services account.
     14 //
     15 // You can also create a reusable delegation set that uses the four name servers
     16 // that are associated with an existing hosted zone. Specify the hosted zone ID in
     17 // the CreateReusableDelegationSet request.
     18 //
     19 // You can't associate a reusable delegation set with a private hosted zone.
     20 //
     21 // For information about using a reusable delegation set to configure white label
     22 // name servers, see [Configuring White Label Name Servers].
     23 //
     24 // The process for migrating existing hosted zones to use a reusable delegation
     25 // set is comparable to the process for configuring white label name servers. You
     26 // need to perform the following steps:
     27 //
     28 //   - Create a reusable delegation set.
     29 //
     30 //   - Recreate hosted zones, and reduce the TTL to 60 seconds or less.
     31 //
     32 //   - Recreate resource record sets in the new hosted zones.
     33 //
     34 //   - Change the registrar's name servers to use the name servers for the new
     35 //     hosted zones.
     36 //
     37 //   - Monitor traffic for the website or application.
     38 //
     39 //   - Change TTLs back to their original values.
     40 //
     41 // If you want to migrate existing hosted zones to use a reusable delegation set,
     42 // the existing hosted zones can't use any of the name servers that are assigned to
     43 // the reusable delegation set. If one or more hosted zones do use one or more name
     44 // servers that are assigned to the reusable delegation set, you can do one of the
     45 // following:
     46 //
     47 //   - For small numbers of hosted zones—up to a few hundred—it's relatively easy
     48 //     to create reusable delegation sets until you get one that has four name servers
     49 //     that don't overlap with any of the name servers in your hosted zones.
     50 //
     51 //   - For larger numbers of hosted zones, the easiest solution is to use more
     52 //     than one reusable delegation set.
     53 //
     54 //   - For larger numbers of hosted zones, you can also migrate hosted zones that
     55 //     have overlapping name servers to hosted zones that don't have overlapping name
     56 //     servers, then migrate the hosted zones again to use the reusable delegation set.
     57 //
     58 // [Configuring White Label Name Servers]: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/white-label-name-servers.html
     59 func (c *Client) CreateReusableDelegationSet(ctx context.Context, params *CreateReusableDelegationSetInput, optFns ...func(*Options)) (*CreateReusableDelegationSetOutput, error) {
     60 	if params == nil {
     61 		params = &CreateReusableDelegationSetInput{}
     62 	}
     63 
     64 	result, metadata, err := c.invokeOperation(ctx, "CreateReusableDelegationSet", params, optFns, c.addOperationCreateReusableDelegationSetMiddlewares)
     65 	if err != nil {
     66 		return nil, err
     67 	}
     68 
     69 	out := result.(*CreateReusableDelegationSetOutput)
     70 	out.ResultMetadata = metadata
     71 	return out, nil
     72 }
     73 
     74 type CreateReusableDelegationSetInput struct {
     75 
     76 	// A unique string that identifies the request, and that allows you to retry
     77 	// failed CreateReusableDelegationSet requests without the risk of executing the
     78 	// operation twice. You must use a unique CallerReference string every time you
     79 	// submit a CreateReusableDelegationSet request. CallerReference can be any unique
     80 	// string, for example a date/time stamp.
     81 	//
     82 	// This member is required.
     83 	CallerReference *string
     84 
     85 	// If you want to mark the delegation set for an existing hosted zone as reusable,
     86 	// the ID for that hosted zone.
     87 	HostedZoneId *string
     88 
     89 	noSmithyDocumentSerde
     90 }
     91 
     92 type CreateReusableDelegationSetOutput struct {
     93 
     94 	// A complex type that contains name server information.
     95 	//
     96 	// This member is required.
     97 	DelegationSet *types.DelegationSet
     98 
     99 	// The unique URL representing the new reusable delegation set.
    100 	//
    101 	// This member is required.
    102 	Location *string
    103 
    104 	// Metadata pertaining to the operation's result.
    105 	ResultMetadata middleware.Metadata
    106 
    107 	noSmithyDocumentSerde
    108 }
    109 
    110 func (c *Client) addOperationCreateReusableDelegationSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
    111 	err = stack.Serialize.Add(&awsRestxml_serializeOpCreateReusableDelegationSet{}, middleware.After)
    112 	if err != nil {
    113 		return err
    114 	}
    115 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateReusableDelegationSet{}, middleware.After)
    116 	if err != nil {
    117 		return err
    118 	}
    119 
    120 	if err = addComputeContentLength(stack); err != nil {
    121 		return err
    122 	}
    123 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    124 		return err
    125 	}
    126 	if err = addComputePayloadSHA256(stack); err != nil {
    127 		return err
    128 	}
    129 	if err = addRecordResponseTiming(stack, options); err != nil {
    130 		return err
    131 	}
    132 	if err = addCredentialSource(stack, options); err != nil {
    133 		return err
    134 	}
    135 	if err = addOpCreateReusableDelegationSetValidationMiddleware(stack); err != nil {
    136 		return err
    137 	}
    138 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    139 		return err
    140 	}
    141 	if err = addResponseErrorMiddleware(stack); err != nil {
    142 		return err
    143 	}
    144 	if err = addSanitizeURLMiddleware(stack); err != nil {
    145 		return err
    146 	}
    147 	if err = addRequestResponseLogging(stack, options); err != nil {
    148 		return err
    149 	}
    150 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    151 		return err
    152 	}
    153 	if err = addInterceptors(stack, options); err != nil {
    154 		return err
    155 	}
    156 	return nil
    157 }