github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/globalaccelerator/getCustomRoutingAccelerator.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 globalaccelerator 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 // Provides information about a Global Accelerator custom routing accelerator. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // cfg := config.New(ctx, "") 33 // acceleratorArn := "" 34 // if param := cfg.Get("acceleratorArn"); param != "" { 35 // acceleratorArn = param 36 // } 37 // acceleratorName := "" 38 // if param := cfg.Get("acceleratorName"); param != "" { 39 // acceleratorName = param 40 // } 41 // _, err := globalaccelerator.LookupCustomRoutingAccelerator(ctx, &globalaccelerator.LookupCustomRoutingAcceleratorArgs{ 42 // Arn: pulumi.StringRef(acceleratorArn), 43 // Name: pulumi.StringRef(acceleratorName), 44 // }, nil) 45 // if err != nil { 46 // return err 47 // } 48 // return nil 49 // }) 50 // } 51 // 52 // ``` 53 // <!--End PulumiCodeChooser --> 54 func LookupCustomRoutingAccelerator(ctx *pulumi.Context, args *LookupCustomRoutingAcceleratorArgs, opts ...pulumi.InvokeOption) (*LookupCustomRoutingAcceleratorResult, error) { 55 opts = internal.PkgInvokeDefaultOpts(opts) 56 var rv LookupCustomRoutingAcceleratorResult 57 err := ctx.Invoke("aws:globalaccelerator/getCustomRoutingAccelerator:getCustomRoutingAccelerator", args, &rv, opts...) 58 if err != nil { 59 return nil, err 60 } 61 return &rv, nil 62 } 63 64 // A collection of arguments for invoking getCustomRoutingAccelerator. 65 type LookupCustomRoutingAcceleratorArgs struct { 66 // Full ARN of the custom routing accelerator. 67 Arn *string `pulumi:"arn"` 68 // Unique name of the custom routing accelerator. 69 // 70 // > **NOTE:** When both `arn` and `name` are specified, `arn` takes precedence. 71 Name *string `pulumi:"name"` 72 Tags map[string]string `pulumi:"tags"` 73 } 74 75 // A collection of values returned by getCustomRoutingAccelerator. 76 type LookupCustomRoutingAcceleratorResult struct { 77 Arn string `pulumi:"arn"` 78 Attributes []GetCustomRoutingAcceleratorAttribute `pulumi:"attributes"` 79 DnsName string `pulumi:"dnsName"` 80 Enabled bool `pulumi:"enabled"` 81 HostedZoneId string `pulumi:"hostedZoneId"` 82 // The provider-assigned unique ID for this managed resource. 83 Id string `pulumi:"id"` 84 IpAddressType string `pulumi:"ipAddressType"` 85 IpSets []GetCustomRoutingAcceleratorIpSet `pulumi:"ipSets"` 86 Name string `pulumi:"name"` 87 Tags map[string]string `pulumi:"tags"` 88 } 89 90 func LookupCustomRoutingAcceleratorOutput(ctx *pulumi.Context, args LookupCustomRoutingAcceleratorOutputArgs, opts ...pulumi.InvokeOption) LookupCustomRoutingAcceleratorResultOutput { 91 return pulumi.ToOutputWithContext(context.Background(), args). 92 ApplyT(func(v interface{}) (LookupCustomRoutingAcceleratorResult, error) { 93 args := v.(LookupCustomRoutingAcceleratorArgs) 94 r, err := LookupCustomRoutingAccelerator(ctx, &args, opts...) 95 var s LookupCustomRoutingAcceleratorResult 96 if r != nil { 97 s = *r 98 } 99 return s, err 100 }).(LookupCustomRoutingAcceleratorResultOutput) 101 } 102 103 // A collection of arguments for invoking getCustomRoutingAccelerator. 104 type LookupCustomRoutingAcceleratorOutputArgs struct { 105 // Full ARN of the custom routing accelerator. 106 Arn pulumi.StringPtrInput `pulumi:"arn"` 107 // Unique name of the custom routing accelerator. 108 // 109 // > **NOTE:** When both `arn` and `name` are specified, `arn` takes precedence. 110 Name pulumi.StringPtrInput `pulumi:"name"` 111 Tags pulumi.StringMapInput `pulumi:"tags"` 112 } 113 114 func (LookupCustomRoutingAcceleratorOutputArgs) ElementType() reflect.Type { 115 return reflect.TypeOf((*LookupCustomRoutingAcceleratorArgs)(nil)).Elem() 116 } 117 118 // A collection of values returned by getCustomRoutingAccelerator. 119 type LookupCustomRoutingAcceleratorResultOutput struct{ *pulumi.OutputState } 120 121 func (LookupCustomRoutingAcceleratorResultOutput) ElementType() reflect.Type { 122 return reflect.TypeOf((*LookupCustomRoutingAcceleratorResult)(nil)).Elem() 123 } 124 125 func (o LookupCustomRoutingAcceleratorResultOutput) ToLookupCustomRoutingAcceleratorResultOutput() LookupCustomRoutingAcceleratorResultOutput { 126 return o 127 } 128 129 func (o LookupCustomRoutingAcceleratorResultOutput) ToLookupCustomRoutingAcceleratorResultOutputWithContext(ctx context.Context) LookupCustomRoutingAcceleratorResultOutput { 130 return o 131 } 132 133 func (o LookupCustomRoutingAcceleratorResultOutput) Arn() pulumi.StringOutput { 134 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) string { return v.Arn }).(pulumi.StringOutput) 135 } 136 137 func (o LookupCustomRoutingAcceleratorResultOutput) Attributes() GetCustomRoutingAcceleratorAttributeArrayOutput { 138 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) []GetCustomRoutingAcceleratorAttribute { 139 return v.Attributes 140 }).(GetCustomRoutingAcceleratorAttributeArrayOutput) 141 } 142 143 func (o LookupCustomRoutingAcceleratorResultOutput) DnsName() pulumi.StringOutput { 144 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) string { return v.DnsName }).(pulumi.StringOutput) 145 } 146 147 func (o LookupCustomRoutingAcceleratorResultOutput) Enabled() pulumi.BoolOutput { 148 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) bool { return v.Enabled }).(pulumi.BoolOutput) 149 } 150 151 func (o LookupCustomRoutingAcceleratorResultOutput) HostedZoneId() pulumi.StringOutput { 152 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) string { return v.HostedZoneId }).(pulumi.StringOutput) 153 } 154 155 // The provider-assigned unique ID for this managed resource. 156 func (o LookupCustomRoutingAcceleratorResultOutput) Id() pulumi.StringOutput { 157 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) string { return v.Id }).(pulumi.StringOutput) 158 } 159 160 func (o LookupCustomRoutingAcceleratorResultOutput) IpAddressType() pulumi.StringOutput { 161 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) string { return v.IpAddressType }).(pulumi.StringOutput) 162 } 163 164 func (o LookupCustomRoutingAcceleratorResultOutput) IpSets() GetCustomRoutingAcceleratorIpSetArrayOutput { 165 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) []GetCustomRoutingAcceleratorIpSet { return v.IpSets }).(GetCustomRoutingAcceleratorIpSetArrayOutput) 166 } 167 168 func (o LookupCustomRoutingAcceleratorResultOutput) Name() pulumi.StringOutput { 169 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) string { return v.Name }).(pulumi.StringOutput) 170 } 171 172 func (o LookupCustomRoutingAcceleratorResultOutput) Tags() pulumi.StringMapOutput { 173 return o.ApplyT(func(v LookupCustomRoutingAcceleratorResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 174 } 175 176 func init() { 177 pulumi.RegisterOutputType(LookupCustomRoutingAcceleratorResultOutput{}) 178 }