github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lakeformation/getResource.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 lakeformation
     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 details about a Lake Formation resource.
    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/lakeformation"
    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 := lakeformation.LookupResource(ctx, &lakeformation.LookupResourceArgs{
    32  //				Arn: "arn:aws:s3:::tf-acc-test-9151654063908211878",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupResource(ctx *pulumi.Context, args *LookupResourceArgs, opts ...pulumi.InvokeOption) (*LookupResourceResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupResourceResult
    46  	err := ctx.Invoke("aws:lakeformation/getResource:getResource", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getResource.
    54  type LookupResourceArgs struct {
    55  	// ARN of the resource, an S3 path.
    56  	Arn string `pulumi:"arn"`
    57  }
    58  
    59  // A collection of values returned by getResource.
    60  type LookupResourceResult struct {
    61  	Arn string `pulumi:"arn"`
    62  	// The provider-assigned unique ID for this managed resource.
    63  	Id string `pulumi:"id"`
    64  	// Date and time the resource was last modified in [RFC 3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
    65  	LastModified string `pulumi:"lastModified"`
    66  	// Role that the resource was registered with.
    67  	RoleArn string `pulumi:"roleArn"`
    68  }
    69  
    70  func LookupResourceOutput(ctx *pulumi.Context, args LookupResourceOutputArgs, opts ...pulumi.InvokeOption) LookupResourceResultOutput {
    71  	return pulumi.ToOutputWithContext(context.Background(), args).
    72  		ApplyT(func(v interface{}) (LookupResourceResult, error) {
    73  			args := v.(LookupResourceArgs)
    74  			r, err := LookupResource(ctx, &args, opts...)
    75  			var s LookupResourceResult
    76  			if r != nil {
    77  				s = *r
    78  			}
    79  			return s, err
    80  		}).(LookupResourceResultOutput)
    81  }
    82  
    83  // A collection of arguments for invoking getResource.
    84  type LookupResourceOutputArgs struct {
    85  	// ARN of the resource, an S3 path.
    86  	Arn pulumi.StringInput `pulumi:"arn"`
    87  }
    88  
    89  func (LookupResourceOutputArgs) ElementType() reflect.Type {
    90  	return reflect.TypeOf((*LookupResourceArgs)(nil)).Elem()
    91  }
    92  
    93  // A collection of values returned by getResource.
    94  type LookupResourceResultOutput struct{ *pulumi.OutputState }
    95  
    96  func (LookupResourceResultOutput) ElementType() reflect.Type {
    97  	return reflect.TypeOf((*LookupResourceResult)(nil)).Elem()
    98  }
    99  
   100  func (o LookupResourceResultOutput) ToLookupResourceResultOutput() LookupResourceResultOutput {
   101  	return o
   102  }
   103  
   104  func (o LookupResourceResultOutput) ToLookupResourceResultOutputWithContext(ctx context.Context) LookupResourceResultOutput {
   105  	return o
   106  }
   107  
   108  func (o LookupResourceResultOutput) Arn() pulumi.StringOutput {
   109  	return o.ApplyT(func(v LookupResourceResult) string { return v.Arn }).(pulumi.StringOutput)
   110  }
   111  
   112  // The provider-assigned unique ID for this managed resource.
   113  func (o LookupResourceResultOutput) Id() pulumi.StringOutput {
   114  	return o.ApplyT(func(v LookupResourceResult) string { return v.Id }).(pulumi.StringOutput)
   115  }
   116  
   117  // Date and time the resource was last modified in [RFC 3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
   118  func (o LookupResourceResultOutput) LastModified() pulumi.StringOutput {
   119  	return o.ApplyT(func(v LookupResourceResult) string { return v.LastModified }).(pulumi.StringOutput)
   120  }
   121  
   122  // Role that the resource was registered with.
   123  func (o LookupResourceResultOutput) RoleArn() pulumi.StringOutput {
   124  	return o.ApplyT(func(v LookupResourceResult) string { return v.RoleArn }).(pulumi.StringOutput)
   125  }
   126  
   127  func init() {
   128  	pulumi.RegisterOutputType(LookupResourceResultOutput{})
   129  }