github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/resolverFirewallConfig.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  // Provides a Route 53 Resolver DNS Firewall config resource.
    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/ec2"
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
    34  //				CidrBlock:          pulumi.String("10.0.0.0/16"),
    35  //				EnableDnsSupport:   pulumi.Bool(true),
    36  //				EnableDnsHostnames: pulumi.Bool(true),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			_, err = route53.NewResolverFirewallConfig(ctx, "example", &route53.ResolverFirewallConfigArgs{
    42  //				ResourceId:       example.ID(),
    43  //				FirewallFailOpen: pulumi.String("ENABLED"),
    44  //			})
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ## Import
    56  //
    57  // Using `pulumi import`, import Route 53 Resolver DNS Firewall configs using the Route 53 Resolver DNS Firewall config ID. For example:
    58  //
    59  // ```sh
    60  // $ pulumi import aws:route53/resolverFirewallConfig:ResolverFirewallConfig example rdsc-be1866ecc1683e95
    61  // ```
    62  type ResolverFirewallConfig struct {
    63  	pulumi.CustomResourceState
    64  
    65  	// Determines how Route 53 Resolver handles queries during failures, for example when all traffic that is sent to DNS Firewall fails to receive a reply. By default, fail open is disabled, which means the failure mode is closed. This approach favors security over availability. DNS Firewall blocks queries that it is unable to evaluate properly. If you enable this option, the failure mode is open. This approach favors availability over security. DNS Firewall allows queries to proceed if it is unable to properly evaluate them. Valid values: `ENABLED`, `DISABLED`.
    66  	FirewallFailOpen pulumi.StringOutput `pulumi:"firewallFailOpen"`
    67  	// The AWS account ID of the owner of the VPC that this firewall configuration applies to.
    68  	OwnerId pulumi.StringOutput `pulumi:"ownerId"`
    69  	// The ID of the VPC that the configuration is for.
    70  	ResourceId pulumi.StringOutput `pulumi:"resourceId"`
    71  }
    72  
    73  // NewResolverFirewallConfig registers a new resource with the given unique name, arguments, and options.
    74  func NewResolverFirewallConfig(ctx *pulumi.Context,
    75  	name string, args *ResolverFirewallConfigArgs, opts ...pulumi.ResourceOption) (*ResolverFirewallConfig, error) {
    76  	if args == nil {
    77  		return nil, errors.New("missing one or more required arguments")
    78  	}
    79  
    80  	if args.ResourceId == nil {
    81  		return nil, errors.New("invalid value for required argument 'ResourceId'")
    82  	}
    83  	opts = internal.PkgResourceDefaultOpts(opts)
    84  	var resource ResolverFirewallConfig
    85  	err := ctx.RegisterResource("aws:route53/resolverFirewallConfig:ResolverFirewallConfig", name, args, &resource, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return &resource, nil
    90  }
    91  
    92  // GetResolverFirewallConfig gets an existing ResolverFirewallConfig resource's state with the given name, ID, and optional
    93  // state properties that are used to uniquely qualify the lookup (nil if not required).
    94  func GetResolverFirewallConfig(ctx *pulumi.Context,
    95  	name string, id pulumi.IDInput, state *ResolverFirewallConfigState, opts ...pulumi.ResourceOption) (*ResolverFirewallConfig, error) {
    96  	var resource ResolverFirewallConfig
    97  	err := ctx.ReadResource("aws:route53/resolverFirewallConfig:ResolverFirewallConfig", name, id, state, &resource, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return &resource, nil
   102  }
   103  
   104  // Input properties used for looking up and filtering ResolverFirewallConfig resources.
   105  type resolverFirewallConfigState struct {
   106  	// Determines how Route 53 Resolver handles queries during failures, for example when all traffic that is sent to DNS Firewall fails to receive a reply. By default, fail open is disabled, which means the failure mode is closed. This approach favors security over availability. DNS Firewall blocks queries that it is unable to evaluate properly. If you enable this option, the failure mode is open. This approach favors availability over security. DNS Firewall allows queries to proceed if it is unable to properly evaluate them. Valid values: `ENABLED`, `DISABLED`.
   107  	FirewallFailOpen *string `pulumi:"firewallFailOpen"`
   108  	// The AWS account ID of the owner of the VPC that this firewall configuration applies to.
   109  	OwnerId *string `pulumi:"ownerId"`
   110  	// The ID of the VPC that the configuration is for.
   111  	ResourceId *string `pulumi:"resourceId"`
   112  }
   113  
   114  type ResolverFirewallConfigState struct {
   115  	// Determines how Route 53 Resolver handles queries during failures, for example when all traffic that is sent to DNS Firewall fails to receive a reply. By default, fail open is disabled, which means the failure mode is closed. This approach favors security over availability. DNS Firewall blocks queries that it is unable to evaluate properly. If you enable this option, the failure mode is open. This approach favors availability over security. DNS Firewall allows queries to proceed if it is unable to properly evaluate them. Valid values: `ENABLED`, `DISABLED`.
   116  	FirewallFailOpen pulumi.StringPtrInput
   117  	// The AWS account ID of the owner of the VPC that this firewall configuration applies to.
   118  	OwnerId pulumi.StringPtrInput
   119  	// The ID of the VPC that the configuration is for.
   120  	ResourceId pulumi.StringPtrInput
   121  }
   122  
   123  func (ResolverFirewallConfigState) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*resolverFirewallConfigState)(nil)).Elem()
   125  }
   126  
   127  type resolverFirewallConfigArgs struct {
   128  	// Determines how Route 53 Resolver handles queries during failures, for example when all traffic that is sent to DNS Firewall fails to receive a reply. By default, fail open is disabled, which means the failure mode is closed. This approach favors security over availability. DNS Firewall blocks queries that it is unable to evaluate properly. If you enable this option, the failure mode is open. This approach favors availability over security. DNS Firewall allows queries to proceed if it is unable to properly evaluate them. Valid values: `ENABLED`, `DISABLED`.
   129  	FirewallFailOpen *string `pulumi:"firewallFailOpen"`
   130  	// The ID of the VPC that the configuration is for.
   131  	ResourceId string `pulumi:"resourceId"`
   132  }
   133  
   134  // The set of arguments for constructing a ResolverFirewallConfig resource.
   135  type ResolverFirewallConfigArgs struct {
   136  	// Determines how Route 53 Resolver handles queries during failures, for example when all traffic that is sent to DNS Firewall fails to receive a reply. By default, fail open is disabled, which means the failure mode is closed. This approach favors security over availability. DNS Firewall blocks queries that it is unable to evaluate properly. If you enable this option, the failure mode is open. This approach favors availability over security. DNS Firewall allows queries to proceed if it is unable to properly evaluate them. Valid values: `ENABLED`, `DISABLED`.
   137  	FirewallFailOpen pulumi.StringPtrInput
   138  	// The ID of the VPC that the configuration is for.
   139  	ResourceId pulumi.StringInput
   140  }
   141  
   142  func (ResolverFirewallConfigArgs) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*resolverFirewallConfigArgs)(nil)).Elem()
   144  }
   145  
   146  type ResolverFirewallConfigInput interface {
   147  	pulumi.Input
   148  
   149  	ToResolverFirewallConfigOutput() ResolverFirewallConfigOutput
   150  	ToResolverFirewallConfigOutputWithContext(ctx context.Context) ResolverFirewallConfigOutput
   151  }
   152  
   153  func (*ResolverFirewallConfig) ElementType() reflect.Type {
   154  	return reflect.TypeOf((**ResolverFirewallConfig)(nil)).Elem()
   155  }
   156  
   157  func (i *ResolverFirewallConfig) ToResolverFirewallConfigOutput() ResolverFirewallConfigOutput {
   158  	return i.ToResolverFirewallConfigOutputWithContext(context.Background())
   159  }
   160  
   161  func (i *ResolverFirewallConfig) ToResolverFirewallConfigOutputWithContext(ctx context.Context) ResolverFirewallConfigOutput {
   162  	return pulumi.ToOutputWithContext(ctx, i).(ResolverFirewallConfigOutput)
   163  }
   164  
   165  // ResolverFirewallConfigArrayInput is an input type that accepts ResolverFirewallConfigArray and ResolverFirewallConfigArrayOutput values.
   166  // You can construct a concrete instance of `ResolverFirewallConfigArrayInput` via:
   167  //
   168  //	ResolverFirewallConfigArray{ ResolverFirewallConfigArgs{...} }
   169  type ResolverFirewallConfigArrayInput interface {
   170  	pulumi.Input
   171  
   172  	ToResolverFirewallConfigArrayOutput() ResolverFirewallConfigArrayOutput
   173  	ToResolverFirewallConfigArrayOutputWithContext(context.Context) ResolverFirewallConfigArrayOutput
   174  }
   175  
   176  type ResolverFirewallConfigArray []ResolverFirewallConfigInput
   177  
   178  func (ResolverFirewallConfigArray) ElementType() reflect.Type {
   179  	return reflect.TypeOf((*[]*ResolverFirewallConfig)(nil)).Elem()
   180  }
   181  
   182  func (i ResolverFirewallConfigArray) ToResolverFirewallConfigArrayOutput() ResolverFirewallConfigArrayOutput {
   183  	return i.ToResolverFirewallConfigArrayOutputWithContext(context.Background())
   184  }
   185  
   186  func (i ResolverFirewallConfigArray) ToResolverFirewallConfigArrayOutputWithContext(ctx context.Context) ResolverFirewallConfigArrayOutput {
   187  	return pulumi.ToOutputWithContext(ctx, i).(ResolverFirewallConfigArrayOutput)
   188  }
   189  
   190  // ResolverFirewallConfigMapInput is an input type that accepts ResolverFirewallConfigMap and ResolverFirewallConfigMapOutput values.
   191  // You can construct a concrete instance of `ResolverFirewallConfigMapInput` via:
   192  //
   193  //	ResolverFirewallConfigMap{ "key": ResolverFirewallConfigArgs{...} }
   194  type ResolverFirewallConfigMapInput interface {
   195  	pulumi.Input
   196  
   197  	ToResolverFirewallConfigMapOutput() ResolverFirewallConfigMapOutput
   198  	ToResolverFirewallConfigMapOutputWithContext(context.Context) ResolverFirewallConfigMapOutput
   199  }
   200  
   201  type ResolverFirewallConfigMap map[string]ResolverFirewallConfigInput
   202  
   203  func (ResolverFirewallConfigMap) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*map[string]*ResolverFirewallConfig)(nil)).Elem()
   205  }
   206  
   207  func (i ResolverFirewallConfigMap) ToResolverFirewallConfigMapOutput() ResolverFirewallConfigMapOutput {
   208  	return i.ToResolverFirewallConfigMapOutputWithContext(context.Background())
   209  }
   210  
   211  func (i ResolverFirewallConfigMap) ToResolverFirewallConfigMapOutputWithContext(ctx context.Context) ResolverFirewallConfigMapOutput {
   212  	return pulumi.ToOutputWithContext(ctx, i).(ResolverFirewallConfigMapOutput)
   213  }
   214  
   215  type ResolverFirewallConfigOutput struct{ *pulumi.OutputState }
   216  
   217  func (ResolverFirewallConfigOutput) ElementType() reflect.Type {
   218  	return reflect.TypeOf((**ResolverFirewallConfig)(nil)).Elem()
   219  }
   220  
   221  func (o ResolverFirewallConfigOutput) ToResolverFirewallConfigOutput() ResolverFirewallConfigOutput {
   222  	return o
   223  }
   224  
   225  func (o ResolverFirewallConfigOutput) ToResolverFirewallConfigOutputWithContext(ctx context.Context) ResolverFirewallConfigOutput {
   226  	return o
   227  }
   228  
   229  // Determines how Route 53 Resolver handles queries during failures, for example when all traffic that is sent to DNS Firewall fails to receive a reply. By default, fail open is disabled, which means the failure mode is closed. This approach favors security over availability. DNS Firewall blocks queries that it is unable to evaluate properly. If you enable this option, the failure mode is open. This approach favors availability over security. DNS Firewall allows queries to proceed if it is unable to properly evaluate them. Valid values: `ENABLED`, `DISABLED`.
   230  func (o ResolverFirewallConfigOutput) FirewallFailOpen() pulumi.StringOutput {
   231  	return o.ApplyT(func(v *ResolverFirewallConfig) pulumi.StringOutput { return v.FirewallFailOpen }).(pulumi.StringOutput)
   232  }
   233  
   234  // The AWS account ID of the owner of the VPC that this firewall configuration applies to.
   235  func (o ResolverFirewallConfigOutput) OwnerId() pulumi.StringOutput {
   236  	return o.ApplyT(func(v *ResolverFirewallConfig) pulumi.StringOutput { return v.OwnerId }).(pulumi.StringOutput)
   237  }
   238  
   239  // The ID of the VPC that the configuration is for.
   240  func (o ResolverFirewallConfigOutput) ResourceId() pulumi.StringOutput {
   241  	return o.ApplyT(func(v *ResolverFirewallConfig) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput)
   242  }
   243  
   244  type ResolverFirewallConfigArrayOutput struct{ *pulumi.OutputState }
   245  
   246  func (ResolverFirewallConfigArrayOutput) ElementType() reflect.Type {
   247  	return reflect.TypeOf((*[]*ResolverFirewallConfig)(nil)).Elem()
   248  }
   249  
   250  func (o ResolverFirewallConfigArrayOutput) ToResolverFirewallConfigArrayOutput() ResolverFirewallConfigArrayOutput {
   251  	return o
   252  }
   253  
   254  func (o ResolverFirewallConfigArrayOutput) ToResolverFirewallConfigArrayOutputWithContext(ctx context.Context) ResolverFirewallConfigArrayOutput {
   255  	return o
   256  }
   257  
   258  func (o ResolverFirewallConfigArrayOutput) Index(i pulumi.IntInput) ResolverFirewallConfigOutput {
   259  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResolverFirewallConfig {
   260  		return vs[0].([]*ResolverFirewallConfig)[vs[1].(int)]
   261  	}).(ResolverFirewallConfigOutput)
   262  }
   263  
   264  type ResolverFirewallConfigMapOutput struct{ *pulumi.OutputState }
   265  
   266  func (ResolverFirewallConfigMapOutput) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*map[string]*ResolverFirewallConfig)(nil)).Elem()
   268  }
   269  
   270  func (o ResolverFirewallConfigMapOutput) ToResolverFirewallConfigMapOutput() ResolverFirewallConfigMapOutput {
   271  	return o
   272  }
   273  
   274  func (o ResolverFirewallConfigMapOutput) ToResolverFirewallConfigMapOutputWithContext(ctx context.Context) ResolverFirewallConfigMapOutput {
   275  	return o
   276  }
   277  
   278  func (o ResolverFirewallConfigMapOutput) MapIndex(k pulumi.StringInput) ResolverFirewallConfigOutput {
   279  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResolverFirewallConfig {
   280  		return vs[0].(map[string]*ResolverFirewallConfig)[vs[1].(string)]
   281  	}).(ResolverFirewallConfigOutput)
   282  }
   283  
   284  func init() {
   285  	pulumi.RegisterInputType(reflect.TypeOf((*ResolverFirewallConfigInput)(nil)).Elem(), &ResolverFirewallConfig{})
   286  	pulumi.RegisterInputType(reflect.TypeOf((*ResolverFirewallConfigArrayInput)(nil)).Elem(), ResolverFirewallConfigArray{})
   287  	pulumi.RegisterInputType(reflect.TypeOf((*ResolverFirewallConfigMapInput)(nil)).Elem(), ResolverFirewallConfigMap{})
   288  	pulumi.RegisterOutputType(ResolverFirewallConfigOutput{})
   289  	pulumi.RegisterOutputType(ResolverFirewallConfigArrayOutput{})
   290  	pulumi.RegisterOutputType(ResolverFirewallConfigMapOutput{})
   291  }