github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudcontrol/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 cloudcontrol
     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 for a Cloud Control API Resource. The reading of these resources is proxied through Cloud Control API handlers to the backend 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/cloudcontrol"
    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 := cloudcontrol.LookupResource(ctx, &cloudcontrol.LookupResourceArgs{
    32  //				Identifier: "example",
    33  //				TypeName:   "AWS::ECS::Cluster",
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  func LookupResource(ctx *pulumi.Context, args *LookupResourceArgs, opts ...pulumi.InvokeOption) (*LookupResourceResult, error) {
    45  	opts = internal.PkgInvokeDefaultOpts(opts)
    46  	var rv LookupResourceResult
    47  	err := ctx.Invoke("aws:cloudcontrol/getResource:getResource", 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 getResource.
    55  type LookupResourceArgs struct {
    56  	// Identifier of the CloudFormation resource type. For example, `vpc-12345678`.
    57  	Identifier string `pulumi:"identifier"`
    58  	// ARN of the IAM Role to assume for operations.
    59  	RoleArn *string `pulumi:"roleArn"`
    60  	// CloudFormation resource type name. For example, `AWS::EC2::VPC`.
    61  	//
    62  	// The following arguments are optional:
    63  	TypeName string `pulumi:"typeName"`
    64  	// Identifier of the CloudFormation resource type version.
    65  	TypeVersionId *string `pulumi:"typeVersionId"`
    66  }
    67  
    68  // A collection of values returned by getResource.
    69  type LookupResourceResult struct {
    70  	// The provider-assigned unique ID for this managed resource.
    71  	Id         string `pulumi:"id"`
    72  	Identifier string `pulumi:"identifier"`
    73  	// JSON string matching the CloudFormation resource type schema with current configuration.
    74  	Properties    string  `pulumi:"properties"`
    75  	RoleArn       *string `pulumi:"roleArn"`
    76  	TypeName      string  `pulumi:"typeName"`
    77  	TypeVersionId *string `pulumi:"typeVersionId"`
    78  }
    79  
    80  func LookupResourceOutput(ctx *pulumi.Context, args LookupResourceOutputArgs, opts ...pulumi.InvokeOption) LookupResourceResultOutput {
    81  	return pulumi.ToOutputWithContext(context.Background(), args).
    82  		ApplyT(func(v interface{}) (LookupResourceResult, error) {
    83  			args := v.(LookupResourceArgs)
    84  			r, err := LookupResource(ctx, &args, opts...)
    85  			var s LookupResourceResult
    86  			if r != nil {
    87  				s = *r
    88  			}
    89  			return s, err
    90  		}).(LookupResourceResultOutput)
    91  }
    92  
    93  // A collection of arguments for invoking getResource.
    94  type LookupResourceOutputArgs struct {
    95  	// Identifier of the CloudFormation resource type. For example, `vpc-12345678`.
    96  	Identifier pulumi.StringInput `pulumi:"identifier"`
    97  	// ARN of the IAM Role to assume for operations.
    98  	RoleArn pulumi.StringPtrInput `pulumi:"roleArn"`
    99  	// CloudFormation resource type name. For example, `AWS::EC2::VPC`.
   100  	//
   101  	// The following arguments are optional:
   102  	TypeName pulumi.StringInput `pulumi:"typeName"`
   103  	// Identifier of the CloudFormation resource type version.
   104  	TypeVersionId pulumi.StringPtrInput `pulumi:"typeVersionId"`
   105  }
   106  
   107  func (LookupResourceOutputArgs) ElementType() reflect.Type {
   108  	return reflect.TypeOf((*LookupResourceArgs)(nil)).Elem()
   109  }
   110  
   111  // A collection of values returned by getResource.
   112  type LookupResourceResultOutput struct{ *pulumi.OutputState }
   113  
   114  func (LookupResourceResultOutput) ElementType() reflect.Type {
   115  	return reflect.TypeOf((*LookupResourceResult)(nil)).Elem()
   116  }
   117  
   118  func (o LookupResourceResultOutput) ToLookupResourceResultOutput() LookupResourceResultOutput {
   119  	return o
   120  }
   121  
   122  func (o LookupResourceResultOutput) ToLookupResourceResultOutputWithContext(ctx context.Context) LookupResourceResultOutput {
   123  	return o
   124  }
   125  
   126  // The provider-assigned unique ID for this managed resource.
   127  func (o LookupResourceResultOutput) Id() pulumi.StringOutput {
   128  	return o.ApplyT(func(v LookupResourceResult) string { return v.Id }).(pulumi.StringOutput)
   129  }
   130  
   131  func (o LookupResourceResultOutput) Identifier() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupResourceResult) string { return v.Identifier }).(pulumi.StringOutput)
   133  }
   134  
   135  // JSON string matching the CloudFormation resource type schema with current configuration.
   136  func (o LookupResourceResultOutput) Properties() pulumi.StringOutput {
   137  	return o.ApplyT(func(v LookupResourceResult) string { return v.Properties }).(pulumi.StringOutput)
   138  }
   139  
   140  func (o LookupResourceResultOutput) RoleArn() pulumi.StringPtrOutput {
   141  	return o.ApplyT(func(v LookupResourceResult) *string { return v.RoleArn }).(pulumi.StringPtrOutput)
   142  }
   143  
   144  func (o LookupResourceResultOutput) TypeName() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupResourceResult) string { return v.TypeName }).(pulumi.StringOutput)
   146  }
   147  
   148  func (o LookupResourceResultOutput) TypeVersionId() pulumi.StringPtrOutput {
   149  	return o.ApplyT(func(v LookupResourceResult) *string { return v.TypeVersionId }).(pulumi.StringPtrOutput)
   150  }
   151  
   152  func init() {
   153  	pulumi.RegisterOutputType(LookupResourceResultOutput{})
   154  }