github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/hostedZoneDnsSec.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 route53
     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  // Manages Route 53 Hosted Zone Domain Name System Security Extensions (DNSSEC). For more information about managing DNSSEC in Route 53, see the [Route 53 Developer Guide](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring-dnssec.html).
    16  //
    17  // !> **WARNING:** If you disable DNSSEC signing for your hosted zone before the DNS changes have propagated, your domain could become unavailable on the internet. When you remove the DS records, you must wait until the longest TTL for the DS records that you remove has expired before you complete the step to disable DNSSEC signing. Please refer to the [Route 53 Developer Guide - Disable DNSSEC](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring-dnssec-disable.html) for a detailed breakdown on the steps required to disable DNSSEC safely for a hosted zone.
    18  //
    19  // > **Note:** Route53 hosted zones are global resources, and as such any `kms.Key` that you use as part of a signing key needs to be located in the `us-east-1` region. In the example below, the main AWS provider declaration is for `us-east-1`, however if you are provisioning your AWS resources in a different region, you will need to specify a provider alias and use that attached to the `kms.Key` resource as described in the provider alias documentation.
    20  //
    21  // ## Example Usage
    22  //
    23  // <!--Start PulumiCodeChooser -->
    24  // ```go
    25  // package main
    26  //
    27  // import (
    28  //
    29  //	"encoding/json"
    30  //	"fmt"
    31  //
    32  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    33  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
    34  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
    35  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    36  //
    37  // )
    38  //
    39  //	func main() {
    40  //		pulumi.Run(func(ctx *pulumi.Context) error {
    41  //			current, err := aws.GetCallerIdentity(ctx, nil, nil)
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			tmpJSON0, err := json.Marshal(map[string]interface{}{
    46  //				"Statement": []interface{}{
    47  //					map[string]interface{}{
    48  //						"Action": []string{
    49  //							"kms:DescribeKey",
    50  //							"kms:GetPublicKey",
    51  //							"kms:Sign",
    52  //							"kms:Verify",
    53  //						},
    54  //						"Effect": "Allow",
    55  //						"Principal": map[string]interface{}{
    56  //							"Service": "dnssec-route53.amazonaws.com",
    57  //						},
    58  //						"Resource": "*",
    59  //						"Sid":      "Allow Route 53 DNSSEC Service",
    60  //					},
    61  //					map[string]interface{}{
    62  //						"Action": "kms:*",
    63  //						"Effect": "Allow",
    64  //						"Principal": map[string]interface{}{
    65  //							"AWS": fmt.Sprintf("arn:aws:iam::%v:root", current.AccountId),
    66  //						},
    67  //						"Resource": "*",
    68  //						"Sid":      "Enable IAM User Permissions",
    69  //					},
    70  //				},
    71  //				"Version": "2012-10-17",
    72  //			})
    73  //			if err != nil {
    74  //				return err
    75  //			}
    76  //			json0 := string(tmpJSON0)
    77  //			example, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
    78  //				CustomerMasterKeySpec: pulumi.String("ECC_NIST_P256"),
    79  //				DeletionWindowInDays:  pulumi.Int(7),
    80  //				KeyUsage:              pulumi.String("SIGN_VERIFY"),
    81  //				Policy:                pulumi.String(json0),
    82  //			})
    83  //			if err != nil {
    84  //				return err
    85  //			}
    86  //			exampleZone, err := route53.NewZone(ctx, "example", &route53.ZoneArgs{
    87  //				Name: pulumi.String("example.com"),
    88  //			})
    89  //			if err != nil {
    90  //				return err
    91  //			}
    92  //			exampleKeySigningKey, err := route53.NewKeySigningKey(ctx, "example", &route53.KeySigningKeyArgs{
    93  //				HostedZoneId:            exampleZone.ID(),
    94  //				KeyManagementServiceArn: example.Arn,
    95  //				Name:                    pulumi.String("example"),
    96  //			})
    97  //			if err != nil {
    98  //				return err
    99  //			}
   100  //			_, err = route53.NewHostedZoneDnsSec(ctx, "example", &route53.HostedZoneDnsSecArgs{
   101  //				HostedZoneId: exampleKeySigningKey.HostedZoneId,
   102  //			}, pulumi.DependsOn([]pulumi.Resource{
   103  //				exampleKeySigningKey,
   104  //			}))
   105  //			if err != nil {
   106  //				return err
   107  //			}
   108  //			return nil
   109  //		})
   110  //	}
   111  //
   112  // ```
   113  // <!--End PulumiCodeChooser -->
   114  //
   115  // ## Import
   116  //
   117  // Using `pulumi import`, import `aws_route53_hosted_zone_dnssec` resources using the Route 53 Hosted Zone identifier. For example:
   118  //
   119  // ```sh
   120  // $ pulumi import aws:route53/hostedZoneDnsSec:HostedZoneDnsSec example Z1D633PJN98FT9
   121  // ```
   122  type HostedZoneDnsSec struct {
   123  	pulumi.CustomResourceState
   124  
   125  	// Identifier of the Route 53 Hosted Zone.
   126  	//
   127  	// The following arguments are optional:
   128  	HostedZoneId pulumi.StringOutput `pulumi:"hostedZoneId"`
   129  	// Hosted Zone signing status. Valid values: `SIGNING`, `NOT_SIGNING`. Defaults to `SIGNING`.
   130  	SigningStatus pulumi.StringPtrOutput `pulumi:"signingStatus"`
   131  }
   132  
   133  // NewHostedZoneDnsSec registers a new resource with the given unique name, arguments, and options.
   134  func NewHostedZoneDnsSec(ctx *pulumi.Context,
   135  	name string, args *HostedZoneDnsSecArgs, opts ...pulumi.ResourceOption) (*HostedZoneDnsSec, error) {
   136  	if args == nil {
   137  		return nil, errors.New("missing one or more required arguments")
   138  	}
   139  
   140  	if args.HostedZoneId == nil {
   141  		return nil, errors.New("invalid value for required argument 'HostedZoneId'")
   142  	}
   143  	opts = internal.PkgResourceDefaultOpts(opts)
   144  	var resource HostedZoneDnsSec
   145  	err := ctx.RegisterResource("aws:route53/hostedZoneDnsSec:HostedZoneDnsSec", name, args, &resource, opts...)
   146  	if err != nil {
   147  		return nil, err
   148  	}
   149  	return &resource, nil
   150  }
   151  
   152  // GetHostedZoneDnsSec gets an existing HostedZoneDnsSec resource's state with the given name, ID, and optional
   153  // state properties that are used to uniquely qualify the lookup (nil if not required).
   154  func GetHostedZoneDnsSec(ctx *pulumi.Context,
   155  	name string, id pulumi.IDInput, state *HostedZoneDnsSecState, opts ...pulumi.ResourceOption) (*HostedZoneDnsSec, error) {
   156  	var resource HostedZoneDnsSec
   157  	err := ctx.ReadResource("aws:route53/hostedZoneDnsSec:HostedZoneDnsSec", name, id, state, &resource, opts...)
   158  	if err != nil {
   159  		return nil, err
   160  	}
   161  	return &resource, nil
   162  }
   163  
   164  // Input properties used for looking up and filtering HostedZoneDnsSec resources.
   165  type hostedZoneDnsSecState struct {
   166  	// Identifier of the Route 53 Hosted Zone.
   167  	//
   168  	// The following arguments are optional:
   169  	HostedZoneId *string `pulumi:"hostedZoneId"`
   170  	// Hosted Zone signing status. Valid values: `SIGNING`, `NOT_SIGNING`. Defaults to `SIGNING`.
   171  	SigningStatus *string `pulumi:"signingStatus"`
   172  }
   173  
   174  type HostedZoneDnsSecState struct {
   175  	// Identifier of the Route 53 Hosted Zone.
   176  	//
   177  	// The following arguments are optional:
   178  	HostedZoneId pulumi.StringPtrInput
   179  	// Hosted Zone signing status. Valid values: `SIGNING`, `NOT_SIGNING`. Defaults to `SIGNING`.
   180  	SigningStatus pulumi.StringPtrInput
   181  }
   182  
   183  func (HostedZoneDnsSecState) ElementType() reflect.Type {
   184  	return reflect.TypeOf((*hostedZoneDnsSecState)(nil)).Elem()
   185  }
   186  
   187  type hostedZoneDnsSecArgs struct {
   188  	// Identifier of the Route 53 Hosted Zone.
   189  	//
   190  	// The following arguments are optional:
   191  	HostedZoneId string `pulumi:"hostedZoneId"`
   192  	// Hosted Zone signing status. Valid values: `SIGNING`, `NOT_SIGNING`. Defaults to `SIGNING`.
   193  	SigningStatus *string `pulumi:"signingStatus"`
   194  }
   195  
   196  // The set of arguments for constructing a HostedZoneDnsSec resource.
   197  type HostedZoneDnsSecArgs struct {
   198  	// Identifier of the Route 53 Hosted Zone.
   199  	//
   200  	// The following arguments are optional:
   201  	HostedZoneId pulumi.StringInput
   202  	// Hosted Zone signing status. Valid values: `SIGNING`, `NOT_SIGNING`. Defaults to `SIGNING`.
   203  	SigningStatus pulumi.StringPtrInput
   204  }
   205  
   206  func (HostedZoneDnsSecArgs) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*hostedZoneDnsSecArgs)(nil)).Elem()
   208  }
   209  
   210  type HostedZoneDnsSecInput interface {
   211  	pulumi.Input
   212  
   213  	ToHostedZoneDnsSecOutput() HostedZoneDnsSecOutput
   214  	ToHostedZoneDnsSecOutputWithContext(ctx context.Context) HostedZoneDnsSecOutput
   215  }
   216  
   217  func (*HostedZoneDnsSec) ElementType() reflect.Type {
   218  	return reflect.TypeOf((**HostedZoneDnsSec)(nil)).Elem()
   219  }
   220  
   221  func (i *HostedZoneDnsSec) ToHostedZoneDnsSecOutput() HostedZoneDnsSecOutput {
   222  	return i.ToHostedZoneDnsSecOutputWithContext(context.Background())
   223  }
   224  
   225  func (i *HostedZoneDnsSec) ToHostedZoneDnsSecOutputWithContext(ctx context.Context) HostedZoneDnsSecOutput {
   226  	return pulumi.ToOutputWithContext(ctx, i).(HostedZoneDnsSecOutput)
   227  }
   228  
   229  // HostedZoneDnsSecArrayInput is an input type that accepts HostedZoneDnsSecArray and HostedZoneDnsSecArrayOutput values.
   230  // You can construct a concrete instance of `HostedZoneDnsSecArrayInput` via:
   231  //
   232  //	HostedZoneDnsSecArray{ HostedZoneDnsSecArgs{...} }
   233  type HostedZoneDnsSecArrayInput interface {
   234  	pulumi.Input
   235  
   236  	ToHostedZoneDnsSecArrayOutput() HostedZoneDnsSecArrayOutput
   237  	ToHostedZoneDnsSecArrayOutputWithContext(context.Context) HostedZoneDnsSecArrayOutput
   238  }
   239  
   240  type HostedZoneDnsSecArray []HostedZoneDnsSecInput
   241  
   242  func (HostedZoneDnsSecArray) ElementType() reflect.Type {
   243  	return reflect.TypeOf((*[]*HostedZoneDnsSec)(nil)).Elem()
   244  }
   245  
   246  func (i HostedZoneDnsSecArray) ToHostedZoneDnsSecArrayOutput() HostedZoneDnsSecArrayOutput {
   247  	return i.ToHostedZoneDnsSecArrayOutputWithContext(context.Background())
   248  }
   249  
   250  func (i HostedZoneDnsSecArray) ToHostedZoneDnsSecArrayOutputWithContext(ctx context.Context) HostedZoneDnsSecArrayOutput {
   251  	return pulumi.ToOutputWithContext(ctx, i).(HostedZoneDnsSecArrayOutput)
   252  }
   253  
   254  // HostedZoneDnsSecMapInput is an input type that accepts HostedZoneDnsSecMap and HostedZoneDnsSecMapOutput values.
   255  // You can construct a concrete instance of `HostedZoneDnsSecMapInput` via:
   256  //
   257  //	HostedZoneDnsSecMap{ "key": HostedZoneDnsSecArgs{...} }
   258  type HostedZoneDnsSecMapInput interface {
   259  	pulumi.Input
   260  
   261  	ToHostedZoneDnsSecMapOutput() HostedZoneDnsSecMapOutput
   262  	ToHostedZoneDnsSecMapOutputWithContext(context.Context) HostedZoneDnsSecMapOutput
   263  }
   264  
   265  type HostedZoneDnsSecMap map[string]HostedZoneDnsSecInput
   266  
   267  func (HostedZoneDnsSecMap) ElementType() reflect.Type {
   268  	return reflect.TypeOf((*map[string]*HostedZoneDnsSec)(nil)).Elem()
   269  }
   270  
   271  func (i HostedZoneDnsSecMap) ToHostedZoneDnsSecMapOutput() HostedZoneDnsSecMapOutput {
   272  	return i.ToHostedZoneDnsSecMapOutputWithContext(context.Background())
   273  }
   274  
   275  func (i HostedZoneDnsSecMap) ToHostedZoneDnsSecMapOutputWithContext(ctx context.Context) HostedZoneDnsSecMapOutput {
   276  	return pulumi.ToOutputWithContext(ctx, i).(HostedZoneDnsSecMapOutput)
   277  }
   278  
   279  type HostedZoneDnsSecOutput struct{ *pulumi.OutputState }
   280  
   281  func (HostedZoneDnsSecOutput) ElementType() reflect.Type {
   282  	return reflect.TypeOf((**HostedZoneDnsSec)(nil)).Elem()
   283  }
   284  
   285  func (o HostedZoneDnsSecOutput) ToHostedZoneDnsSecOutput() HostedZoneDnsSecOutput {
   286  	return o
   287  }
   288  
   289  func (o HostedZoneDnsSecOutput) ToHostedZoneDnsSecOutputWithContext(ctx context.Context) HostedZoneDnsSecOutput {
   290  	return o
   291  }
   292  
   293  // Identifier of the Route 53 Hosted Zone.
   294  //
   295  // The following arguments are optional:
   296  func (o HostedZoneDnsSecOutput) HostedZoneId() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *HostedZoneDnsSec) pulumi.StringOutput { return v.HostedZoneId }).(pulumi.StringOutput)
   298  }
   299  
   300  // Hosted Zone signing status. Valid values: `SIGNING`, `NOT_SIGNING`. Defaults to `SIGNING`.
   301  func (o HostedZoneDnsSecOutput) SigningStatus() pulumi.StringPtrOutput {
   302  	return o.ApplyT(func(v *HostedZoneDnsSec) pulumi.StringPtrOutput { return v.SigningStatus }).(pulumi.StringPtrOutput)
   303  }
   304  
   305  type HostedZoneDnsSecArrayOutput struct{ *pulumi.OutputState }
   306  
   307  func (HostedZoneDnsSecArrayOutput) ElementType() reflect.Type {
   308  	return reflect.TypeOf((*[]*HostedZoneDnsSec)(nil)).Elem()
   309  }
   310  
   311  func (o HostedZoneDnsSecArrayOutput) ToHostedZoneDnsSecArrayOutput() HostedZoneDnsSecArrayOutput {
   312  	return o
   313  }
   314  
   315  func (o HostedZoneDnsSecArrayOutput) ToHostedZoneDnsSecArrayOutputWithContext(ctx context.Context) HostedZoneDnsSecArrayOutput {
   316  	return o
   317  }
   318  
   319  func (o HostedZoneDnsSecArrayOutput) Index(i pulumi.IntInput) HostedZoneDnsSecOutput {
   320  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HostedZoneDnsSec {
   321  		return vs[0].([]*HostedZoneDnsSec)[vs[1].(int)]
   322  	}).(HostedZoneDnsSecOutput)
   323  }
   324  
   325  type HostedZoneDnsSecMapOutput struct{ *pulumi.OutputState }
   326  
   327  func (HostedZoneDnsSecMapOutput) ElementType() reflect.Type {
   328  	return reflect.TypeOf((*map[string]*HostedZoneDnsSec)(nil)).Elem()
   329  }
   330  
   331  func (o HostedZoneDnsSecMapOutput) ToHostedZoneDnsSecMapOutput() HostedZoneDnsSecMapOutput {
   332  	return o
   333  }
   334  
   335  func (o HostedZoneDnsSecMapOutput) ToHostedZoneDnsSecMapOutputWithContext(ctx context.Context) HostedZoneDnsSecMapOutput {
   336  	return o
   337  }
   338  
   339  func (o HostedZoneDnsSecMapOutput) MapIndex(k pulumi.StringInput) HostedZoneDnsSecOutput {
   340  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HostedZoneDnsSec {
   341  		return vs[0].(map[string]*HostedZoneDnsSec)[vs[1].(string)]
   342  	}).(HostedZoneDnsSecOutput)
   343  }
   344  
   345  func init() {
   346  	pulumi.RegisterInputType(reflect.TypeOf((*HostedZoneDnsSecInput)(nil)).Elem(), &HostedZoneDnsSec{})
   347  	pulumi.RegisterInputType(reflect.TypeOf((*HostedZoneDnsSecArrayInput)(nil)).Elem(), HostedZoneDnsSecArray{})
   348  	pulumi.RegisterInputType(reflect.TypeOf((*HostedZoneDnsSecMapInput)(nil)).Elem(), HostedZoneDnsSecMap{})
   349  	pulumi.RegisterOutputType(HostedZoneDnsSecOutput{})
   350  	pulumi.RegisterOutputType(HostedZoneDnsSecArrayOutput{})
   351  	pulumi.RegisterOutputType(HostedZoneDnsSecMapOutput{})
   352  }