github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/imagebuilder/getComponent.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 imagebuilder
     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 an Image Builder Component.
    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/imagebuilder"
    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 := imagebuilder.LookupComponent(ctx, &imagebuilder.LookupComponentArgs{
    32  //				Arn: "arn:aws:imagebuilder:us-west-2:aws:component/amazon-cloudwatch-agent-linux/1.0.0",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupComponent(ctx *pulumi.Context, args *LookupComponentArgs, opts ...pulumi.InvokeOption) (*LookupComponentResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupComponentResult
    46  	err := ctx.Invoke("aws:imagebuilder/getComponent:getComponent", 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 getComponent.
    54  type LookupComponentArgs struct {
    55  	// ARN of the component.
    56  	Arn string `pulumi:"arn"`
    57  	// Key-value map of resource tags for the component.
    58  	Tags map[string]string `pulumi:"tags"`
    59  }
    60  
    61  // A collection of values returned by getComponent.
    62  type LookupComponentResult struct {
    63  	Arn string `pulumi:"arn"`
    64  	// Change description of the component.
    65  	ChangeDescription string `pulumi:"changeDescription"`
    66  	// Data of the component.
    67  	Data string `pulumi:"data"`
    68  	// Date the component was created.
    69  	DateCreated string `pulumi:"dateCreated"`
    70  	// Description of the component.
    71  	Description string `pulumi:"description"`
    72  	// Encryption status of the component.
    73  	Encrypted bool `pulumi:"encrypted"`
    74  	// The provider-assigned unique ID for this managed resource.
    75  	Id string `pulumi:"id"`
    76  	// ARN of the Key Management Service (KMS) Key used to encrypt the component.
    77  	KmsKeyId string `pulumi:"kmsKeyId"`
    78  	// Name of the component.
    79  	Name string `pulumi:"name"`
    80  	// Owner of the component.
    81  	Owner string `pulumi:"owner"`
    82  	// Platform of the component.
    83  	Platform string `pulumi:"platform"`
    84  	// Operating Systems (OSes) supported by the component.
    85  	SupportedOsVersions []string `pulumi:"supportedOsVersions"`
    86  	// Key-value map of resource tags for the component.
    87  	Tags map[string]string `pulumi:"tags"`
    88  	// Type of the component.
    89  	Type string `pulumi:"type"`
    90  	// Version of the component.
    91  	Version string `pulumi:"version"`
    92  }
    93  
    94  func LookupComponentOutput(ctx *pulumi.Context, args LookupComponentOutputArgs, opts ...pulumi.InvokeOption) LookupComponentResultOutput {
    95  	return pulumi.ToOutputWithContext(context.Background(), args).
    96  		ApplyT(func(v interface{}) (LookupComponentResult, error) {
    97  			args := v.(LookupComponentArgs)
    98  			r, err := LookupComponent(ctx, &args, opts...)
    99  			var s LookupComponentResult
   100  			if r != nil {
   101  				s = *r
   102  			}
   103  			return s, err
   104  		}).(LookupComponentResultOutput)
   105  }
   106  
   107  // A collection of arguments for invoking getComponent.
   108  type LookupComponentOutputArgs struct {
   109  	// ARN of the component.
   110  	Arn pulumi.StringInput `pulumi:"arn"`
   111  	// Key-value map of resource tags for the component.
   112  	Tags pulumi.StringMapInput `pulumi:"tags"`
   113  }
   114  
   115  func (LookupComponentOutputArgs) ElementType() reflect.Type {
   116  	return reflect.TypeOf((*LookupComponentArgs)(nil)).Elem()
   117  }
   118  
   119  // A collection of values returned by getComponent.
   120  type LookupComponentResultOutput struct{ *pulumi.OutputState }
   121  
   122  func (LookupComponentResultOutput) ElementType() reflect.Type {
   123  	return reflect.TypeOf((*LookupComponentResult)(nil)).Elem()
   124  }
   125  
   126  func (o LookupComponentResultOutput) ToLookupComponentResultOutput() LookupComponentResultOutput {
   127  	return o
   128  }
   129  
   130  func (o LookupComponentResultOutput) ToLookupComponentResultOutputWithContext(ctx context.Context) LookupComponentResultOutput {
   131  	return o
   132  }
   133  
   134  func (o LookupComponentResultOutput) Arn() pulumi.StringOutput {
   135  	return o.ApplyT(func(v LookupComponentResult) string { return v.Arn }).(pulumi.StringOutput)
   136  }
   137  
   138  // Change description of the component.
   139  func (o LookupComponentResultOutput) ChangeDescription() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupComponentResult) string { return v.ChangeDescription }).(pulumi.StringOutput)
   141  }
   142  
   143  // Data of the component.
   144  func (o LookupComponentResultOutput) Data() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupComponentResult) string { return v.Data }).(pulumi.StringOutput)
   146  }
   147  
   148  // Date the component was created.
   149  func (o LookupComponentResultOutput) DateCreated() pulumi.StringOutput {
   150  	return o.ApplyT(func(v LookupComponentResult) string { return v.DateCreated }).(pulumi.StringOutput)
   151  }
   152  
   153  // Description of the component.
   154  func (o LookupComponentResultOutput) Description() pulumi.StringOutput {
   155  	return o.ApplyT(func(v LookupComponentResult) string { return v.Description }).(pulumi.StringOutput)
   156  }
   157  
   158  // Encryption status of the component.
   159  func (o LookupComponentResultOutput) Encrypted() pulumi.BoolOutput {
   160  	return o.ApplyT(func(v LookupComponentResult) bool { return v.Encrypted }).(pulumi.BoolOutput)
   161  }
   162  
   163  // The provider-assigned unique ID for this managed resource.
   164  func (o LookupComponentResultOutput) Id() pulumi.StringOutput {
   165  	return o.ApplyT(func(v LookupComponentResult) string { return v.Id }).(pulumi.StringOutput)
   166  }
   167  
   168  // ARN of the Key Management Service (KMS) Key used to encrypt the component.
   169  func (o LookupComponentResultOutput) KmsKeyId() pulumi.StringOutput {
   170  	return o.ApplyT(func(v LookupComponentResult) string { return v.KmsKeyId }).(pulumi.StringOutput)
   171  }
   172  
   173  // Name of the component.
   174  func (o LookupComponentResultOutput) Name() pulumi.StringOutput {
   175  	return o.ApplyT(func(v LookupComponentResult) string { return v.Name }).(pulumi.StringOutput)
   176  }
   177  
   178  // Owner of the component.
   179  func (o LookupComponentResultOutput) Owner() pulumi.StringOutput {
   180  	return o.ApplyT(func(v LookupComponentResult) string { return v.Owner }).(pulumi.StringOutput)
   181  }
   182  
   183  // Platform of the component.
   184  func (o LookupComponentResultOutput) Platform() pulumi.StringOutput {
   185  	return o.ApplyT(func(v LookupComponentResult) string { return v.Platform }).(pulumi.StringOutput)
   186  }
   187  
   188  // Operating Systems (OSes) supported by the component.
   189  func (o LookupComponentResultOutput) SupportedOsVersions() pulumi.StringArrayOutput {
   190  	return o.ApplyT(func(v LookupComponentResult) []string { return v.SupportedOsVersions }).(pulumi.StringArrayOutput)
   191  }
   192  
   193  // Key-value map of resource tags for the component.
   194  func (o LookupComponentResultOutput) Tags() pulumi.StringMapOutput {
   195  	return o.ApplyT(func(v LookupComponentResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   196  }
   197  
   198  // Type of the component.
   199  func (o LookupComponentResultOutput) Type() pulumi.StringOutput {
   200  	return o.ApplyT(func(v LookupComponentResult) string { return v.Type }).(pulumi.StringOutput)
   201  }
   202  
   203  // Version of the component.
   204  func (o LookupComponentResultOutput) Version() pulumi.StringOutput {
   205  	return o.ApplyT(func(v LookupComponentResult) string { return v.Version }).(pulumi.StringOutput)
   206  }
   207  
   208  func init() {
   209  	pulumi.RegisterOutputType(LookupComponentResultOutput{})
   210  }