github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/resolverConfig.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 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.NewResolverConfig(ctx, "example", &route53.ResolverConfigArgs{ 42 // ResourceId: example.ID(), 43 // AutodefinedReverseFlag: pulumi.String("DISABLE"), 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 configs using the Route 53 Resolver config ID. For example: 58 // 59 // ```sh 60 // $ pulumi import aws:route53/resolverConfig:ResolverConfig example rslvr-rc-715aa20c73a23da7 61 // ``` 62 type ResolverConfig struct { 63 pulumi.CustomResourceState 64 65 // Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`. 66 AutodefinedReverseFlag pulumi.StringOutput `pulumi:"autodefinedReverseFlag"` 67 // The AWS account ID of the owner of the VPC that this resolver 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 // NewResolverConfig registers a new resource with the given unique name, arguments, and options. 74 func NewResolverConfig(ctx *pulumi.Context, 75 name string, args *ResolverConfigArgs, opts ...pulumi.ResourceOption) (*ResolverConfig, error) { 76 if args == nil { 77 return nil, errors.New("missing one or more required arguments") 78 } 79 80 if args.AutodefinedReverseFlag == nil { 81 return nil, errors.New("invalid value for required argument 'AutodefinedReverseFlag'") 82 } 83 if args.ResourceId == nil { 84 return nil, errors.New("invalid value for required argument 'ResourceId'") 85 } 86 opts = internal.PkgResourceDefaultOpts(opts) 87 var resource ResolverConfig 88 err := ctx.RegisterResource("aws:route53/resolverConfig:ResolverConfig", name, args, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // GetResolverConfig gets an existing ResolverConfig resource's state with the given name, ID, and optional 96 // state properties that are used to uniquely qualify the lookup (nil if not required). 97 func GetResolverConfig(ctx *pulumi.Context, 98 name string, id pulumi.IDInput, state *ResolverConfigState, opts ...pulumi.ResourceOption) (*ResolverConfig, error) { 99 var resource ResolverConfig 100 err := ctx.ReadResource("aws:route53/resolverConfig:ResolverConfig", name, id, state, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // Input properties used for looking up and filtering ResolverConfig resources. 108 type resolverConfigState struct { 109 // Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`. 110 AutodefinedReverseFlag *string `pulumi:"autodefinedReverseFlag"` 111 // The AWS account ID of the owner of the VPC that this resolver configuration applies to. 112 OwnerId *string `pulumi:"ownerId"` 113 // The ID of the VPC that the configuration is for. 114 ResourceId *string `pulumi:"resourceId"` 115 } 116 117 type ResolverConfigState struct { 118 // Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`. 119 AutodefinedReverseFlag pulumi.StringPtrInput 120 // The AWS account ID of the owner of the VPC that this resolver configuration applies to. 121 OwnerId pulumi.StringPtrInput 122 // The ID of the VPC that the configuration is for. 123 ResourceId pulumi.StringPtrInput 124 } 125 126 func (ResolverConfigState) ElementType() reflect.Type { 127 return reflect.TypeOf((*resolverConfigState)(nil)).Elem() 128 } 129 130 type resolverConfigArgs struct { 131 // Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`. 132 AutodefinedReverseFlag string `pulumi:"autodefinedReverseFlag"` 133 // The ID of the VPC that the configuration is for. 134 ResourceId string `pulumi:"resourceId"` 135 } 136 137 // The set of arguments for constructing a ResolverConfig resource. 138 type ResolverConfigArgs struct { 139 // Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`. 140 AutodefinedReverseFlag pulumi.StringInput 141 // The ID of the VPC that the configuration is for. 142 ResourceId pulumi.StringInput 143 } 144 145 func (ResolverConfigArgs) ElementType() reflect.Type { 146 return reflect.TypeOf((*resolverConfigArgs)(nil)).Elem() 147 } 148 149 type ResolverConfigInput interface { 150 pulumi.Input 151 152 ToResolverConfigOutput() ResolverConfigOutput 153 ToResolverConfigOutputWithContext(ctx context.Context) ResolverConfigOutput 154 } 155 156 func (*ResolverConfig) ElementType() reflect.Type { 157 return reflect.TypeOf((**ResolverConfig)(nil)).Elem() 158 } 159 160 func (i *ResolverConfig) ToResolverConfigOutput() ResolverConfigOutput { 161 return i.ToResolverConfigOutputWithContext(context.Background()) 162 } 163 164 func (i *ResolverConfig) ToResolverConfigOutputWithContext(ctx context.Context) ResolverConfigOutput { 165 return pulumi.ToOutputWithContext(ctx, i).(ResolverConfigOutput) 166 } 167 168 // ResolverConfigArrayInput is an input type that accepts ResolverConfigArray and ResolverConfigArrayOutput values. 169 // You can construct a concrete instance of `ResolverConfigArrayInput` via: 170 // 171 // ResolverConfigArray{ ResolverConfigArgs{...} } 172 type ResolverConfigArrayInput interface { 173 pulumi.Input 174 175 ToResolverConfigArrayOutput() ResolverConfigArrayOutput 176 ToResolverConfigArrayOutputWithContext(context.Context) ResolverConfigArrayOutput 177 } 178 179 type ResolverConfigArray []ResolverConfigInput 180 181 func (ResolverConfigArray) ElementType() reflect.Type { 182 return reflect.TypeOf((*[]*ResolverConfig)(nil)).Elem() 183 } 184 185 func (i ResolverConfigArray) ToResolverConfigArrayOutput() ResolverConfigArrayOutput { 186 return i.ToResolverConfigArrayOutputWithContext(context.Background()) 187 } 188 189 func (i ResolverConfigArray) ToResolverConfigArrayOutputWithContext(ctx context.Context) ResolverConfigArrayOutput { 190 return pulumi.ToOutputWithContext(ctx, i).(ResolverConfigArrayOutput) 191 } 192 193 // ResolverConfigMapInput is an input type that accepts ResolverConfigMap and ResolverConfigMapOutput values. 194 // You can construct a concrete instance of `ResolverConfigMapInput` via: 195 // 196 // ResolverConfigMap{ "key": ResolverConfigArgs{...} } 197 type ResolverConfigMapInput interface { 198 pulumi.Input 199 200 ToResolverConfigMapOutput() ResolverConfigMapOutput 201 ToResolverConfigMapOutputWithContext(context.Context) ResolverConfigMapOutput 202 } 203 204 type ResolverConfigMap map[string]ResolverConfigInput 205 206 func (ResolverConfigMap) ElementType() reflect.Type { 207 return reflect.TypeOf((*map[string]*ResolverConfig)(nil)).Elem() 208 } 209 210 func (i ResolverConfigMap) ToResolverConfigMapOutput() ResolverConfigMapOutput { 211 return i.ToResolverConfigMapOutputWithContext(context.Background()) 212 } 213 214 func (i ResolverConfigMap) ToResolverConfigMapOutputWithContext(ctx context.Context) ResolverConfigMapOutput { 215 return pulumi.ToOutputWithContext(ctx, i).(ResolverConfigMapOutput) 216 } 217 218 type ResolverConfigOutput struct{ *pulumi.OutputState } 219 220 func (ResolverConfigOutput) ElementType() reflect.Type { 221 return reflect.TypeOf((**ResolverConfig)(nil)).Elem() 222 } 223 224 func (o ResolverConfigOutput) ToResolverConfigOutput() ResolverConfigOutput { 225 return o 226 } 227 228 func (o ResolverConfigOutput) ToResolverConfigOutputWithContext(ctx context.Context) ResolverConfigOutput { 229 return o 230 } 231 232 // Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`. 233 func (o ResolverConfigOutput) AutodefinedReverseFlag() pulumi.StringOutput { 234 return o.ApplyT(func(v *ResolverConfig) pulumi.StringOutput { return v.AutodefinedReverseFlag }).(pulumi.StringOutput) 235 } 236 237 // The AWS account ID of the owner of the VPC that this resolver configuration applies to. 238 func (o ResolverConfigOutput) OwnerId() pulumi.StringOutput { 239 return o.ApplyT(func(v *ResolverConfig) pulumi.StringOutput { return v.OwnerId }).(pulumi.StringOutput) 240 } 241 242 // The ID of the VPC that the configuration is for. 243 func (o ResolverConfigOutput) ResourceId() pulumi.StringOutput { 244 return o.ApplyT(func(v *ResolverConfig) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput) 245 } 246 247 type ResolverConfigArrayOutput struct{ *pulumi.OutputState } 248 249 func (ResolverConfigArrayOutput) ElementType() reflect.Type { 250 return reflect.TypeOf((*[]*ResolverConfig)(nil)).Elem() 251 } 252 253 func (o ResolverConfigArrayOutput) ToResolverConfigArrayOutput() ResolverConfigArrayOutput { 254 return o 255 } 256 257 func (o ResolverConfigArrayOutput) ToResolverConfigArrayOutputWithContext(ctx context.Context) ResolverConfigArrayOutput { 258 return o 259 } 260 261 func (o ResolverConfigArrayOutput) Index(i pulumi.IntInput) ResolverConfigOutput { 262 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResolverConfig { 263 return vs[0].([]*ResolverConfig)[vs[1].(int)] 264 }).(ResolverConfigOutput) 265 } 266 267 type ResolverConfigMapOutput struct{ *pulumi.OutputState } 268 269 func (ResolverConfigMapOutput) ElementType() reflect.Type { 270 return reflect.TypeOf((*map[string]*ResolverConfig)(nil)).Elem() 271 } 272 273 func (o ResolverConfigMapOutput) ToResolverConfigMapOutput() ResolverConfigMapOutput { 274 return o 275 } 276 277 func (o ResolverConfigMapOutput) ToResolverConfigMapOutputWithContext(ctx context.Context) ResolverConfigMapOutput { 278 return o 279 } 280 281 func (o ResolverConfigMapOutput) MapIndex(k pulumi.StringInput) ResolverConfigOutput { 282 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResolverConfig { 283 return vs[0].(map[string]*ResolverConfig)[vs[1].(string)] 284 }).(ResolverConfigOutput) 285 } 286 287 func init() { 288 pulumi.RegisterInputType(reflect.TypeOf((*ResolverConfigInput)(nil)).Elem(), &ResolverConfig{}) 289 pulumi.RegisterInputType(reflect.TypeOf((*ResolverConfigArrayInput)(nil)).Elem(), ResolverConfigArray{}) 290 pulumi.RegisterInputType(reflect.TypeOf((*ResolverConfigMapInput)(nil)).Elem(), ResolverConfigMap{}) 291 pulumi.RegisterOutputType(ResolverConfigOutput{}) 292 pulumi.RegisterOutputType(ResolverConfigArrayOutput{}) 293 pulumi.RegisterOutputType(ResolverConfigMapOutput{}) 294 }