github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ecrpublic/repository.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 ecrpublic
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a Public Elastic Container Registry Repository.
    16  //
    17  // > **NOTE:** This resource can only be used in the `us-east-1` region.
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecrpublic"
    28  //	"github.com/pulumi/pulumi-std/sdk/go/std"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
    36  //				Input: png,
    37  //			}, nil)
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			_, err = ecrpublic.NewRepository(ctx, "foo", &ecrpublic.RepositoryArgs{
    42  //				RepositoryName: pulumi.String("bar"),
    43  //				CatalogData: &ecrpublic.RepositoryCatalogDataArgs{
    44  //					AboutText: pulumi.String("About Text"),
    45  //					Architectures: pulumi.StringArray{
    46  //						pulumi.String("ARM"),
    47  //					},
    48  //					Description:   pulumi.String("Description"),
    49  //					LogoImageBlob: invokeFilebase64.Result,
    50  //					OperatingSystems: pulumi.StringArray{
    51  //						pulumi.String("Linux"),
    52  //					},
    53  //					UsageText: pulumi.String("Usage Text"),
    54  //				},
    55  //				Tags: pulumi.StringMap{
    56  //					"env": pulumi.String("production"),
    57  //				},
    58  //			})
    59  //			if err != nil {
    60  //				return err
    61  //			}
    62  //			return nil
    63  //		})
    64  //	}
    65  //
    66  // ```
    67  // <!--End PulumiCodeChooser -->
    68  //
    69  // ## Import
    70  //
    71  // Using `pulumi import`, import ECR Public Repositories using the `repository_name`. For example:
    72  //
    73  // ```sh
    74  // $ pulumi import aws:ecrpublic/repository:Repository example example
    75  // ```
    76  type Repository struct {
    77  	pulumi.CustomResourceState
    78  
    79  	// Full ARN of the repository.
    80  	Arn pulumi.StringOutput `pulumi:"arn"`
    81  	// Catalog data configuration for the repository. See below for schema.
    82  	CatalogData  RepositoryCatalogDataPtrOutput `pulumi:"catalogData"`
    83  	ForceDestroy pulumi.BoolPtrOutput           `pulumi:"forceDestroy"`
    84  	// The registry ID where the repository was created.
    85  	RegistryId pulumi.StringOutput `pulumi:"registryId"`
    86  	// Name of the repository.
    87  	RepositoryName pulumi.StringOutput `pulumi:"repositoryName"`
    88  	// The URI of the repository.
    89  	RepositoryUri pulumi.StringOutput `pulumi:"repositoryUri"`
    90  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    91  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    92  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    93  	//
    94  	// Deprecated: Please use `tags` instead.
    95  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    96  }
    97  
    98  // NewRepository registers a new resource with the given unique name, arguments, and options.
    99  func NewRepository(ctx *pulumi.Context,
   100  	name string, args *RepositoryArgs, opts ...pulumi.ResourceOption) (*Repository, error) {
   101  	if args == nil {
   102  		return nil, errors.New("missing one or more required arguments")
   103  	}
   104  
   105  	if args.RepositoryName == nil {
   106  		return nil, errors.New("invalid value for required argument 'RepositoryName'")
   107  	}
   108  	opts = internal.PkgResourceDefaultOpts(opts)
   109  	var resource Repository
   110  	err := ctx.RegisterResource("aws:ecrpublic/repository:Repository", name, args, &resource, opts...)
   111  	if err != nil {
   112  		return nil, err
   113  	}
   114  	return &resource, nil
   115  }
   116  
   117  // GetRepository gets an existing Repository resource's state with the given name, ID, and optional
   118  // state properties that are used to uniquely qualify the lookup (nil if not required).
   119  func GetRepository(ctx *pulumi.Context,
   120  	name string, id pulumi.IDInput, state *RepositoryState, opts ...pulumi.ResourceOption) (*Repository, error) {
   121  	var resource Repository
   122  	err := ctx.ReadResource("aws:ecrpublic/repository:Repository", name, id, state, &resource, opts...)
   123  	if err != nil {
   124  		return nil, err
   125  	}
   126  	return &resource, nil
   127  }
   128  
   129  // Input properties used for looking up and filtering Repository resources.
   130  type repositoryState struct {
   131  	// Full ARN of the repository.
   132  	Arn *string `pulumi:"arn"`
   133  	// Catalog data configuration for the repository. See below for schema.
   134  	CatalogData  *RepositoryCatalogData `pulumi:"catalogData"`
   135  	ForceDestroy *bool                  `pulumi:"forceDestroy"`
   136  	// The registry ID where the repository was created.
   137  	RegistryId *string `pulumi:"registryId"`
   138  	// Name of the repository.
   139  	RepositoryName *string `pulumi:"repositoryName"`
   140  	// The URI of the repository.
   141  	RepositoryUri *string `pulumi:"repositoryUri"`
   142  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   143  	Tags map[string]string `pulumi:"tags"`
   144  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   145  	//
   146  	// Deprecated: Please use `tags` instead.
   147  	TagsAll map[string]string `pulumi:"tagsAll"`
   148  }
   149  
   150  type RepositoryState struct {
   151  	// Full ARN of the repository.
   152  	Arn pulumi.StringPtrInput
   153  	// Catalog data configuration for the repository. See below for schema.
   154  	CatalogData  RepositoryCatalogDataPtrInput
   155  	ForceDestroy pulumi.BoolPtrInput
   156  	// The registry ID where the repository was created.
   157  	RegistryId pulumi.StringPtrInput
   158  	// Name of the repository.
   159  	RepositoryName pulumi.StringPtrInput
   160  	// The URI of the repository.
   161  	RepositoryUri pulumi.StringPtrInput
   162  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   163  	Tags pulumi.StringMapInput
   164  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   165  	//
   166  	// Deprecated: Please use `tags` instead.
   167  	TagsAll pulumi.StringMapInput
   168  }
   169  
   170  func (RepositoryState) ElementType() reflect.Type {
   171  	return reflect.TypeOf((*repositoryState)(nil)).Elem()
   172  }
   173  
   174  type repositoryArgs struct {
   175  	// Catalog data configuration for the repository. See below for schema.
   176  	CatalogData  *RepositoryCatalogData `pulumi:"catalogData"`
   177  	ForceDestroy *bool                  `pulumi:"forceDestroy"`
   178  	// Name of the repository.
   179  	RepositoryName string `pulumi:"repositoryName"`
   180  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   181  	Tags map[string]string `pulumi:"tags"`
   182  }
   183  
   184  // The set of arguments for constructing a Repository resource.
   185  type RepositoryArgs struct {
   186  	// Catalog data configuration for the repository. See below for schema.
   187  	CatalogData  RepositoryCatalogDataPtrInput
   188  	ForceDestroy pulumi.BoolPtrInput
   189  	// Name of the repository.
   190  	RepositoryName pulumi.StringInput
   191  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   192  	Tags pulumi.StringMapInput
   193  }
   194  
   195  func (RepositoryArgs) ElementType() reflect.Type {
   196  	return reflect.TypeOf((*repositoryArgs)(nil)).Elem()
   197  }
   198  
   199  type RepositoryInput interface {
   200  	pulumi.Input
   201  
   202  	ToRepositoryOutput() RepositoryOutput
   203  	ToRepositoryOutputWithContext(ctx context.Context) RepositoryOutput
   204  }
   205  
   206  func (*Repository) ElementType() reflect.Type {
   207  	return reflect.TypeOf((**Repository)(nil)).Elem()
   208  }
   209  
   210  func (i *Repository) ToRepositoryOutput() RepositoryOutput {
   211  	return i.ToRepositoryOutputWithContext(context.Background())
   212  }
   213  
   214  func (i *Repository) ToRepositoryOutputWithContext(ctx context.Context) RepositoryOutput {
   215  	return pulumi.ToOutputWithContext(ctx, i).(RepositoryOutput)
   216  }
   217  
   218  // RepositoryArrayInput is an input type that accepts RepositoryArray and RepositoryArrayOutput values.
   219  // You can construct a concrete instance of `RepositoryArrayInput` via:
   220  //
   221  //	RepositoryArray{ RepositoryArgs{...} }
   222  type RepositoryArrayInput interface {
   223  	pulumi.Input
   224  
   225  	ToRepositoryArrayOutput() RepositoryArrayOutput
   226  	ToRepositoryArrayOutputWithContext(context.Context) RepositoryArrayOutput
   227  }
   228  
   229  type RepositoryArray []RepositoryInput
   230  
   231  func (RepositoryArray) ElementType() reflect.Type {
   232  	return reflect.TypeOf((*[]*Repository)(nil)).Elem()
   233  }
   234  
   235  func (i RepositoryArray) ToRepositoryArrayOutput() RepositoryArrayOutput {
   236  	return i.ToRepositoryArrayOutputWithContext(context.Background())
   237  }
   238  
   239  func (i RepositoryArray) ToRepositoryArrayOutputWithContext(ctx context.Context) RepositoryArrayOutput {
   240  	return pulumi.ToOutputWithContext(ctx, i).(RepositoryArrayOutput)
   241  }
   242  
   243  // RepositoryMapInput is an input type that accepts RepositoryMap and RepositoryMapOutput values.
   244  // You can construct a concrete instance of `RepositoryMapInput` via:
   245  //
   246  //	RepositoryMap{ "key": RepositoryArgs{...} }
   247  type RepositoryMapInput interface {
   248  	pulumi.Input
   249  
   250  	ToRepositoryMapOutput() RepositoryMapOutput
   251  	ToRepositoryMapOutputWithContext(context.Context) RepositoryMapOutput
   252  }
   253  
   254  type RepositoryMap map[string]RepositoryInput
   255  
   256  func (RepositoryMap) ElementType() reflect.Type {
   257  	return reflect.TypeOf((*map[string]*Repository)(nil)).Elem()
   258  }
   259  
   260  func (i RepositoryMap) ToRepositoryMapOutput() RepositoryMapOutput {
   261  	return i.ToRepositoryMapOutputWithContext(context.Background())
   262  }
   263  
   264  func (i RepositoryMap) ToRepositoryMapOutputWithContext(ctx context.Context) RepositoryMapOutput {
   265  	return pulumi.ToOutputWithContext(ctx, i).(RepositoryMapOutput)
   266  }
   267  
   268  type RepositoryOutput struct{ *pulumi.OutputState }
   269  
   270  func (RepositoryOutput) ElementType() reflect.Type {
   271  	return reflect.TypeOf((**Repository)(nil)).Elem()
   272  }
   273  
   274  func (o RepositoryOutput) ToRepositoryOutput() RepositoryOutput {
   275  	return o
   276  }
   277  
   278  func (o RepositoryOutput) ToRepositoryOutputWithContext(ctx context.Context) RepositoryOutput {
   279  	return o
   280  }
   281  
   282  // Full ARN of the repository.
   283  func (o RepositoryOutput) Arn() pulumi.StringOutput {
   284  	return o.ApplyT(func(v *Repository) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   285  }
   286  
   287  // Catalog data configuration for the repository. See below for schema.
   288  func (o RepositoryOutput) CatalogData() RepositoryCatalogDataPtrOutput {
   289  	return o.ApplyT(func(v *Repository) RepositoryCatalogDataPtrOutput { return v.CatalogData }).(RepositoryCatalogDataPtrOutput)
   290  }
   291  
   292  func (o RepositoryOutput) ForceDestroy() pulumi.BoolPtrOutput {
   293  	return o.ApplyT(func(v *Repository) pulumi.BoolPtrOutput { return v.ForceDestroy }).(pulumi.BoolPtrOutput)
   294  }
   295  
   296  // The registry ID where the repository was created.
   297  func (o RepositoryOutput) RegistryId() pulumi.StringOutput {
   298  	return o.ApplyT(func(v *Repository) pulumi.StringOutput { return v.RegistryId }).(pulumi.StringOutput)
   299  }
   300  
   301  // Name of the repository.
   302  func (o RepositoryOutput) RepositoryName() pulumi.StringOutput {
   303  	return o.ApplyT(func(v *Repository) pulumi.StringOutput { return v.RepositoryName }).(pulumi.StringOutput)
   304  }
   305  
   306  // The URI of the repository.
   307  func (o RepositoryOutput) RepositoryUri() pulumi.StringOutput {
   308  	return o.ApplyT(func(v *Repository) pulumi.StringOutput { return v.RepositoryUri }).(pulumi.StringOutput)
   309  }
   310  
   311  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   312  func (o RepositoryOutput) Tags() pulumi.StringMapOutput {
   313  	return o.ApplyT(func(v *Repository) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   314  }
   315  
   316  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   317  //
   318  // Deprecated: Please use `tags` instead.
   319  func (o RepositoryOutput) TagsAll() pulumi.StringMapOutput {
   320  	return o.ApplyT(func(v *Repository) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   321  }
   322  
   323  type RepositoryArrayOutput struct{ *pulumi.OutputState }
   324  
   325  func (RepositoryArrayOutput) ElementType() reflect.Type {
   326  	return reflect.TypeOf((*[]*Repository)(nil)).Elem()
   327  }
   328  
   329  func (o RepositoryArrayOutput) ToRepositoryArrayOutput() RepositoryArrayOutput {
   330  	return o
   331  }
   332  
   333  func (o RepositoryArrayOutput) ToRepositoryArrayOutputWithContext(ctx context.Context) RepositoryArrayOutput {
   334  	return o
   335  }
   336  
   337  func (o RepositoryArrayOutput) Index(i pulumi.IntInput) RepositoryOutput {
   338  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Repository {
   339  		return vs[0].([]*Repository)[vs[1].(int)]
   340  	}).(RepositoryOutput)
   341  }
   342  
   343  type RepositoryMapOutput struct{ *pulumi.OutputState }
   344  
   345  func (RepositoryMapOutput) ElementType() reflect.Type {
   346  	return reflect.TypeOf((*map[string]*Repository)(nil)).Elem()
   347  }
   348  
   349  func (o RepositoryMapOutput) ToRepositoryMapOutput() RepositoryMapOutput {
   350  	return o
   351  }
   352  
   353  func (o RepositoryMapOutput) ToRepositoryMapOutputWithContext(ctx context.Context) RepositoryMapOutput {
   354  	return o
   355  }
   356  
   357  func (o RepositoryMapOutput) MapIndex(k pulumi.StringInput) RepositoryOutput {
   358  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Repository {
   359  		return vs[0].(map[string]*Repository)[vs[1].(string)]
   360  	}).(RepositoryOutput)
   361  }
   362  
   363  func init() {
   364  	pulumi.RegisterInputType(reflect.TypeOf((*RepositoryInput)(nil)).Elem(), &Repository{})
   365  	pulumi.RegisterInputType(reflect.TypeOf((*RepositoryArrayInput)(nil)).Elem(), RepositoryArray{})
   366  	pulumi.RegisterInputType(reflect.TypeOf((*RepositoryMapInput)(nil)).Elem(), RepositoryMap{})
   367  	pulumi.RegisterOutputType(RepositoryOutput{})
   368  	pulumi.RegisterOutputType(RepositoryArrayOutput{})
   369  	pulumi.RegisterOutputType(RepositoryMapOutput{})
   370  }