github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/glue/registry.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 glue
     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 Glue Registry resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := glue.NewRegistry(ctx, "example", &glue.RegistryArgs{
    33  //				RegistryName: pulumi.String("example"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import Glue Registries using `arn`. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:glue/registry:Registry example arn:aws:glue:us-west-2:123456789012:registry/example
    51  // ```
    52  type Registry struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// Amazon Resource Name (ARN) of Glue Registry.
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// A description of the registry.
    58  	Description pulumi.StringPtrOutput `pulumi:"description"`
    59  	// The Name of the registry.
    60  	RegistryName pulumi.StringOutput `pulumi:"registryName"`
    61  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    62  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    63  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    64  	//
    65  	// Deprecated: Please use `tags` instead.
    66  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    67  }
    68  
    69  // NewRegistry registers a new resource with the given unique name, arguments, and options.
    70  func NewRegistry(ctx *pulumi.Context,
    71  	name string, args *RegistryArgs, opts ...pulumi.ResourceOption) (*Registry, error) {
    72  	if args == nil {
    73  		return nil, errors.New("missing one or more required arguments")
    74  	}
    75  
    76  	if args.RegistryName == nil {
    77  		return nil, errors.New("invalid value for required argument 'RegistryName'")
    78  	}
    79  	opts = internal.PkgResourceDefaultOpts(opts)
    80  	var resource Registry
    81  	err := ctx.RegisterResource("aws:glue/registry:Registry", name, args, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // GetRegistry gets an existing Registry resource's state with the given name, ID, and optional
    89  // state properties that are used to uniquely qualify the lookup (nil if not required).
    90  func GetRegistry(ctx *pulumi.Context,
    91  	name string, id pulumi.IDInput, state *RegistryState, opts ...pulumi.ResourceOption) (*Registry, error) {
    92  	var resource Registry
    93  	err := ctx.ReadResource("aws:glue/registry:Registry", name, id, state, &resource, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &resource, nil
    98  }
    99  
   100  // Input properties used for looking up and filtering Registry resources.
   101  type registryState struct {
   102  	// Amazon Resource Name (ARN) of Glue Registry.
   103  	Arn *string `pulumi:"arn"`
   104  	// A description of the registry.
   105  	Description *string `pulumi:"description"`
   106  	// The Name of the registry.
   107  	RegistryName *string `pulumi:"registryName"`
   108  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   109  	Tags map[string]string `pulumi:"tags"`
   110  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   111  	//
   112  	// Deprecated: Please use `tags` instead.
   113  	TagsAll map[string]string `pulumi:"tagsAll"`
   114  }
   115  
   116  type RegistryState struct {
   117  	// Amazon Resource Name (ARN) of Glue Registry.
   118  	Arn pulumi.StringPtrInput
   119  	// A description of the registry.
   120  	Description pulumi.StringPtrInput
   121  	// The Name of the registry.
   122  	RegistryName pulumi.StringPtrInput
   123  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   124  	Tags pulumi.StringMapInput
   125  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   126  	//
   127  	// Deprecated: Please use `tags` instead.
   128  	TagsAll pulumi.StringMapInput
   129  }
   130  
   131  func (RegistryState) ElementType() reflect.Type {
   132  	return reflect.TypeOf((*registryState)(nil)).Elem()
   133  }
   134  
   135  type registryArgs struct {
   136  	// A description of the registry.
   137  	Description *string `pulumi:"description"`
   138  	// The Name of the registry.
   139  	RegistryName string `pulumi:"registryName"`
   140  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   141  	Tags map[string]string `pulumi:"tags"`
   142  }
   143  
   144  // The set of arguments for constructing a Registry resource.
   145  type RegistryArgs struct {
   146  	// A description of the registry.
   147  	Description pulumi.StringPtrInput
   148  	// The Name of the registry.
   149  	RegistryName pulumi.StringInput
   150  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   151  	Tags pulumi.StringMapInput
   152  }
   153  
   154  func (RegistryArgs) ElementType() reflect.Type {
   155  	return reflect.TypeOf((*registryArgs)(nil)).Elem()
   156  }
   157  
   158  type RegistryInput interface {
   159  	pulumi.Input
   160  
   161  	ToRegistryOutput() RegistryOutput
   162  	ToRegistryOutputWithContext(ctx context.Context) RegistryOutput
   163  }
   164  
   165  func (*Registry) ElementType() reflect.Type {
   166  	return reflect.TypeOf((**Registry)(nil)).Elem()
   167  }
   168  
   169  func (i *Registry) ToRegistryOutput() RegistryOutput {
   170  	return i.ToRegistryOutputWithContext(context.Background())
   171  }
   172  
   173  func (i *Registry) ToRegistryOutputWithContext(ctx context.Context) RegistryOutput {
   174  	return pulumi.ToOutputWithContext(ctx, i).(RegistryOutput)
   175  }
   176  
   177  // RegistryArrayInput is an input type that accepts RegistryArray and RegistryArrayOutput values.
   178  // You can construct a concrete instance of `RegistryArrayInput` via:
   179  //
   180  //	RegistryArray{ RegistryArgs{...} }
   181  type RegistryArrayInput interface {
   182  	pulumi.Input
   183  
   184  	ToRegistryArrayOutput() RegistryArrayOutput
   185  	ToRegistryArrayOutputWithContext(context.Context) RegistryArrayOutput
   186  }
   187  
   188  type RegistryArray []RegistryInput
   189  
   190  func (RegistryArray) ElementType() reflect.Type {
   191  	return reflect.TypeOf((*[]*Registry)(nil)).Elem()
   192  }
   193  
   194  func (i RegistryArray) ToRegistryArrayOutput() RegistryArrayOutput {
   195  	return i.ToRegistryArrayOutputWithContext(context.Background())
   196  }
   197  
   198  func (i RegistryArray) ToRegistryArrayOutputWithContext(ctx context.Context) RegistryArrayOutput {
   199  	return pulumi.ToOutputWithContext(ctx, i).(RegistryArrayOutput)
   200  }
   201  
   202  // RegistryMapInput is an input type that accepts RegistryMap and RegistryMapOutput values.
   203  // You can construct a concrete instance of `RegistryMapInput` via:
   204  //
   205  //	RegistryMap{ "key": RegistryArgs{...} }
   206  type RegistryMapInput interface {
   207  	pulumi.Input
   208  
   209  	ToRegistryMapOutput() RegistryMapOutput
   210  	ToRegistryMapOutputWithContext(context.Context) RegistryMapOutput
   211  }
   212  
   213  type RegistryMap map[string]RegistryInput
   214  
   215  func (RegistryMap) ElementType() reflect.Type {
   216  	return reflect.TypeOf((*map[string]*Registry)(nil)).Elem()
   217  }
   218  
   219  func (i RegistryMap) ToRegistryMapOutput() RegistryMapOutput {
   220  	return i.ToRegistryMapOutputWithContext(context.Background())
   221  }
   222  
   223  func (i RegistryMap) ToRegistryMapOutputWithContext(ctx context.Context) RegistryMapOutput {
   224  	return pulumi.ToOutputWithContext(ctx, i).(RegistryMapOutput)
   225  }
   226  
   227  type RegistryOutput struct{ *pulumi.OutputState }
   228  
   229  func (RegistryOutput) ElementType() reflect.Type {
   230  	return reflect.TypeOf((**Registry)(nil)).Elem()
   231  }
   232  
   233  func (o RegistryOutput) ToRegistryOutput() RegistryOutput {
   234  	return o
   235  }
   236  
   237  func (o RegistryOutput) ToRegistryOutputWithContext(ctx context.Context) RegistryOutput {
   238  	return o
   239  }
   240  
   241  // Amazon Resource Name (ARN) of Glue Registry.
   242  func (o RegistryOutput) Arn() pulumi.StringOutput {
   243  	return o.ApplyT(func(v *Registry) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   244  }
   245  
   246  // A description of the registry.
   247  func (o RegistryOutput) Description() pulumi.StringPtrOutput {
   248  	return o.ApplyT(func(v *Registry) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   249  }
   250  
   251  // The Name of the registry.
   252  func (o RegistryOutput) RegistryName() pulumi.StringOutput {
   253  	return o.ApplyT(func(v *Registry) pulumi.StringOutput { return v.RegistryName }).(pulumi.StringOutput)
   254  }
   255  
   256  // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   257  func (o RegistryOutput) Tags() pulumi.StringMapOutput {
   258  	return o.ApplyT(func(v *Registry) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   259  }
   260  
   261  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   262  //
   263  // Deprecated: Please use `tags` instead.
   264  func (o RegistryOutput) TagsAll() pulumi.StringMapOutput {
   265  	return o.ApplyT(func(v *Registry) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   266  }
   267  
   268  type RegistryArrayOutput struct{ *pulumi.OutputState }
   269  
   270  func (RegistryArrayOutput) ElementType() reflect.Type {
   271  	return reflect.TypeOf((*[]*Registry)(nil)).Elem()
   272  }
   273  
   274  func (o RegistryArrayOutput) ToRegistryArrayOutput() RegistryArrayOutput {
   275  	return o
   276  }
   277  
   278  func (o RegistryArrayOutput) ToRegistryArrayOutputWithContext(ctx context.Context) RegistryArrayOutput {
   279  	return o
   280  }
   281  
   282  func (o RegistryArrayOutput) Index(i pulumi.IntInput) RegistryOutput {
   283  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Registry {
   284  		return vs[0].([]*Registry)[vs[1].(int)]
   285  	}).(RegistryOutput)
   286  }
   287  
   288  type RegistryMapOutput struct{ *pulumi.OutputState }
   289  
   290  func (RegistryMapOutput) ElementType() reflect.Type {
   291  	return reflect.TypeOf((*map[string]*Registry)(nil)).Elem()
   292  }
   293  
   294  func (o RegistryMapOutput) ToRegistryMapOutput() RegistryMapOutput {
   295  	return o
   296  }
   297  
   298  func (o RegistryMapOutput) ToRegistryMapOutputWithContext(ctx context.Context) RegistryMapOutput {
   299  	return o
   300  }
   301  
   302  func (o RegistryMapOutput) MapIndex(k pulumi.StringInput) RegistryOutput {
   303  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Registry {
   304  		return vs[0].(map[string]*Registry)[vs[1].(string)]
   305  	}).(RegistryOutput)
   306  }
   307  
   308  func init() {
   309  	pulumi.RegisterInputType(reflect.TypeOf((*RegistryInput)(nil)).Elem(), &Registry{})
   310  	pulumi.RegisterInputType(reflect.TypeOf((*RegistryArrayInput)(nil)).Elem(), RegistryArray{})
   311  	pulumi.RegisterInputType(reflect.TypeOf((*RegistryMapInput)(nil)).Elem(), RegistryMap{})
   312  	pulumi.RegisterOutputType(RegistryOutput{})
   313  	pulumi.RegisterOutputType(RegistryArrayOutput{})
   314  	pulumi.RegisterOutputType(RegistryMapOutput{})
   315  }