github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/getResolverRule.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 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // `route53.ResolverRule` provides details about a specific Route53 Resolver rule. 15 // 16 // ## Example Usage 17 // 18 // The following example shows how to get a Route53 Resolver rule based on its associated domain name and rule type. 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 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 // _, err := route53.LookupResolverRule(ctx, &route53.LookupResolverRuleArgs{ 34 // DomainName: pulumi.StringRef("subdomain.example.com"), 35 // RuleType: pulumi.StringRef("SYSTEM"), 36 // }, nil) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 func LookupResolverRule(ctx *pulumi.Context, args *LookupResolverRuleArgs, opts ...pulumi.InvokeOption) (*LookupResolverRuleResult, error) { 47 opts = internal.PkgInvokeDefaultOpts(opts) 48 var rv LookupResolverRuleResult 49 err := ctx.Invoke("aws:route53/getResolverRule:getResolverRule", args, &rv, opts...) 50 if err != nil { 51 return nil, err 52 } 53 return &rv, nil 54 } 55 56 // A collection of arguments for invoking getResolverRule. 57 type LookupResolverRuleArgs struct { 58 // Domain name the desired resolver rule forwards DNS queries for. Conflicts with `resolverRuleId`. 59 DomainName *string `pulumi:"domainName"` 60 // Friendly name of the desired resolver rule. Conflicts with `resolverRuleId`. 61 Name *string `pulumi:"name"` 62 // ID of the outbound resolver endpoint of the desired resolver rule. Conflicts with `resolverRuleId`. 63 ResolverEndpointId *string `pulumi:"resolverEndpointId"` 64 // ID of the desired resolver rule. Conflicts with `domainName`, `name`, `resolverEndpointId` and `ruleType`. 65 ResolverRuleId *string `pulumi:"resolverRuleId"` 66 // Rule type of the desired resolver rule. Valid values are `FORWARD`, `SYSTEM` and `RECURSIVE`. Conflicts with `resolverRuleId`. 67 RuleType *string `pulumi:"ruleType"` 68 // Map of tags assigned to the resolver rule. 69 Tags map[string]string `pulumi:"tags"` 70 } 71 72 // A collection of values returned by getResolverRule. 73 type LookupResolverRuleResult struct { 74 // ARN (Amazon Resource Name) for the resolver rule. 75 Arn string `pulumi:"arn"` 76 DomainName string `pulumi:"domainName"` 77 // The provider-assigned unique ID for this managed resource. 78 Id string `pulumi:"id"` 79 Name string `pulumi:"name"` 80 // When a rule is shared with another AWS account, the account ID of the account that the rule is shared with. 81 OwnerId string `pulumi:"ownerId"` 82 ResolverEndpointId string `pulumi:"resolverEndpointId"` 83 ResolverRuleId string `pulumi:"resolverRuleId"` 84 RuleType string `pulumi:"ruleType"` 85 // Whether the rules is shared and, if so, whether the current account is sharing the rule with another account, or another account is sharing the rule with the current account. 86 // Values are `NOT_SHARED`, `SHARED_BY_ME` or `SHARED_WITH_ME` 87 ShareStatus string `pulumi:"shareStatus"` 88 // Map of tags assigned to the resolver rule. 89 Tags map[string]string `pulumi:"tags"` 90 } 91 92 func LookupResolverRuleOutput(ctx *pulumi.Context, args LookupResolverRuleOutputArgs, opts ...pulumi.InvokeOption) LookupResolverRuleResultOutput { 93 return pulumi.ToOutputWithContext(context.Background(), args). 94 ApplyT(func(v interface{}) (LookupResolverRuleResult, error) { 95 args := v.(LookupResolverRuleArgs) 96 r, err := LookupResolverRule(ctx, &args, opts...) 97 var s LookupResolverRuleResult 98 if r != nil { 99 s = *r 100 } 101 return s, err 102 }).(LookupResolverRuleResultOutput) 103 } 104 105 // A collection of arguments for invoking getResolverRule. 106 type LookupResolverRuleOutputArgs struct { 107 // Domain name the desired resolver rule forwards DNS queries for. Conflicts with `resolverRuleId`. 108 DomainName pulumi.StringPtrInput `pulumi:"domainName"` 109 // Friendly name of the desired resolver rule. Conflicts with `resolverRuleId`. 110 Name pulumi.StringPtrInput `pulumi:"name"` 111 // ID of the outbound resolver endpoint of the desired resolver rule. Conflicts with `resolverRuleId`. 112 ResolverEndpointId pulumi.StringPtrInput `pulumi:"resolverEndpointId"` 113 // ID of the desired resolver rule. Conflicts with `domainName`, `name`, `resolverEndpointId` and `ruleType`. 114 ResolverRuleId pulumi.StringPtrInput `pulumi:"resolverRuleId"` 115 // Rule type of the desired resolver rule. Valid values are `FORWARD`, `SYSTEM` and `RECURSIVE`. Conflicts with `resolverRuleId`. 116 RuleType pulumi.StringPtrInput `pulumi:"ruleType"` 117 // Map of tags assigned to the resolver rule. 118 Tags pulumi.StringMapInput `pulumi:"tags"` 119 } 120 121 func (LookupResolverRuleOutputArgs) ElementType() reflect.Type { 122 return reflect.TypeOf((*LookupResolverRuleArgs)(nil)).Elem() 123 } 124 125 // A collection of values returned by getResolverRule. 126 type LookupResolverRuleResultOutput struct{ *pulumi.OutputState } 127 128 func (LookupResolverRuleResultOutput) ElementType() reflect.Type { 129 return reflect.TypeOf((*LookupResolverRuleResult)(nil)).Elem() 130 } 131 132 func (o LookupResolverRuleResultOutput) ToLookupResolverRuleResultOutput() LookupResolverRuleResultOutput { 133 return o 134 } 135 136 func (o LookupResolverRuleResultOutput) ToLookupResolverRuleResultOutputWithContext(ctx context.Context) LookupResolverRuleResultOutput { 137 return o 138 } 139 140 // ARN (Amazon Resource Name) for the resolver rule. 141 func (o LookupResolverRuleResultOutput) Arn() pulumi.StringOutput { 142 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.Arn }).(pulumi.StringOutput) 143 } 144 145 func (o LookupResolverRuleResultOutput) DomainName() pulumi.StringOutput { 146 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.DomainName }).(pulumi.StringOutput) 147 } 148 149 // The provider-assigned unique ID for this managed resource. 150 func (o LookupResolverRuleResultOutput) Id() pulumi.StringOutput { 151 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.Id }).(pulumi.StringOutput) 152 } 153 154 func (o LookupResolverRuleResultOutput) Name() pulumi.StringOutput { 155 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.Name }).(pulumi.StringOutput) 156 } 157 158 // When a rule is shared with another AWS account, the account ID of the account that the rule is shared with. 159 func (o LookupResolverRuleResultOutput) OwnerId() pulumi.StringOutput { 160 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.OwnerId }).(pulumi.StringOutput) 161 } 162 163 func (o LookupResolverRuleResultOutput) ResolverEndpointId() pulumi.StringOutput { 164 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.ResolverEndpointId }).(pulumi.StringOutput) 165 } 166 167 func (o LookupResolverRuleResultOutput) ResolverRuleId() pulumi.StringOutput { 168 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.ResolverRuleId }).(pulumi.StringOutput) 169 } 170 171 func (o LookupResolverRuleResultOutput) RuleType() pulumi.StringOutput { 172 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.RuleType }).(pulumi.StringOutput) 173 } 174 175 // Whether the rules is shared and, if so, whether the current account is sharing the rule with another account, or another account is sharing the rule with the current account. 176 // Values are `NOT_SHARED`, `SHARED_BY_ME` or `SHARED_WITH_ME` 177 func (o LookupResolverRuleResultOutput) ShareStatus() pulumi.StringOutput { 178 return o.ApplyT(func(v LookupResolverRuleResult) string { return v.ShareStatus }).(pulumi.StringOutput) 179 } 180 181 // Map of tags assigned to the resolver rule. 182 func (o LookupResolverRuleResultOutput) Tags() pulumi.StringMapOutput { 183 return o.ApplyT(func(v LookupResolverRuleResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 184 } 185 186 func init() { 187 pulumi.RegisterOutputType(LookupResolverRuleResultOutput{}) 188 }