github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/swf/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 swf
     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 an SWF Domain resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // To register a basic SWF domain:
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/swf"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := swf.NewDomain(ctx, "foo", &swf.DomainArgs{
    35  //				Name:                                   pulumi.String("foo"),
    36  //				Description:                            pulumi.String("SWF Domain"),
    37  //				WorkflowExecutionRetentionPeriodInDays: pulumi.String("30"),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import SWF Domains using the `name`. For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:swf/domain:Domain foo test-domain
    55  // ```
    56  type Domain struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// Amazon Resource Name (ARN)
    60  	Arn pulumi.StringOutput `pulumi:"arn"`
    61  	// The domain description.
    62  	Description pulumi.StringPtrOutput `pulumi:"description"`
    63  	// The name of the domain. If omitted, this provider will assign a random, unique name.
    64  	Name pulumi.StringOutput `pulumi:"name"`
    65  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
    66  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
    67  	// 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.
    68  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    69  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    70  	//
    71  	// Deprecated: Please use `tags` instead.
    72  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    73  	// Length of time that SWF will continue to retain information about the workflow execution after the workflow execution is complete, must be between 0 and 90 days.
    74  	WorkflowExecutionRetentionPeriodInDays pulumi.StringOutput `pulumi:"workflowExecutionRetentionPeriodInDays"`
    75  }
    76  
    77  // NewDomain registers a new resource with the given unique name, arguments, and options.
    78  func NewDomain(ctx *pulumi.Context,
    79  	name string, args *DomainArgs, opts ...pulumi.ResourceOption) (*Domain, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.WorkflowExecutionRetentionPeriodInDays == nil {
    85  		return nil, errors.New("invalid value for required argument 'WorkflowExecutionRetentionPeriodInDays'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource Domain
    89  	err := ctx.RegisterResource("aws:swf/domain:Domain", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetDomain gets an existing Domain resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetDomain(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *DomainState, opts ...pulumi.ResourceOption) (*Domain, error) {
   100  	var resource Domain
   101  	err := ctx.ReadResource("aws:swf/domain:Domain", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering Domain resources.
   109  type domainState struct {
   110  	// Amazon Resource Name (ARN)
   111  	Arn *string `pulumi:"arn"`
   112  	// The domain description.
   113  	Description *string `pulumi:"description"`
   114  	// The name of the domain. If omitted, this provider will assign a random, unique name.
   115  	Name *string `pulumi:"name"`
   116  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   117  	NamePrefix *string `pulumi:"namePrefix"`
   118  	// 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.
   119  	Tags map[string]string `pulumi:"tags"`
   120  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   121  	//
   122  	// Deprecated: Please use `tags` instead.
   123  	TagsAll map[string]string `pulumi:"tagsAll"`
   124  	// Length of time that SWF will continue to retain information about the workflow execution after the workflow execution is complete, must be between 0 and 90 days.
   125  	WorkflowExecutionRetentionPeriodInDays *string `pulumi:"workflowExecutionRetentionPeriodInDays"`
   126  }
   127  
   128  type DomainState struct {
   129  	// Amazon Resource Name (ARN)
   130  	Arn pulumi.StringPtrInput
   131  	// The domain description.
   132  	Description pulumi.StringPtrInput
   133  	// The name of the domain. If omitted, this provider will assign a random, unique name.
   134  	Name pulumi.StringPtrInput
   135  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   136  	NamePrefix pulumi.StringPtrInput
   137  	// 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.
   138  	Tags pulumi.StringMapInput
   139  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   140  	//
   141  	// Deprecated: Please use `tags` instead.
   142  	TagsAll pulumi.StringMapInput
   143  	// Length of time that SWF will continue to retain information about the workflow execution after the workflow execution is complete, must be between 0 and 90 days.
   144  	WorkflowExecutionRetentionPeriodInDays pulumi.StringPtrInput
   145  }
   146  
   147  func (DomainState) ElementType() reflect.Type {
   148  	return reflect.TypeOf((*domainState)(nil)).Elem()
   149  }
   150  
   151  type domainArgs struct {
   152  	// The domain description.
   153  	Description *string `pulumi:"description"`
   154  	// The name of the domain. If omitted, this provider will assign a random, unique name.
   155  	Name *string `pulumi:"name"`
   156  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   157  	NamePrefix *string `pulumi:"namePrefix"`
   158  	// 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.
   159  	Tags map[string]string `pulumi:"tags"`
   160  	// Length of time that SWF will continue to retain information about the workflow execution after the workflow execution is complete, must be between 0 and 90 days.
   161  	WorkflowExecutionRetentionPeriodInDays string `pulumi:"workflowExecutionRetentionPeriodInDays"`
   162  }
   163  
   164  // The set of arguments for constructing a Domain resource.
   165  type DomainArgs struct {
   166  	// The domain description.
   167  	Description pulumi.StringPtrInput
   168  	// The name of the domain. If omitted, this provider will assign a random, unique name.
   169  	Name pulumi.StringPtrInput
   170  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   171  	NamePrefix pulumi.StringPtrInput
   172  	// 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.
   173  	Tags pulumi.StringMapInput
   174  	// Length of time that SWF will continue to retain information about the workflow execution after the workflow execution is complete, must be between 0 and 90 days.
   175  	WorkflowExecutionRetentionPeriodInDays pulumi.StringInput
   176  }
   177  
   178  func (DomainArgs) ElementType() reflect.Type {
   179  	return reflect.TypeOf((*domainArgs)(nil)).Elem()
   180  }
   181  
   182  type DomainInput interface {
   183  	pulumi.Input
   184  
   185  	ToDomainOutput() DomainOutput
   186  	ToDomainOutputWithContext(ctx context.Context) DomainOutput
   187  }
   188  
   189  func (*Domain) ElementType() reflect.Type {
   190  	return reflect.TypeOf((**Domain)(nil)).Elem()
   191  }
   192  
   193  func (i *Domain) ToDomainOutput() DomainOutput {
   194  	return i.ToDomainOutputWithContext(context.Background())
   195  }
   196  
   197  func (i *Domain) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
   198  	return pulumi.ToOutputWithContext(ctx, i).(DomainOutput)
   199  }
   200  
   201  // DomainArrayInput is an input type that accepts DomainArray and DomainArrayOutput values.
   202  // You can construct a concrete instance of `DomainArrayInput` via:
   203  //
   204  //	DomainArray{ DomainArgs{...} }
   205  type DomainArrayInput interface {
   206  	pulumi.Input
   207  
   208  	ToDomainArrayOutput() DomainArrayOutput
   209  	ToDomainArrayOutputWithContext(context.Context) DomainArrayOutput
   210  }
   211  
   212  type DomainArray []DomainInput
   213  
   214  func (DomainArray) ElementType() reflect.Type {
   215  	return reflect.TypeOf((*[]*Domain)(nil)).Elem()
   216  }
   217  
   218  func (i DomainArray) ToDomainArrayOutput() DomainArrayOutput {
   219  	return i.ToDomainArrayOutputWithContext(context.Background())
   220  }
   221  
   222  func (i DomainArray) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput {
   223  	return pulumi.ToOutputWithContext(ctx, i).(DomainArrayOutput)
   224  }
   225  
   226  // DomainMapInput is an input type that accepts DomainMap and DomainMapOutput values.
   227  // You can construct a concrete instance of `DomainMapInput` via:
   228  //
   229  //	DomainMap{ "key": DomainArgs{...} }
   230  type DomainMapInput interface {
   231  	pulumi.Input
   232  
   233  	ToDomainMapOutput() DomainMapOutput
   234  	ToDomainMapOutputWithContext(context.Context) DomainMapOutput
   235  }
   236  
   237  type DomainMap map[string]DomainInput
   238  
   239  func (DomainMap) ElementType() reflect.Type {
   240  	return reflect.TypeOf((*map[string]*Domain)(nil)).Elem()
   241  }
   242  
   243  func (i DomainMap) ToDomainMapOutput() DomainMapOutput {
   244  	return i.ToDomainMapOutputWithContext(context.Background())
   245  }
   246  
   247  func (i DomainMap) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput {
   248  	return pulumi.ToOutputWithContext(ctx, i).(DomainMapOutput)
   249  }
   250  
   251  type DomainOutput struct{ *pulumi.OutputState }
   252  
   253  func (DomainOutput) ElementType() reflect.Type {
   254  	return reflect.TypeOf((**Domain)(nil)).Elem()
   255  }
   256  
   257  func (o DomainOutput) ToDomainOutput() DomainOutput {
   258  	return o
   259  }
   260  
   261  func (o DomainOutput) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
   262  	return o
   263  }
   264  
   265  // Amazon Resource Name (ARN)
   266  func (o DomainOutput) Arn() pulumi.StringOutput {
   267  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   268  }
   269  
   270  // The domain description.
   271  func (o DomainOutput) Description() pulumi.StringPtrOutput {
   272  	return o.ApplyT(func(v *Domain) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   273  }
   274  
   275  // The name of the domain. If omitted, this provider will assign a random, unique name.
   276  func (o DomainOutput) Name() pulumi.StringOutput {
   277  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   278  }
   279  
   280  // Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   281  func (o DomainOutput) NamePrefix() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   283  }
   284  
   285  // 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.
   286  func (o DomainOutput) Tags() pulumi.StringMapOutput {
   287  	return o.ApplyT(func(v *Domain) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   288  }
   289  
   290  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   291  //
   292  // Deprecated: Please use `tags` instead.
   293  func (o DomainOutput) TagsAll() pulumi.StringMapOutput {
   294  	return o.ApplyT(func(v *Domain) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   295  }
   296  
   297  // Length of time that SWF will continue to retain information about the workflow execution after the workflow execution is complete, must be between 0 and 90 days.
   298  func (o DomainOutput) WorkflowExecutionRetentionPeriodInDays() pulumi.StringOutput {
   299  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.WorkflowExecutionRetentionPeriodInDays }).(pulumi.StringOutput)
   300  }
   301  
   302  type DomainArrayOutput struct{ *pulumi.OutputState }
   303  
   304  func (DomainArrayOutput) ElementType() reflect.Type {
   305  	return reflect.TypeOf((*[]*Domain)(nil)).Elem()
   306  }
   307  
   308  func (o DomainArrayOutput) ToDomainArrayOutput() DomainArrayOutput {
   309  	return o
   310  }
   311  
   312  func (o DomainArrayOutput) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput {
   313  	return o
   314  }
   315  
   316  func (o DomainArrayOutput) Index(i pulumi.IntInput) DomainOutput {
   317  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Domain {
   318  		return vs[0].([]*Domain)[vs[1].(int)]
   319  	}).(DomainOutput)
   320  }
   321  
   322  type DomainMapOutput struct{ *pulumi.OutputState }
   323  
   324  func (DomainMapOutput) ElementType() reflect.Type {
   325  	return reflect.TypeOf((*map[string]*Domain)(nil)).Elem()
   326  }
   327  
   328  func (o DomainMapOutput) ToDomainMapOutput() DomainMapOutput {
   329  	return o
   330  }
   331  
   332  func (o DomainMapOutput) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput {
   333  	return o
   334  }
   335  
   336  func (o DomainMapOutput) MapIndex(k pulumi.StringInput) DomainOutput {
   337  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Domain {
   338  		return vs[0].(map[string]*Domain)[vs[1].(string)]
   339  	}).(DomainOutput)
   340  }
   341  
   342  func init() {
   343  	pulumi.RegisterInputType(reflect.TypeOf((*DomainInput)(nil)).Elem(), &Domain{})
   344  	pulumi.RegisterInputType(reflect.TypeOf((*DomainArrayInput)(nil)).Elem(), DomainArray{})
   345  	pulumi.RegisterInputType(reflect.TypeOf((*DomainMapInput)(nil)).Elem(), DomainMap{})
   346  	pulumi.RegisterOutputType(DomainOutput{})
   347  	pulumi.RegisterOutputType(DomainArrayOutput{})
   348  	pulumi.RegisterOutputType(DomainMapOutput{})
   349  }