github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codecommit/getRepository.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 codecommit
     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  // The CodeCommit Repository data source allows the ARN, Repository ID, Repository URL for HTTP and Repository URL for SSH to be retrieved for an CodeCommit repository.
    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/codecommit"
    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 := codecommit.LookupRepository(ctx, &codecommit.LookupRepositoryArgs{
    32  //				RepositoryName: "MyTestRepository",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupRepository(ctx *pulumi.Context, args *LookupRepositoryArgs, opts ...pulumi.InvokeOption) (*LookupRepositoryResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupRepositoryResult
    46  	err := ctx.Invoke("aws:codecommit/getRepository:getRepository", 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 getRepository.
    54  type LookupRepositoryArgs struct {
    55  	// Name for the repository. This needs to be less than 100 characters.
    56  	RepositoryName string `pulumi:"repositoryName"`
    57  }
    58  
    59  // A collection of values returned by getRepository.
    60  type LookupRepositoryResult struct {
    61  	// ARN of the repository.
    62  	Arn string `pulumi:"arn"`
    63  	// URL to use for cloning the repository over HTTPS.
    64  	CloneUrlHttp string `pulumi:"cloneUrlHttp"`
    65  	// URL to use for cloning the repository over SSH.
    66  	CloneUrlSsh string `pulumi:"cloneUrlSsh"`
    67  	// The provider-assigned unique ID for this managed resource.
    68  	Id string `pulumi:"id"`
    69  	// The ID of the encryption key.
    70  	KmsKeyId string `pulumi:"kmsKeyId"`
    71  	// ID of the repository.
    72  	RepositoryId   string `pulumi:"repositoryId"`
    73  	RepositoryName string `pulumi:"repositoryName"`
    74  }
    75  
    76  func LookupRepositoryOutput(ctx *pulumi.Context, args LookupRepositoryOutputArgs, opts ...pulumi.InvokeOption) LookupRepositoryResultOutput {
    77  	return pulumi.ToOutputWithContext(context.Background(), args).
    78  		ApplyT(func(v interface{}) (LookupRepositoryResult, error) {
    79  			args := v.(LookupRepositoryArgs)
    80  			r, err := LookupRepository(ctx, &args, opts...)
    81  			var s LookupRepositoryResult
    82  			if r != nil {
    83  				s = *r
    84  			}
    85  			return s, err
    86  		}).(LookupRepositoryResultOutput)
    87  }
    88  
    89  // A collection of arguments for invoking getRepository.
    90  type LookupRepositoryOutputArgs struct {
    91  	// Name for the repository. This needs to be less than 100 characters.
    92  	RepositoryName pulumi.StringInput `pulumi:"repositoryName"`
    93  }
    94  
    95  func (LookupRepositoryOutputArgs) ElementType() reflect.Type {
    96  	return reflect.TypeOf((*LookupRepositoryArgs)(nil)).Elem()
    97  }
    98  
    99  // A collection of values returned by getRepository.
   100  type LookupRepositoryResultOutput struct{ *pulumi.OutputState }
   101  
   102  func (LookupRepositoryResultOutput) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*LookupRepositoryResult)(nil)).Elem()
   104  }
   105  
   106  func (o LookupRepositoryResultOutput) ToLookupRepositoryResultOutput() LookupRepositoryResultOutput {
   107  	return o
   108  }
   109  
   110  func (o LookupRepositoryResultOutput) ToLookupRepositoryResultOutputWithContext(ctx context.Context) LookupRepositoryResultOutput {
   111  	return o
   112  }
   113  
   114  // ARN of the repository.
   115  func (o LookupRepositoryResultOutput) Arn() pulumi.StringOutput {
   116  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.Arn }).(pulumi.StringOutput)
   117  }
   118  
   119  // URL to use for cloning the repository over HTTPS.
   120  func (o LookupRepositoryResultOutput) CloneUrlHttp() pulumi.StringOutput {
   121  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.CloneUrlHttp }).(pulumi.StringOutput)
   122  }
   123  
   124  // URL to use for cloning the repository over SSH.
   125  func (o LookupRepositoryResultOutput) CloneUrlSsh() pulumi.StringOutput {
   126  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.CloneUrlSsh }).(pulumi.StringOutput)
   127  }
   128  
   129  // The provider-assigned unique ID for this managed resource.
   130  func (o LookupRepositoryResultOutput) Id() pulumi.StringOutput {
   131  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.Id }).(pulumi.StringOutput)
   132  }
   133  
   134  // The ID of the encryption key.
   135  func (o LookupRepositoryResultOutput) KmsKeyId() pulumi.StringOutput {
   136  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.KmsKeyId }).(pulumi.StringOutput)
   137  }
   138  
   139  // ID of the repository.
   140  func (o LookupRepositoryResultOutput) RepositoryId() pulumi.StringOutput {
   141  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.RepositoryId }).(pulumi.StringOutput)
   142  }
   143  
   144  func (o LookupRepositoryResultOutput) RepositoryName() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupRepositoryResult) string { return v.RepositoryName }).(pulumi.StringOutput)
   146  }
   147  
   148  func init() {
   149  	pulumi.RegisterOutputType(LookupRepositoryResultOutput{})
   150  }