github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elasticbeanstalk/getHostedZone.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 elasticbeanstalk
     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  // Use this data source to get the ID of an [elastic beanstalk hosted zone](http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region).
    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/elasticbeanstalk"
    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 := elasticbeanstalk.GetHostedZone(ctx, nil, nil)
    32  //			if err != nil {
    33  //				return err
    34  //			}
    35  //			return nil
    36  //		})
    37  //	}
    38  //
    39  // ```
    40  // <!--End PulumiCodeChooser -->
    41  func GetHostedZone(ctx *pulumi.Context, args *GetHostedZoneArgs, opts ...pulumi.InvokeOption) (*GetHostedZoneResult, error) {
    42  	opts = internal.PkgInvokeDefaultOpts(opts)
    43  	var rv GetHostedZoneResult
    44  	err := ctx.Invoke("aws:elasticbeanstalk/getHostedZone:getHostedZone", args, &rv, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return &rv, nil
    49  }
    50  
    51  // A collection of arguments for invoking getHostedZone.
    52  type GetHostedZoneArgs struct {
    53  	// Region you'd like the zone for. By default, fetches the current region.
    54  	Region *string `pulumi:"region"`
    55  }
    56  
    57  // A collection of values returned by getHostedZone.
    58  type GetHostedZoneResult struct {
    59  	// The provider-assigned unique ID for this managed resource.
    60  	Id string `pulumi:"id"`
    61  	// Region of the hosted zone.
    62  	Region *string `pulumi:"region"`
    63  }
    64  
    65  func GetHostedZoneOutput(ctx *pulumi.Context, args GetHostedZoneOutputArgs, opts ...pulumi.InvokeOption) GetHostedZoneResultOutput {
    66  	return pulumi.ToOutputWithContext(context.Background(), args).
    67  		ApplyT(func(v interface{}) (GetHostedZoneResult, error) {
    68  			args := v.(GetHostedZoneArgs)
    69  			r, err := GetHostedZone(ctx, &args, opts...)
    70  			var s GetHostedZoneResult
    71  			if r != nil {
    72  				s = *r
    73  			}
    74  			return s, err
    75  		}).(GetHostedZoneResultOutput)
    76  }
    77  
    78  // A collection of arguments for invoking getHostedZone.
    79  type GetHostedZoneOutputArgs struct {
    80  	// Region you'd like the zone for. By default, fetches the current region.
    81  	Region pulumi.StringPtrInput `pulumi:"region"`
    82  }
    83  
    84  func (GetHostedZoneOutputArgs) ElementType() reflect.Type {
    85  	return reflect.TypeOf((*GetHostedZoneArgs)(nil)).Elem()
    86  }
    87  
    88  // A collection of values returned by getHostedZone.
    89  type GetHostedZoneResultOutput struct{ *pulumi.OutputState }
    90  
    91  func (GetHostedZoneResultOutput) ElementType() reflect.Type {
    92  	return reflect.TypeOf((*GetHostedZoneResult)(nil)).Elem()
    93  }
    94  
    95  func (o GetHostedZoneResultOutput) ToGetHostedZoneResultOutput() GetHostedZoneResultOutput {
    96  	return o
    97  }
    98  
    99  func (o GetHostedZoneResultOutput) ToGetHostedZoneResultOutputWithContext(ctx context.Context) GetHostedZoneResultOutput {
   100  	return o
   101  }
   102  
   103  // The provider-assigned unique ID for this managed resource.
   104  func (o GetHostedZoneResultOutput) Id() pulumi.StringOutput {
   105  	return o.ApplyT(func(v GetHostedZoneResult) string { return v.Id }).(pulumi.StringOutput)
   106  }
   107  
   108  // Region of the hosted zone.
   109  func (o GetHostedZoneResultOutput) Region() pulumi.StringPtrOutput {
   110  	return o.ApplyT(func(v GetHostedZoneResult) *string { return v.Region }).(pulumi.StringPtrOutput)
   111  }
   112  
   113  func init() {
   114  	pulumi.RegisterOutputType(GetHostedZoneResultOutput{})
   115  }