github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sfn/activity.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 sfn
     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 Step Function Activity 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/sfn"
    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 := sfn.NewActivity(ctx, "sfn_activity", &sfn.ActivityArgs{
    32  //				Name: pulumi.String("my-activity"),
    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 activities using the `arn`. For example:
    47  //
    48  // ```sh
    49  // $ pulumi import aws:sfn/activity:Activity foo arn:aws:states:eu-west-1:123456789098:activity:bar
    50  // ```
    51  type Activity struct {
    52  	pulumi.CustomResourceState
    53  
    54  	// The date the activity was created.
    55  	CreationDate pulumi.StringOutput `pulumi:"creationDate"`
    56  	// The name of the activity to create.
    57  	Name pulumi.StringOutput `pulumi:"name"`
    58  	// 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.
    59  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    60  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    61  	//
    62  	// Deprecated: Please use `tags` instead.
    63  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    64  }
    65  
    66  // NewActivity registers a new resource with the given unique name, arguments, and options.
    67  func NewActivity(ctx *pulumi.Context,
    68  	name string, args *ActivityArgs, opts ...pulumi.ResourceOption) (*Activity, error) {
    69  	if args == nil {
    70  		args = &ActivityArgs{}
    71  	}
    72  
    73  	opts = internal.PkgResourceDefaultOpts(opts)
    74  	var resource Activity
    75  	err := ctx.RegisterResource("aws:sfn/activity:Activity", name, args, &resource, opts...)
    76  	if err != nil {
    77  		return nil, err
    78  	}
    79  	return &resource, nil
    80  }
    81  
    82  // GetActivity gets an existing Activity resource's state with the given name, ID, and optional
    83  // state properties that are used to uniquely qualify the lookup (nil if not required).
    84  func GetActivity(ctx *pulumi.Context,
    85  	name string, id pulumi.IDInput, state *ActivityState, opts ...pulumi.ResourceOption) (*Activity, error) {
    86  	var resource Activity
    87  	err := ctx.ReadResource("aws:sfn/activity:Activity", name, id, state, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // Input properties used for looking up and filtering Activity resources.
    95  type activityState struct {
    96  	// The date the activity was created.
    97  	CreationDate *string `pulumi:"creationDate"`
    98  	// The name of the activity to create.
    99  	Name *string `pulumi:"name"`
   100  	// 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.
   101  	Tags map[string]string `pulumi:"tags"`
   102  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   103  	//
   104  	// Deprecated: Please use `tags` instead.
   105  	TagsAll map[string]string `pulumi:"tagsAll"`
   106  }
   107  
   108  type ActivityState struct {
   109  	// The date the activity was created.
   110  	CreationDate pulumi.StringPtrInput
   111  	// The name of the activity to create.
   112  	Name pulumi.StringPtrInput
   113  	// 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.
   114  	Tags pulumi.StringMapInput
   115  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   116  	//
   117  	// Deprecated: Please use `tags` instead.
   118  	TagsAll pulumi.StringMapInput
   119  }
   120  
   121  func (ActivityState) ElementType() reflect.Type {
   122  	return reflect.TypeOf((*activityState)(nil)).Elem()
   123  }
   124  
   125  type activityArgs struct {
   126  	// The name of the activity to create.
   127  	Name *string `pulumi:"name"`
   128  	// 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.
   129  	Tags map[string]string `pulumi:"tags"`
   130  }
   131  
   132  // The set of arguments for constructing a Activity resource.
   133  type ActivityArgs struct {
   134  	// The name of the activity to create.
   135  	Name pulumi.StringPtrInput
   136  	// 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.
   137  	Tags pulumi.StringMapInput
   138  }
   139  
   140  func (ActivityArgs) ElementType() reflect.Type {
   141  	return reflect.TypeOf((*activityArgs)(nil)).Elem()
   142  }
   143  
   144  type ActivityInput interface {
   145  	pulumi.Input
   146  
   147  	ToActivityOutput() ActivityOutput
   148  	ToActivityOutputWithContext(ctx context.Context) ActivityOutput
   149  }
   150  
   151  func (*Activity) ElementType() reflect.Type {
   152  	return reflect.TypeOf((**Activity)(nil)).Elem()
   153  }
   154  
   155  func (i *Activity) ToActivityOutput() ActivityOutput {
   156  	return i.ToActivityOutputWithContext(context.Background())
   157  }
   158  
   159  func (i *Activity) ToActivityOutputWithContext(ctx context.Context) ActivityOutput {
   160  	return pulumi.ToOutputWithContext(ctx, i).(ActivityOutput)
   161  }
   162  
   163  // ActivityArrayInput is an input type that accepts ActivityArray and ActivityArrayOutput values.
   164  // You can construct a concrete instance of `ActivityArrayInput` via:
   165  //
   166  //	ActivityArray{ ActivityArgs{...} }
   167  type ActivityArrayInput interface {
   168  	pulumi.Input
   169  
   170  	ToActivityArrayOutput() ActivityArrayOutput
   171  	ToActivityArrayOutputWithContext(context.Context) ActivityArrayOutput
   172  }
   173  
   174  type ActivityArray []ActivityInput
   175  
   176  func (ActivityArray) ElementType() reflect.Type {
   177  	return reflect.TypeOf((*[]*Activity)(nil)).Elem()
   178  }
   179  
   180  func (i ActivityArray) ToActivityArrayOutput() ActivityArrayOutput {
   181  	return i.ToActivityArrayOutputWithContext(context.Background())
   182  }
   183  
   184  func (i ActivityArray) ToActivityArrayOutputWithContext(ctx context.Context) ActivityArrayOutput {
   185  	return pulumi.ToOutputWithContext(ctx, i).(ActivityArrayOutput)
   186  }
   187  
   188  // ActivityMapInput is an input type that accepts ActivityMap and ActivityMapOutput values.
   189  // You can construct a concrete instance of `ActivityMapInput` via:
   190  //
   191  //	ActivityMap{ "key": ActivityArgs{...} }
   192  type ActivityMapInput interface {
   193  	pulumi.Input
   194  
   195  	ToActivityMapOutput() ActivityMapOutput
   196  	ToActivityMapOutputWithContext(context.Context) ActivityMapOutput
   197  }
   198  
   199  type ActivityMap map[string]ActivityInput
   200  
   201  func (ActivityMap) ElementType() reflect.Type {
   202  	return reflect.TypeOf((*map[string]*Activity)(nil)).Elem()
   203  }
   204  
   205  func (i ActivityMap) ToActivityMapOutput() ActivityMapOutput {
   206  	return i.ToActivityMapOutputWithContext(context.Background())
   207  }
   208  
   209  func (i ActivityMap) ToActivityMapOutputWithContext(ctx context.Context) ActivityMapOutput {
   210  	return pulumi.ToOutputWithContext(ctx, i).(ActivityMapOutput)
   211  }
   212  
   213  type ActivityOutput struct{ *pulumi.OutputState }
   214  
   215  func (ActivityOutput) ElementType() reflect.Type {
   216  	return reflect.TypeOf((**Activity)(nil)).Elem()
   217  }
   218  
   219  func (o ActivityOutput) ToActivityOutput() ActivityOutput {
   220  	return o
   221  }
   222  
   223  func (o ActivityOutput) ToActivityOutputWithContext(ctx context.Context) ActivityOutput {
   224  	return o
   225  }
   226  
   227  // The date the activity was created.
   228  func (o ActivityOutput) CreationDate() pulumi.StringOutput {
   229  	return o.ApplyT(func(v *Activity) pulumi.StringOutput { return v.CreationDate }).(pulumi.StringOutput)
   230  }
   231  
   232  // The name of the activity to create.
   233  func (o ActivityOutput) Name() pulumi.StringOutput {
   234  	return o.ApplyT(func(v *Activity) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   235  }
   236  
   237  // 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.
   238  func (o ActivityOutput) Tags() pulumi.StringMapOutput {
   239  	return o.ApplyT(func(v *Activity) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   240  }
   241  
   242  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   243  //
   244  // Deprecated: Please use `tags` instead.
   245  func (o ActivityOutput) TagsAll() pulumi.StringMapOutput {
   246  	return o.ApplyT(func(v *Activity) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   247  }
   248  
   249  type ActivityArrayOutput struct{ *pulumi.OutputState }
   250  
   251  func (ActivityArrayOutput) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*[]*Activity)(nil)).Elem()
   253  }
   254  
   255  func (o ActivityArrayOutput) ToActivityArrayOutput() ActivityArrayOutput {
   256  	return o
   257  }
   258  
   259  func (o ActivityArrayOutput) ToActivityArrayOutputWithContext(ctx context.Context) ActivityArrayOutput {
   260  	return o
   261  }
   262  
   263  func (o ActivityArrayOutput) Index(i pulumi.IntInput) ActivityOutput {
   264  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Activity {
   265  		return vs[0].([]*Activity)[vs[1].(int)]
   266  	}).(ActivityOutput)
   267  }
   268  
   269  type ActivityMapOutput struct{ *pulumi.OutputState }
   270  
   271  func (ActivityMapOutput) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*map[string]*Activity)(nil)).Elem()
   273  }
   274  
   275  func (o ActivityMapOutput) ToActivityMapOutput() ActivityMapOutput {
   276  	return o
   277  }
   278  
   279  func (o ActivityMapOutput) ToActivityMapOutputWithContext(ctx context.Context) ActivityMapOutput {
   280  	return o
   281  }
   282  
   283  func (o ActivityMapOutput) MapIndex(k pulumi.StringInput) ActivityOutput {
   284  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Activity {
   285  		return vs[0].(map[string]*Activity)[vs[1].(string)]
   286  	}).(ActivityOutput)
   287  }
   288  
   289  func init() {
   290  	pulumi.RegisterInputType(reflect.TypeOf((*ActivityInput)(nil)).Elem(), &Activity{})
   291  	pulumi.RegisterInputType(reflect.TypeOf((*ActivityArrayInput)(nil)).Elem(), ActivityArray{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*ActivityMapInput)(nil)).Elem(), ActivityMap{})
   293  	pulumi.RegisterOutputType(ActivityOutput{})
   294  	pulumi.RegisterOutputType(ActivityArrayOutput{})
   295  	pulumi.RegisterOutputType(ActivityMapOutput{})
   296  }