github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/simpledb/domain.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 simpledb
     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 a SimpleDB domain resource
    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/simpledb"
    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 := simpledb.NewDomain(ctx, "users", &simpledb.DomainArgs{
    32  //				Name: pulumi.String("users"),
    33  //			})
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  //
    44  // ## Import
    45  //
    46  // Using `pulumi import`, import SimpleDB Domains using the `name`. For example:
    47  //
    48  // ```sh
    49  // $ pulumi import aws:simpledb/domain:Domain users users
    50  // ```
    51  type Domain struct {
    52  	pulumi.CustomResourceState
    53  
    54  	// The name of the SimpleDB domain
    55  	Name pulumi.StringOutput `pulumi:"name"`
    56  }
    57  
    58  // NewDomain registers a new resource with the given unique name, arguments, and options.
    59  func NewDomain(ctx *pulumi.Context,
    60  	name string, args *DomainArgs, opts ...pulumi.ResourceOption) (*Domain, error) {
    61  	if args == nil {
    62  		args = &DomainArgs{}
    63  	}
    64  
    65  	opts = internal.PkgResourceDefaultOpts(opts)
    66  	var resource Domain
    67  	err := ctx.RegisterResource("aws:simpledb/domain:Domain", name, args, &resource, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return &resource, nil
    72  }
    73  
    74  // GetDomain gets an existing Domain resource's state with the given name, ID, and optional
    75  // state properties that are used to uniquely qualify the lookup (nil if not required).
    76  func GetDomain(ctx *pulumi.Context,
    77  	name string, id pulumi.IDInput, state *DomainState, opts ...pulumi.ResourceOption) (*Domain, error) {
    78  	var resource Domain
    79  	err := ctx.ReadResource("aws:simpledb/domain:Domain", name, id, state, &resource, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return &resource, nil
    84  }
    85  
    86  // Input properties used for looking up and filtering Domain resources.
    87  type domainState struct {
    88  	// The name of the SimpleDB domain
    89  	Name *string `pulumi:"name"`
    90  }
    91  
    92  type DomainState struct {
    93  	// The name of the SimpleDB domain
    94  	Name pulumi.StringPtrInput
    95  }
    96  
    97  func (DomainState) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*domainState)(nil)).Elem()
    99  }
   100  
   101  type domainArgs struct {
   102  	// The name of the SimpleDB domain
   103  	Name *string `pulumi:"name"`
   104  }
   105  
   106  // The set of arguments for constructing a Domain resource.
   107  type DomainArgs struct {
   108  	// The name of the SimpleDB domain
   109  	Name pulumi.StringPtrInput
   110  }
   111  
   112  func (DomainArgs) ElementType() reflect.Type {
   113  	return reflect.TypeOf((*domainArgs)(nil)).Elem()
   114  }
   115  
   116  type DomainInput interface {
   117  	pulumi.Input
   118  
   119  	ToDomainOutput() DomainOutput
   120  	ToDomainOutputWithContext(ctx context.Context) DomainOutput
   121  }
   122  
   123  func (*Domain) ElementType() reflect.Type {
   124  	return reflect.TypeOf((**Domain)(nil)).Elem()
   125  }
   126  
   127  func (i *Domain) ToDomainOutput() DomainOutput {
   128  	return i.ToDomainOutputWithContext(context.Background())
   129  }
   130  
   131  func (i *Domain) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
   132  	return pulumi.ToOutputWithContext(ctx, i).(DomainOutput)
   133  }
   134  
   135  // DomainArrayInput is an input type that accepts DomainArray and DomainArrayOutput values.
   136  // You can construct a concrete instance of `DomainArrayInput` via:
   137  //
   138  //	DomainArray{ DomainArgs{...} }
   139  type DomainArrayInput interface {
   140  	pulumi.Input
   141  
   142  	ToDomainArrayOutput() DomainArrayOutput
   143  	ToDomainArrayOutputWithContext(context.Context) DomainArrayOutput
   144  }
   145  
   146  type DomainArray []DomainInput
   147  
   148  func (DomainArray) ElementType() reflect.Type {
   149  	return reflect.TypeOf((*[]*Domain)(nil)).Elem()
   150  }
   151  
   152  func (i DomainArray) ToDomainArrayOutput() DomainArrayOutput {
   153  	return i.ToDomainArrayOutputWithContext(context.Background())
   154  }
   155  
   156  func (i DomainArray) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput {
   157  	return pulumi.ToOutputWithContext(ctx, i).(DomainArrayOutput)
   158  }
   159  
   160  // DomainMapInput is an input type that accepts DomainMap and DomainMapOutput values.
   161  // You can construct a concrete instance of `DomainMapInput` via:
   162  //
   163  //	DomainMap{ "key": DomainArgs{...} }
   164  type DomainMapInput interface {
   165  	pulumi.Input
   166  
   167  	ToDomainMapOutput() DomainMapOutput
   168  	ToDomainMapOutputWithContext(context.Context) DomainMapOutput
   169  }
   170  
   171  type DomainMap map[string]DomainInput
   172  
   173  func (DomainMap) ElementType() reflect.Type {
   174  	return reflect.TypeOf((*map[string]*Domain)(nil)).Elem()
   175  }
   176  
   177  func (i DomainMap) ToDomainMapOutput() DomainMapOutput {
   178  	return i.ToDomainMapOutputWithContext(context.Background())
   179  }
   180  
   181  func (i DomainMap) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput {
   182  	return pulumi.ToOutputWithContext(ctx, i).(DomainMapOutput)
   183  }
   184  
   185  type DomainOutput struct{ *pulumi.OutputState }
   186  
   187  func (DomainOutput) ElementType() reflect.Type {
   188  	return reflect.TypeOf((**Domain)(nil)).Elem()
   189  }
   190  
   191  func (o DomainOutput) ToDomainOutput() DomainOutput {
   192  	return o
   193  }
   194  
   195  func (o DomainOutput) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
   196  	return o
   197  }
   198  
   199  // The name of the SimpleDB domain
   200  func (o DomainOutput) Name() pulumi.StringOutput {
   201  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   202  }
   203  
   204  type DomainArrayOutput struct{ *pulumi.OutputState }
   205  
   206  func (DomainArrayOutput) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*[]*Domain)(nil)).Elem()
   208  }
   209  
   210  func (o DomainArrayOutput) ToDomainArrayOutput() DomainArrayOutput {
   211  	return o
   212  }
   213  
   214  func (o DomainArrayOutput) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput {
   215  	return o
   216  }
   217  
   218  func (o DomainArrayOutput) Index(i pulumi.IntInput) DomainOutput {
   219  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Domain {
   220  		return vs[0].([]*Domain)[vs[1].(int)]
   221  	}).(DomainOutput)
   222  }
   223  
   224  type DomainMapOutput struct{ *pulumi.OutputState }
   225  
   226  func (DomainMapOutput) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*map[string]*Domain)(nil)).Elem()
   228  }
   229  
   230  func (o DomainMapOutput) ToDomainMapOutput() DomainMapOutput {
   231  	return o
   232  }
   233  
   234  func (o DomainMapOutput) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput {
   235  	return o
   236  }
   237  
   238  func (o DomainMapOutput) MapIndex(k pulumi.StringInput) DomainOutput {
   239  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Domain {
   240  		return vs[0].(map[string]*Domain)[vs[1].(string)]
   241  	}).(DomainOutput)
   242  }
   243  
   244  func init() {
   245  	pulumi.RegisterInputType(reflect.TypeOf((*DomainInput)(nil)).Elem(), &Domain{})
   246  	pulumi.RegisterInputType(reflect.TypeOf((*DomainArrayInput)(nil)).Elem(), DomainArray{})
   247  	pulumi.RegisterInputType(reflect.TypeOf((*DomainMapInput)(nil)).Elem(), DomainMap{})
   248  	pulumi.RegisterOutputType(DomainOutput{})
   249  	pulumi.RegisterOutputType(DomainArrayOutput{})
   250  	pulumi.RegisterOutputType(DomainMapOutput{})
   251  }