MCPcopy Create free account
hub / github.com/barnybug/cli53 / createZone

Function createZone

commands.go:19–42  ·  view source on GitHub ↗
(ctx context.Context, name, comment, vpcId, vpcRegion, delegationSetId string)

Source from the content-addressed store, hash-verified

17const ChangeBatchSize = 100
18
19func createZone(ctx context.Context, name, comment, vpcId, vpcRegion, delegationSetId string) {
20 callerReference := uniqueReference()
21 req := route53.CreateHostedZoneInput{
22 CallerReference: &callerReference,
23 Name: &name,
24 HostedZoneConfig: &route53types.HostedZoneConfig{
25 Comment: &comment,
26 },
27 }
28
29 if vpcId != "" && vpcRegion != "" {
30 req.VPC = &route53types.VPC{
31 VPCId: aws.String(vpcId),
32 VPCRegion: route53types.VPCRegion(vpcRegion),
33 }
34 }
35 if delegationSetId != "" {
36 delegationSetId = strings.Replace(delegationSetId, "/delegationset/", "", 1)
37 req.DelegationSetId = aws.String(delegationSetId)
38 }
39 resp, err := r53.CreateHostedZone(ctx, &req)
40 fatalIfErr(err)
41 fmt.Printf("Created zone: '%s' ID: '%s'\n", *resp.HostedZone.Name, *resp.HostedZone.Id)
42}
43
44func createReusableDelegationSet(ctx context.Context, zoneId string) {
45 callerReference := uniqueReference()

Callers 1

MainFunction · 0.85

Calls 3

uniqueReferenceFunction · 0.70
fatalIfErrFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected