github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicediscovery/getService.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 servicediscovery 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 // Retrieves information about a Service Discovery Service. 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/servicediscovery" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := servicediscovery.LookupService(ctx, &servicediscovery.LookupServiceArgs{ 32 // Name: "example", 33 // NamespaceId: "NAMESPACE_ID_VALUE", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupServiceResult 47 err := ctx.Invoke("aws:servicediscovery/getService:getService", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getService. 55 type LookupServiceArgs struct { 56 // Name of the service. 57 Name string `pulumi:"name"` 58 // ID of the namespace that the service belongs to. 59 NamespaceId string `pulumi:"namespaceId"` 60 // Map of tags to assign to the service. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 61 Tags map[string]string `pulumi:"tags"` 62 // (**Deprecated**) Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 63 // 64 // Deprecated: this attribute has been deprecated 65 TagsAll map[string]string `pulumi:"tagsAll"` 66 } 67 68 // A collection of values returned by getService. 69 type LookupServiceResult struct { 70 // ARN of the service. 71 Arn string `pulumi:"arn"` 72 // Description of the service. 73 Description string `pulumi:"description"` 74 // Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. 75 DnsConfigs []GetServiceDnsConfig `pulumi:"dnsConfigs"` 76 // Complex type that contains settings for an optional health check. Only for Public DNS namespaces. 77 HealthCheckConfigs []GetServiceHealthCheckConfig `pulumi:"healthCheckConfigs"` 78 // A complex type that contains settings for ECS managed health checks. 79 HealthCheckCustomConfigs []GetServiceHealthCheckCustomConfig `pulumi:"healthCheckCustomConfigs"` 80 // The provider-assigned unique ID for this managed resource. 81 Id string `pulumi:"id"` 82 Name string `pulumi:"name"` 83 // ID of the namespace to use for DNS configuration. 84 NamespaceId string `pulumi:"namespaceId"` 85 // Map of tags to assign to the service. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 86 Tags map[string]string `pulumi:"tags"` 87 // (**Deprecated**) Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 88 // 89 // Deprecated: this attribute has been deprecated 90 TagsAll map[string]string `pulumi:"tagsAll"` 91 } 92 93 func LookupServiceOutput(ctx *pulumi.Context, args LookupServiceOutputArgs, opts ...pulumi.InvokeOption) LookupServiceResultOutput { 94 return pulumi.ToOutputWithContext(context.Background(), args). 95 ApplyT(func(v interface{}) (LookupServiceResult, error) { 96 args := v.(LookupServiceArgs) 97 r, err := LookupService(ctx, &args, opts...) 98 var s LookupServiceResult 99 if r != nil { 100 s = *r 101 } 102 return s, err 103 }).(LookupServiceResultOutput) 104 } 105 106 // A collection of arguments for invoking getService. 107 type LookupServiceOutputArgs struct { 108 // Name of the service. 109 Name pulumi.StringInput `pulumi:"name"` 110 // ID of the namespace that the service belongs to. 111 NamespaceId pulumi.StringInput `pulumi:"namespaceId"` 112 // Map of tags to assign to the service. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 113 Tags pulumi.StringMapInput `pulumi:"tags"` 114 // (**Deprecated**) Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 115 // 116 // Deprecated: this attribute has been deprecated 117 TagsAll pulumi.StringMapInput `pulumi:"tagsAll"` 118 } 119 120 func (LookupServiceOutputArgs) ElementType() reflect.Type { 121 return reflect.TypeOf((*LookupServiceArgs)(nil)).Elem() 122 } 123 124 // A collection of values returned by getService. 125 type LookupServiceResultOutput struct{ *pulumi.OutputState } 126 127 func (LookupServiceResultOutput) ElementType() reflect.Type { 128 return reflect.TypeOf((*LookupServiceResult)(nil)).Elem() 129 } 130 131 func (o LookupServiceResultOutput) ToLookupServiceResultOutput() LookupServiceResultOutput { 132 return o 133 } 134 135 func (o LookupServiceResultOutput) ToLookupServiceResultOutputWithContext(ctx context.Context) LookupServiceResultOutput { 136 return o 137 } 138 139 // ARN of the service. 140 func (o LookupServiceResultOutput) Arn() pulumi.StringOutput { 141 return o.ApplyT(func(v LookupServiceResult) string { return v.Arn }).(pulumi.StringOutput) 142 } 143 144 // Description of the service. 145 func (o LookupServiceResultOutput) Description() pulumi.StringOutput { 146 return o.ApplyT(func(v LookupServiceResult) string { return v.Description }).(pulumi.StringOutput) 147 } 148 149 // Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. 150 func (o LookupServiceResultOutput) DnsConfigs() GetServiceDnsConfigArrayOutput { 151 return o.ApplyT(func(v LookupServiceResult) []GetServiceDnsConfig { return v.DnsConfigs }).(GetServiceDnsConfigArrayOutput) 152 } 153 154 // Complex type that contains settings for an optional health check. Only for Public DNS namespaces. 155 func (o LookupServiceResultOutput) HealthCheckConfigs() GetServiceHealthCheckConfigArrayOutput { 156 return o.ApplyT(func(v LookupServiceResult) []GetServiceHealthCheckConfig { return v.HealthCheckConfigs }).(GetServiceHealthCheckConfigArrayOutput) 157 } 158 159 // A complex type that contains settings for ECS managed health checks. 160 func (o LookupServiceResultOutput) HealthCheckCustomConfigs() GetServiceHealthCheckCustomConfigArrayOutput { 161 return o.ApplyT(func(v LookupServiceResult) []GetServiceHealthCheckCustomConfig { return v.HealthCheckCustomConfigs }).(GetServiceHealthCheckCustomConfigArrayOutput) 162 } 163 164 // The provider-assigned unique ID for this managed resource. 165 func (o LookupServiceResultOutput) Id() pulumi.StringOutput { 166 return o.ApplyT(func(v LookupServiceResult) string { return v.Id }).(pulumi.StringOutput) 167 } 168 169 func (o LookupServiceResultOutput) Name() pulumi.StringOutput { 170 return o.ApplyT(func(v LookupServiceResult) string { return v.Name }).(pulumi.StringOutput) 171 } 172 173 // ID of the namespace to use for DNS configuration. 174 func (o LookupServiceResultOutput) NamespaceId() pulumi.StringOutput { 175 return o.ApplyT(func(v LookupServiceResult) string { return v.NamespaceId }).(pulumi.StringOutput) 176 } 177 178 // Map of tags to assign to the service. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 179 func (o LookupServiceResultOutput) Tags() pulumi.StringMapOutput { 180 return o.ApplyT(func(v LookupServiceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 181 } 182 183 // (**Deprecated**) Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 184 // 185 // Deprecated: this attribute has been deprecated 186 func (o LookupServiceResultOutput) TagsAll() pulumi.StringMapOutput { 187 return o.ApplyT(func(v LookupServiceResult) map[string]string { return v.TagsAll }).(pulumi.StringMapOutput) 188 } 189 190 func init() { 191 pulumi.RegisterOutputType(LookupServiceResultOutput{}) 192 }