github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codeartifact/getRepositoryEndpoint.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 codeartifact 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 CodeArtifact Repository Endpoint data source returns the endpoint of a repository for a specific package format. 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/codeartifact" 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 := codeartifact.GetRepositoryEndpoint(ctx, &codeartifact.GetRepositoryEndpointArgs{ 32 // Domain: testAwsCodeartifactDomain.Domain, 33 // Repository: testAwsCodeartifactRepository.Repository, 34 // Format: "npm", 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func GetRepositoryEndpoint(ctx *pulumi.Context, args *GetRepositoryEndpointArgs, opts ...pulumi.InvokeOption) (*GetRepositoryEndpointResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv GetRepositoryEndpointResult 48 err := ctx.Invoke("aws:codeartifact/getRepositoryEndpoint:getRepositoryEndpoint", args, &rv, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &rv, nil 53 } 54 55 // A collection of arguments for invoking getRepositoryEndpoint. 56 type GetRepositoryEndpointArgs struct { 57 // Name of the domain that contains the repository. 58 Domain string `pulumi:"domain"` 59 // Account number of the AWS account that owns the domain. 60 DomainOwner *string `pulumi:"domainOwner"` 61 // Which endpoint of a repository to return. A repository has one endpoint for each package format: `npm`, `pypi`, `maven`, and `nuget`. 62 Format string `pulumi:"format"` 63 // Name of the repository. 64 Repository string `pulumi:"repository"` 65 } 66 67 // A collection of values returned by getRepositoryEndpoint. 68 type GetRepositoryEndpointResult struct { 69 Domain string `pulumi:"domain"` 70 DomainOwner string `pulumi:"domainOwner"` 71 Format string `pulumi:"format"` 72 // The provider-assigned unique ID for this managed resource. 73 Id string `pulumi:"id"` 74 Repository string `pulumi:"repository"` 75 // URL of the returned endpoint. 76 RepositoryEndpoint string `pulumi:"repositoryEndpoint"` 77 } 78 79 func GetRepositoryEndpointOutput(ctx *pulumi.Context, args GetRepositoryEndpointOutputArgs, opts ...pulumi.InvokeOption) GetRepositoryEndpointResultOutput { 80 return pulumi.ToOutputWithContext(context.Background(), args). 81 ApplyT(func(v interface{}) (GetRepositoryEndpointResult, error) { 82 args := v.(GetRepositoryEndpointArgs) 83 r, err := GetRepositoryEndpoint(ctx, &args, opts...) 84 var s GetRepositoryEndpointResult 85 if r != nil { 86 s = *r 87 } 88 return s, err 89 }).(GetRepositoryEndpointResultOutput) 90 } 91 92 // A collection of arguments for invoking getRepositoryEndpoint. 93 type GetRepositoryEndpointOutputArgs struct { 94 // Name of the domain that contains the repository. 95 Domain pulumi.StringInput `pulumi:"domain"` 96 // Account number of the AWS account that owns the domain. 97 DomainOwner pulumi.StringPtrInput `pulumi:"domainOwner"` 98 // Which endpoint of a repository to return. A repository has one endpoint for each package format: `npm`, `pypi`, `maven`, and `nuget`. 99 Format pulumi.StringInput `pulumi:"format"` 100 // Name of the repository. 101 Repository pulumi.StringInput `pulumi:"repository"` 102 } 103 104 func (GetRepositoryEndpointOutputArgs) ElementType() reflect.Type { 105 return reflect.TypeOf((*GetRepositoryEndpointArgs)(nil)).Elem() 106 } 107 108 // A collection of values returned by getRepositoryEndpoint. 109 type GetRepositoryEndpointResultOutput struct{ *pulumi.OutputState } 110 111 func (GetRepositoryEndpointResultOutput) ElementType() reflect.Type { 112 return reflect.TypeOf((*GetRepositoryEndpointResult)(nil)).Elem() 113 } 114 115 func (o GetRepositoryEndpointResultOutput) ToGetRepositoryEndpointResultOutput() GetRepositoryEndpointResultOutput { 116 return o 117 } 118 119 func (o GetRepositoryEndpointResultOutput) ToGetRepositoryEndpointResultOutputWithContext(ctx context.Context) GetRepositoryEndpointResultOutput { 120 return o 121 } 122 123 func (o GetRepositoryEndpointResultOutput) Domain() pulumi.StringOutput { 124 return o.ApplyT(func(v GetRepositoryEndpointResult) string { return v.Domain }).(pulumi.StringOutput) 125 } 126 127 func (o GetRepositoryEndpointResultOutput) DomainOwner() pulumi.StringOutput { 128 return o.ApplyT(func(v GetRepositoryEndpointResult) string { return v.DomainOwner }).(pulumi.StringOutput) 129 } 130 131 func (o GetRepositoryEndpointResultOutput) Format() pulumi.StringOutput { 132 return o.ApplyT(func(v GetRepositoryEndpointResult) string { return v.Format }).(pulumi.StringOutput) 133 } 134 135 // The provider-assigned unique ID for this managed resource. 136 func (o GetRepositoryEndpointResultOutput) Id() pulumi.StringOutput { 137 return o.ApplyT(func(v GetRepositoryEndpointResult) string { return v.Id }).(pulumi.StringOutput) 138 } 139 140 func (o GetRepositoryEndpointResultOutput) Repository() pulumi.StringOutput { 141 return o.ApplyT(func(v GetRepositoryEndpointResult) string { return v.Repository }).(pulumi.StringOutput) 142 } 143 144 // URL of the returned endpoint. 145 func (o GetRepositoryEndpointResultOutput) RepositoryEndpoint() pulumi.StringOutput { 146 return o.ApplyT(func(v GetRepositoryEndpointResult) string { return v.RepositoryEndpoint }).(pulumi.StringOutput) 147 } 148 149 func init() { 150 pulumi.RegisterOutputType(GetRepositoryEndpointResultOutput{}) 151 }