github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/resolverQueryLogConfigAssociation.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 query logging configuration association 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/route53"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := route53.NewResolverQueryLogConfigAssociation(ctx, "example", &route53.ResolverQueryLogConfigAssociationArgs{
    33  //				ResolverQueryLogConfigId: pulumi.Any(exampleAwsRoute53ResolverQueryLogConfig.Id),
    34  //				ResourceId:               pulumi.Any(exampleAwsVpc.Id),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import  Route 53 Resolver query logging configuration associations using the Route 53 Resolver query logging configuration association ID. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:route53/resolverQueryLogConfigAssociation:ResolverQueryLogConfigAssociation example rqlca-b320624fef3c4d70
    52  // ```
    53  type ResolverQueryLogConfigAssociation struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// The ID of the Route 53 Resolver query logging configuration that you want to associate a VPC with.
    57  	ResolverQueryLogConfigId pulumi.StringOutput `pulumi:"resolverQueryLogConfigId"`
    58  	// The ID of a VPC that you want this query logging configuration to log queries for.
    59  	ResourceId pulumi.StringOutput `pulumi:"resourceId"`
    60  }
    61  
    62  // NewResolverQueryLogConfigAssociation registers a new resource with the given unique name, arguments, and options.
    63  func NewResolverQueryLogConfigAssociation(ctx *pulumi.Context,
    64  	name string, args *ResolverQueryLogConfigAssociationArgs, opts ...pulumi.ResourceOption) (*ResolverQueryLogConfigAssociation, error) {
    65  	if args == nil {
    66  		return nil, errors.New("missing one or more required arguments")
    67  	}
    68  
    69  	if args.ResolverQueryLogConfigId == nil {
    70  		return nil, errors.New("invalid value for required argument 'ResolverQueryLogConfigId'")
    71  	}
    72  	if args.ResourceId == nil {
    73  		return nil, errors.New("invalid value for required argument 'ResourceId'")
    74  	}
    75  	opts = internal.PkgResourceDefaultOpts(opts)
    76  	var resource ResolverQueryLogConfigAssociation
    77  	err := ctx.RegisterResource("aws:route53/resolverQueryLogConfigAssociation:ResolverQueryLogConfigAssociation", name, args, &resource, opts...)
    78  	if err != nil {
    79  		return nil, err
    80  	}
    81  	return &resource, nil
    82  }
    83  
    84  // GetResolverQueryLogConfigAssociation gets an existing ResolverQueryLogConfigAssociation resource's state with the given name, ID, and optional
    85  // state properties that are used to uniquely qualify the lookup (nil if not required).
    86  func GetResolverQueryLogConfigAssociation(ctx *pulumi.Context,
    87  	name string, id pulumi.IDInput, state *ResolverQueryLogConfigAssociationState, opts ...pulumi.ResourceOption) (*ResolverQueryLogConfigAssociation, error) {
    88  	var resource ResolverQueryLogConfigAssociation
    89  	err := ctx.ReadResource("aws:route53/resolverQueryLogConfigAssociation:ResolverQueryLogConfigAssociation", name, id, state, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // Input properties used for looking up and filtering ResolverQueryLogConfigAssociation resources.
    97  type resolverQueryLogConfigAssociationState struct {
    98  	// The ID of the Route 53 Resolver query logging configuration that you want to associate a VPC with.
    99  	ResolverQueryLogConfigId *string `pulumi:"resolverQueryLogConfigId"`
   100  	// The ID of a VPC that you want this query logging configuration to log queries for.
   101  	ResourceId *string `pulumi:"resourceId"`
   102  }
   103  
   104  type ResolverQueryLogConfigAssociationState struct {
   105  	// The ID of the Route 53 Resolver query logging configuration that you want to associate a VPC with.
   106  	ResolverQueryLogConfigId pulumi.StringPtrInput
   107  	// The ID of a VPC that you want this query logging configuration to log queries for.
   108  	ResourceId pulumi.StringPtrInput
   109  }
   110  
   111  func (ResolverQueryLogConfigAssociationState) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*resolverQueryLogConfigAssociationState)(nil)).Elem()
   113  }
   114  
   115  type resolverQueryLogConfigAssociationArgs struct {
   116  	// The ID of the Route 53 Resolver query logging configuration that you want to associate a VPC with.
   117  	ResolverQueryLogConfigId string `pulumi:"resolverQueryLogConfigId"`
   118  	// The ID of a VPC that you want this query logging configuration to log queries for.
   119  	ResourceId string `pulumi:"resourceId"`
   120  }
   121  
   122  // The set of arguments for constructing a ResolverQueryLogConfigAssociation resource.
   123  type ResolverQueryLogConfigAssociationArgs struct {
   124  	// The ID of the Route 53 Resolver query logging configuration that you want to associate a VPC with.
   125  	ResolverQueryLogConfigId pulumi.StringInput
   126  	// The ID of a VPC that you want this query logging configuration to log queries for.
   127  	ResourceId pulumi.StringInput
   128  }
   129  
   130  func (ResolverQueryLogConfigAssociationArgs) ElementType() reflect.Type {
   131  	return reflect.TypeOf((*resolverQueryLogConfigAssociationArgs)(nil)).Elem()
   132  }
   133  
   134  type ResolverQueryLogConfigAssociationInput interface {
   135  	pulumi.Input
   136  
   137  	ToResolverQueryLogConfigAssociationOutput() ResolverQueryLogConfigAssociationOutput
   138  	ToResolverQueryLogConfigAssociationOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationOutput
   139  }
   140  
   141  func (*ResolverQueryLogConfigAssociation) ElementType() reflect.Type {
   142  	return reflect.TypeOf((**ResolverQueryLogConfigAssociation)(nil)).Elem()
   143  }
   144  
   145  func (i *ResolverQueryLogConfigAssociation) ToResolverQueryLogConfigAssociationOutput() ResolverQueryLogConfigAssociationOutput {
   146  	return i.ToResolverQueryLogConfigAssociationOutputWithContext(context.Background())
   147  }
   148  
   149  func (i *ResolverQueryLogConfigAssociation) ToResolverQueryLogConfigAssociationOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationOutput {
   150  	return pulumi.ToOutputWithContext(ctx, i).(ResolverQueryLogConfigAssociationOutput)
   151  }
   152  
   153  // ResolverQueryLogConfigAssociationArrayInput is an input type that accepts ResolverQueryLogConfigAssociationArray and ResolverQueryLogConfigAssociationArrayOutput values.
   154  // You can construct a concrete instance of `ResolverQueryLogConfigAssociationArrayInput` via:
   155  //
   156  //	ResolverQueryLogConfigAssociationArray{ ResolverQueryLogConfigAssociationArgs{...} }
   157  type ResolverQueryLogConfigAssociationArrayInput interface {
   158  	pulumi.Input
   159  
   160  	ToResolverQueryLogConfigAssociationArrayOutput() ResolverQueryLogConfigAssociationArrayOutput
   161  	ToResolverQueryLogConfigAssociationArrayOutputWithContext(context.Context) ResolverQueryLogConfigAssociationArrayOutput
   162  }
   163  
   164  type ResolverQueryLogConfigAssociationArray []ResolverQueryLogConfigAssociationInput
   165  
   166  func (ResolverQueryLogConfigAssociationArray) ElementType() reflect.Type {
   167  	return reflect.TypeOf((*[]*ResolverQueryLogConfigAssociation)(nil)).Elem()
   168  }
   169  
   170  func (i ResolverQueryLogConfigAssociationArray) ToResolverQueryLogConfigAssociationArrayOutput() ResolverQueryLogConfigAssociationArrayOutput {
   171  	return i.ToResolverQueryLogConfigAssociationArrayOutputWithContext(context.Background())
   172  }
   173  
   174  func (i ResolverQueryLogConfigAssociationArray) ToResolverQueryLogConfigAssociationArrayOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationArrayOutput {
   175  	return pulumi.ToOutputWithContext(ctx, i).(ResolverQueryLogConfigAssociationArrayOutput)
   176  }
   177  
   178  // ResolverQueryLogConfigAssociationMapInput is an input type that accepts ResolverQueryLogConfigAssociationMap and ResolverQueryLogConfigAssociationMapOutput values.
   179  // You can construct a concrete instance of `ResolverQueryLogConfigAssociationMapInput` via:
   180  //
   181  //	ResolverQueryLogConfigAssociationMap{ "key": ResolverQueryLogConfigAssociationArgs{...} }
   182  type ResolverQueryLogConfigAssociationMapInput interface {
   183  	pulumi.Input
   184  
   185  	ToResolverQueryLogConfigAssociationMapOutput() ResolverQueryLogConfigAssociationMapOutput
   186  	ToResolverQueryLogConfigAssociationMapOutputWithContext(context.Context) ResolverQueryLogConfigAssociationMapOutput
   187  }
   188  
   189  type ResolverQueryLogConfigAssociationMap map[string]ResolverQueryLogConfigAssociationInput
   190  
   191  func (ResolverQueryLogConfigAssociationMap) ElementType() reflect.Type {
   192  	return reflect.TypeOf((*map[string]*ResolverQueryLogConfigAssociation)(nil)).Elem()
   193  }
   194  
   195  func (i ResolverQueryLogConfigAssociationMap) ToResolverQueryLogConfigAssociationMapOutput() ResolverQueryLogConfigAssociationMapOutput {
   196  	return i.ToResolverQueryLogConfigAssociationMapOutputWithContext(context.Background())
   197  }
   198  
   199  func (i ResolverQueryLogConfigAssociationMap) ToResolverQueryLogConfigAssociationMapOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationMapOutput {
   200  	return pulumi.ToOutputWithContext(ctx, i).(ResolverQueryLogConfigAssociationMapOutput)
   201  }
   202  
   203  type ResolverQueryLogConfigAssociationOutput struct{ *pulumi.OutputState }
   204  
   205  func (ResolverQueryLogConfigAssociationOutput) ElementType() reflect.Type {
   206  	return reflect.TypeOf((**ResolverQueryLogConfigAssociation)(nil)).Elem()
   207  }
   208  
   209  func (o ResolverQueryLogConfigAssociationOutput) ToResolverQueryLogConfigAssociationOutput() ResolverQueryLogConfigAssociationOutput {
   210  	return o
   211  }
   212  
   213  func (o ResolverQueryLogConfigAssociationOutput) ToResolverQueryLogConfigAssociationOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationOutput {
   214  	return o
   215  }
   216  
   217  // The ID of the Route 53 Resolver query logging configuration that you want to associate a VPC with.
   218  func (o ResolverQueryLogConfigAssociationOutput) ResolverQueryLogConfigId() pulumi.StringOutput {
   219  	return o.ApplyT(func(v *ResolverQueryLogConfigAssociation) pulumi.StringOutput { return v.ResolverQueryLogConfigId }).(pulumi.StringOutput)
   220  }
   221  
   222  // The ID of a VPC that you want this query logging configuration to log queries for.
   223  func (o ResolverQueryLogConfigAssociationOutput) ResourceId() pulumi.StringOutput {
   224  	return o.ApplyT(func(v *ResolverQueryLogConfigAssociation) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput)
   225  }
   226  
   227  type ResolverQueryLogConfigAssociationArrayOutput struct{ *pulumi.OutputState }
   228  
   229  func (ResolverQueryLogConfigAssociationArrayOutput) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*[]*ResolverQueryLogConfigAssociation)(nil)).Elem()
   231  }
   232  
   233  func (o ResolverQueryLogConfigAssociationArrayOutput) ToResolverQueryLogConfigAssociationArrayOutput() ResolverQueryLogConfigAssociationArrayOutput {
   234  	return o
   235  }
   236  
   237  func (o ResolverQueryLogConfigAssociationArrayOutput) ToResolverQueryLogConfigAssociationArrayOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationArrayOutput {
   238  	return o
   239  }
   240  
   241  func (o ResolverQueryLogConfigAssociationArrayOutput) Index(i pulumi.IntInput) ResolverQueryLogConfigAssociationOutput {
   242  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResolverQueryLogConfigAssociation {
   243  		return vs[0].([]*ResolverQueryLogConfigAssociation)[vs[1].(int)]
   244  	}).(ResolverQueryLogConfigAssociationOutput)
   245  }
   246  
   247  type ResolverQueryLogConfigAssociationMapOutput struct{ *pulumi.OutputState }
   248  
   249  func (ResolverQueryLogConfigAssociationMapOutput) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*map[string]*ResolverQueryLogConfigAssociation)(nil)).Elem()
   251  }
   252  
   253  func (o ResolverQueryLogConfigAssociationMapOutput) ToResolverQueryLogConfigAssociationMapOutput() ResolverQueryLogConfigAssociationMapOutput {
   254  	return o
   255  }
   256  
   257  func (o ResolverQueryLogConfigAssociationMapOutput) ToResolverQueryLogConfigAssociationMapOutputWithContext(ctx context.Context) ResolverQueryLogConfigAssociationMapOutput {
   258  	return o
   259  }
   260  
   261  func (o ResolverQueryLogConfigAssociationMapOutput) MapIndex(k pulumi.StringInput) ResolverQueryLogConfigAssociationOutput {
   262  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResolverQueryLogConfigAssociation {
   263  		return vs[0].(map[string]*ResolverQueryLogConfigAssociation)[vs[1].(string)]
   264  	}).(ResolverQueryLogConfigAssociationOutput)
   265  }
   266  
   267  func init() {
   268  	pulumi.RegisterInputType(reflect.TypeOf((*ResolverQueryLogConfigAssociationInput)(nil)).Elem(), &ResolverQueryLogConfigAssociation{})
   269  	pulumi.RegisterInputType(reflect.TypeOf((*ResolverQueryLogConfigAssociationArrayInput)(nil)).Elem(), ResolverQueryLogConfigAssociationArray{})
   270  	pulumi.RegisterInputType(reflect.TypeOf((*ResolverQueryLogConfigAssociationMapInput)(nil)).Elem(), ResolverQueryLogConfigAssociationMap{})
   271  	pulumi.RegisterOutputType(ResolverQueryLogConfigAssociationOutput{})
   272  	pulumi.RegisterOutputType(ResolverQueryLogConfigAssociationArrayOutput{})
   273  	pulumi.RegisterOutputType(ResolverQueryLogConfigAssociationMapOutput{})
   274  }