package sagemaker

import (
	"context"
	"reflect"

	"github.com/pkg/errors"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

type FlowDefinition struct {
	pulumi.CustomResourceState

	Arn pulumi.StringOutput `pulumi:"arn"`

	FlowDefinitionName pulumi.StringOutput `pulumi:"flowDefinitionName"`

	HumanLoopActivationConfig FlowDefinitionHumanLoopActivationConfigPtrOutput `pulumi:"humanLoopActivationConfig"`

	HumanLoopConfig FlowDefinitionHumanLoopConfigOutput `pulumi:"humanLoopConfig"`

	HumanLoopRequestSource FlowDefinitionHumanLoopRequestSourcePtrOutput `pulumi:"humanLoopRequestSource"`

	OutputConfig FlowDefinitionOutputConfigOutput `pulumi:"outputConfig"`

	RoleArn pulumi.StringOutput `pulumi:"roleArn"`

	Tags pulumi.StringMapOutput `pulumi:"tags"`

	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}

func NewFlowDefinition(ctx *pulumi.Context,
	name string, args *FlowDefinitionArgs, opts ...pulumi.ResourceOption) (*FlowDefinition, error) {
	if args == nil {
		return nil, errors.New("missing one or more required arguments")
	}

	if args.FlowDefinitionName == nil {
		return nil, errors.New("invalid value for required argument 'FlowDefinitionName'")
	}
	if args.HumanLoopConfig == nil {
		return nil, errors.New("invalid value for required argument 'HumanLoopConfig'")
	}
	if args.OutputConfig == nil {
		return nil, errors.New("invalid value for required argument 'OutputConfig'")
	}
	if args.RoleArn == nil {
		return nil, errors.New("invalid value for required argument 'RoleArn'")
	}
	var resource FlowDefinition
	err := ctx.RegisterResource("aws:sagemaker/flowDefinition:FlowDefinition", name, args, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

func GetFlowDefinition(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *FlowDefinitionState, opts ...pulumi.ResourceOption) (*FlowDefinition, error) {
	var resource FlowDefinition
	err := ctx.ReadResource("aws:sagemaker/flowDefinition:FlowDefinition", name, id, state, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

type flowDefinitionState struct {

	Arn *string `pulumi:"arn"`

	FlowDefinitionName *string `pulumi:"flowDefinitionName"`

	HumanLoopActivationConfig *FlowDefinitionHumanLoopActivationConfig `pulumi:"humanLoopActivationConfig"`

	HumanLoopConfig *FlowDefinitionHumanLoopConfig `pulumi:"humanLoopConfig"`

	HumanLoopRequestSource *FlowDefinitionHumanLoopRequestSource `pulumi:"humanLoopRequestSource"`

	OutputConfig *FlowDefinitionOutputConfig `pulumi:"outputConfig"`

	RoleArn *string `pulumi:"roleArn"`

	Tags map[string]string `pulumi:"tags"`

	TagsAll map[string]string `pulumi:"tagsAll"`
}

type FlowDefinitionState struct {

	Arn pulumi.StringPtrInput

	FlowDefinitionName pulumi.StringPtrInput

	HumanLoopActivationConfig FlowDefinitionHumanLoopActivationConfigPtrInput

	HumanLoopConfig FlowDefinitionHumanLoopConfigPtrInput

	HumanLoopRequestSource FlowDefinitionHumanLoopRequestSourcePtrInput

	OutputConfig FlowDefinitionOutputConfigPtrInput

	RoleArn pulumi.StringPtrInput

	Tags pulumi.StringMapInput

	TagsAll pulumi.StringMapInput
}

func (FlowDefinitionState) ElementType() reflect.Type {
	return reflect.TypeOf((*flowDefinitionState)(nil)).Elem()
}

type flowDefinitionArgs struct {

	FlowDefinitionName string `pulumi:"flowDefinitionName"`

	HumanLoopActivationConfig *FlowDefinitionHumanLoopActivationConfig `pulumi:"humanLoopActivationConfig"`

	HumanLoopConfig FlowDefinitionHumanLoopConfig `pulumi:"humanLoopConfig"`

	HumanLoopRequestSource *FlowDefinitionHumanLoopRequestSource `pulumi:"humanLoopRequestSource"`

	OutputConfig FlowDefinitionOutputConfig `pulumi:"outputConfig"`

	RoleArn string `pulumi:"roleArn"`

	Tags map[string]string `pulumi:"tags"`

	TagsAll map[string]string `pulumi:"tagsAll"`
}

type FlowDefinitionArgs struct {

	FlowDefinitionName pulumi.StringInput

	HumanLoopActivationConfig FlowDefinitionHumanLoopActivationConfigPtrInput

	HumanLoopConfig FlowDefinitionHumanLoopConfigInput

	HumanLoopRequestSource FlowDefinitionHumanLoopRequestSourcePtrInput

	OutputConfig FlowDefinitionOutputConfigInput

	RoleArn pulumi.StringInput

	Tags pulumi.StringMapInput

	TagsAll pulumi.StringMapInput
}

func (FlowDefinitionArgs) ElementType() reflect.Type {
	return reflect.TypeOf((*flowDefinitionArgs)(nil)).Elem()
}

type FlowDefinitionInput interface {
	pulumi.Input

	ToFlowDefinitionOutput() FlowDefinitionOutput
	ToFlowDefinitionOutputWithContext(ctx context.Context) FlowDefinitionOutput
}

func (*FlowDefinition) ElementType() reflect.Type {
	return reflect.TypeOf((*FlowDefinition)(nil))
}

func (i *FlowDefinition) ToFlowDefinitionOutput() FlowDefinitionOutput {
	return i.ToFlowDefinitionOutputWithContext(context.Background())
}

func (i *FlowDefinition) ToFlowDefinitionOutputWithContext(ctx context.Context) FlowDefinitionOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionOutput)
}

func (i *FlowDefinition) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return i.ToFlowDefinitionPtrOutputWithContext(context.Background())
}

func (i *FlowDefinition) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionPtrOutput)
}

type FlowDefinitionPtrInput interface {
	pulumi.Input

	ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput
	ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput
}

type flowDefinitionPtrType FlowDefinitionArgs

func (*flowDefinitionPtrType) ElementType() reflect.Type {
	return reflect.TypeOf((**FlowDefinition)(nil))
}

func (i *flowDefinitionPtrType) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return i.ToFlowDefinitionPtrOutputWithContext(context.Background())
}

func (i *flowDefinitionPtrType) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionPtrOutput)
}

type FlowDefinitionArrayInput interface {
	pulumi.Input

	ToFlowDefinitionArrayOutput() FlowDefinitionArrayOutput
	ToFlowDefinitionArrayOutputWithContext(context.Context) FlowDefinitionArrayOutput
}

type FlowDefinitionArray []FlowDefinitionInput

func (FlowDefinitionArray) ElementType() reflect.Type {
	return reflect.TypeOf((*[]*FlowDefinition)(nil)).Elem()
}

func (i FlowDefinitionArray) ToFlowDefinitionArrayOutput() FlowDefinitionArrayOutput {
	return i.ToFlowDefinitionArrayOutputWithContext(context.Background())
}

func (i FlowDefinitionArray) ToFlowDefinitionArrayOutputWithContext(ctx context.Context) FlowDefinitionArrayOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionArrayOutput)
}

type FlowDefinitionMapInput interface {
	pulumi.Input

	ToFlowDefinitionMapOutput() FlowDefinitionMapOutput
	ToFlowDefinitionMapOutputWithContext(context.Context) FlowDefinitionMapOutput
}

type FlowDefinitionMap map[string]FlowDefinitionInput

func (FlowDefinitionMap) ElementType() reflect.Type {
	return reflect.TypeOf((*map[string]*FlowDefinition)(nil)).Elem()
}

func (i FlowDefinitionMap) ToFlowDefinitionMapOutput() FlowDefinitionMapOutput {
	return i.ToFlowDefinitionMapOutputWithContext(context.Background())
}

func (i FlowDefinitionMap) ToFlowDefinitionMapOutputWithContext(ctx context.Context) FlowDefinitionMapOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionMapOutput)
}

type FlowDefinitionOutput struct{ *pulumi.OutputState }

func (FlowDefinitionOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*FlowDefinition)(nil))
}

func (o FlowDefinitionOutput) ToFlowDefinitionOutput() FlowDefinitionOutput {
	return o
}

func (o FlowDefinitionOutput) ToFlowDefinitionOutputWithContext(ctx context.Context) FlowDefinitionOutput {
	return o
}

func (o FlowDefinitionOutput) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return o.ToFlowDefinitionPtrOutputWithContext(context.Background())
}

func (o FlowDefinitionOutput) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return o.ApplyTWithContext(ctx, func(_ context.Context, v FlowDefinition) *FlowDefinition {
		return &v
	}).(FlowDefinitionPtrOutput)
}

type FlowDefinitionPtrOutput struct{ *pulumi.OutputState }

func (FlowDefinitionPtrOutput) ElementType() reflect.Type {
	return reflect.TypeOf((**FlowDefinition)(nil))
}

func (o FlowDefinitionPtrOutput) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return o
}

func (o FlowDefinitionPtrOutput) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return o
}

func (o FlowDefinitionPtrOutput) Elem() FlowDefinitionOutput {
	return o.ApplyT(func(v *FlowDefinition) FlowDefinition {
		if v != nil {
			return *v
		}
		var ret FlowDefinition
		return ret
	}).(FlowDefinitionOutput)
}

type FlowDefinitionArrayOutput struct{ *pulumi.OutputState }

func (FlowDefinitionArrayOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*[]FlowDefinition)(nil))
}

func (o FlowDefinitionArrayOutput) ToFlowDefinitionArrayOutput() FlowDefinitionArrayOutput {
	return o
}

func (o FlowDefinitionArrayOutput) ToFlowDefinitionArrayOutputWithContext(ctx context.Context) FlowDefinitionArrayOutput {
	return o
}

func (o FlowDefinitionArrayOutput) Index(i pulumi.IntInput) FlowDefinitionOutput {
	return pulumi.All(o, i).ApplyT(func(vs []interface{}) FlowDefinition {
		return vs[0].([]FlowDefinition)[vs[1].(int)]
	}).(FlowDefinitionOutput)
}

type FlowDefinitionMapOutput struct{ *pulumi.OutputState }

func (FlowDefinitionMapOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*map[string]FlowDefinition)(nil))
}

func (o FlowDefinitionMapOutput) ToFlowDefinitionMapOutput() FlowDefinitionMapOutput {
	return o
}

func (o FlowDefinitionMapOutput) ToFlowDefinitionMapOutputWithContext(ctx context.Context) FlowDefinitionMapOutput {
	return o
}

func (o FlowDefinitionMapOutput) MapIndex(k pulumi.StringInput) FlowDefinitionOutput {
	return pulumi.All(o, k).ApplyT(func(vs []interface{}) FlowDefinition {
		return vs[0].(map[string]FlowDefinition)[vs[1].(string)]
	}).(FlowDefinitionOutput)
}

func init() {
	pulumi.RegisterOutputType(FlowDefinitionOutput{})
	pulumi.RegisterOutputType(FlowDefinitionPtrOutput{})
	pulumi.RegisterOutputType(FlowDefinitionArrayOutput{})
	pulumi.RegisterOutputType(FlowDefinitionMapOutput{})
}
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package sagemaker

import (
	"context"
	"reflect"

	"github.com/pkg/errors"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

// Provides a Sagemaker Flow Definition resource.
//
// ## Example Usage
// ### Basic Usage
//
// ```go
// package main
//
// import (
// 	"fmt"
//
// 	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/sagemaker"
// 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// 	pulumi.Run(func(ctx *pulumi.Context) error {
// 		_, err := sagemaker.NewFlowDefinition(ctx, "example", &sagemaker.FlowDefinitionArgs{
// 			FlowDefinitionName: pulumi.String("example"),
// 			RoleArn:            pulumi.Any(aws_iam_role.Example.Arn),
// 			HumanLoopConfig: &sagemaker.FlowDefinitionHumanLoopConfigArgs{
// 				HumanTaskUiArn:                    pulumi.Any(aws_sagemaker_human_task_ui.Example.Arn),
// 				TaskAvailabilityLifetimeInSeconds: pulumi.Int(1),
// 				TaskCount:                         pulumi.Int(1),
// 				TaskDescription:                   pulumi.String("example"),
// 				TaskTitle:                         pulumi.String("example"),
// 				WorkteamArn:                       pulumi.Any(aws_sagemaker_workteam.Example.Arn),
// 			},
// 			OutputConfig: &sagemaker.FlowDefinitionOutputConfigArgs{
// 				S3OutputPath: pulumi.String(fmt.Sprintf("%v%v%v", "s3://", aws_s3_bucket.Example.Bucket, "/")),
// 			},
// 		})
// 		if err != nil {
// 			return err
// 		}
// 		return nil
// 	})
// }
// ```
// ### Public Workteam Usage
//
// ```go
// package main
//
// import (
// 	"fmt"
//
// 	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/sagemaker"
// 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// 	pulumi.Run(func(ctx *pulumi.Context) error {
// 		_, err := sagemaker.NewFlowDefinition(ctx, "example", &sagemaker.FlowDefinitionArgs{
// 			FlowDefinitionName: pulumi.String("example"),
// 			RoleArn:            pulumi.Any(aws_iam_role.Example.Arn),
// 			HumanLoopConfig: &sagemaker.FlowDefinitionHumanLoopConfigArgs{
// 				HumanTaskUiArn:                    pulumi.Any(aws_sagemaker_human_task_ui.Example.Arn),
// 				TaskAvailabilityLifetimeInSeconds: pulumi.Int(1),
// 				TaskCount:                         pulumi.Int(1),
// 				TaskDescription:                   pulumi.String("example"),
// 				TaskTitle:                         pulumi.String("example"),
// 				WorkteamArn:                       pulumi.String(fmt.Sprintf("%v%v%v", "arn:aws:sagemaker:", data.Aws_region.Current.Name, ":394669845002:workteam/public-crowd/default")),
// 				PublicWorkforceTaskPrice: &sagemaker.FlowDefinitionHumanLoopConfigPublicWorkforceTaskPriceArgs{
// 					AmountInUsd: &sagemaker.FlowDefinitionHumanLoopConfigPublicWorkforceTaskPriceAmountInUsdArgs{
// 						Cents:                 pulumi.Int(1),
// 						TenthFractionsOfACent: pulumi.Int(2),
// 					},
// 				},
// 			},
// 			OutputConfig: &sagemaker.FlowDefinitionOutputConfigArgs{
// 				S3OutputPath: pulumi.String(fmt.Sprintf("%v%v%v", "s3://", aws_s3_bucket.Example.Bucket, "/")),
// 			},
// 		})
// 		if err != nil {
// 			return err
// 		}
// 		return nil
// 	})
// }
// ```
// ### Human Loop Activation Config Usage
//
// ```go
// package main
//
// import (
// 	"fmt"
//
// 	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/sagemaker"
// 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// 	pulumi.Run(func(ctx *pulumi.Context) error {
// 		_, err := sagemaker.NewFlowDefinition(ctx, "example", &sagemaker.FlowDefinitionArgs{
// 			FlowDefinitionName: pulumi.String("example"),
// 			RoleArn:            pulumi.Any(aws_iam_role.Example.Arn),
// 			HumanLoopConfig: &sagemaker.FlowDefinitionHumanLoopConfigArgs{
// 				HumanTaskUiArn:                    pulumi.Any(aws_sagemaker_human_task_ui.Example.Arn),
// 				TaskAvailabilityLifetimeInSeconds: pulumi.Int(1),
// 				TaskCount:                         pulumi.Int(1),
// 				TaskDescription:                   pulumi.String("example"),
// 				TaskTitle:                         pulumi.String("example"),
// 				WorkteamArn:                       pulumi.Any(aws_sagemaker_workteam.Example.Arn),
// 			},
// 			HumanLoopRequestSource: &sagemaker.FlowDefinitionHumanLoopRequestSourceArgs{
// 				AwsManagedHumanLoopRequestSource: pulumi.String("AWS/Textract/AnalyzeDocument/Forms/V1"),
// 			},
// 			HumanLoopActivationConfig: &sagemaker.FlowDefinitionHumanLoopActivationConfigArgs{
// 				HumanLoopActivationConditionsConfig: &sagemaker.FlowDefinitionHumanLoopActivationConfigHumanLoopActivationConditionsConfigArgs{
// 					HumanLoopActivationConditions: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v", "        {\n", "			\"Conditions\": [\n", "			  {\n", "				\"ConditionType\": \"Sampling\",\n", "				\"ConditionParameters\": {\n", "				  \"RandomSamplingPercentage\": 5\n", "				}\n", "			  }\n", "			]\n", "		}\n")),
// 				},
// 			},
// 			OutputConfig: &sagemaker.FlowDefinitionOutputConfigArgs{
// 				S3OutputPath: pulumi.String(fmt.Sprintf("%v%v%v", "s3://", aws_s3_bucket.Example.Bucket, "/")),
// 			},
// 		})
// 		if err != nil {
// 			return err
// 		}
// 		return nil
// 	})
// }
// ```
//
// ## Import
//
// Sagemaker Flow Definitions can be imported using the `flow_definition_name`, e.g.
//
// ```sh
//  $ pulumi import aws:sagemaker/flowDefinition:FlowDefinition example example
// ```
type FlowDefinition struct {
	pulumi.CustomResourceState

	// The Amazon Resource Name (ARN) assigned by AWS to this Flow Definition.
	Arn pulumi.StringOutput `pulumi:"arn"`
	// The name of your flow definition.
	FlowDefinitionName pulumi.StringOutput `pulumi:"flowDefinitionName"`
	// An object containing information about the events that trigger a human workflow. See Human Loop Activation Config details below.
	HumanLoopActivationConfig FlowDefinitionHumanLoopActivationConfigPtrOutput `pulumi:"humanLoopActivationConfig"`
	// An object containing information about the tasks the human reviewers will perform. See Human Loop Config details below.
	HumanLoopConfig FlowDefinitionHumanLoopConfigOutput `pulumi:"humanLoopConfig"`
	// Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source. See Human Loop Request Source details below.
	HumanLoopRequestSource FlowDefinitionHumanLoopRequestSourcePtrOutput `pulumi:"humanLoopRequestSource"`
	// An object containing information about where the human review results will be uploaded. See Output Config details below.
	OutputConfig FlowDefinitionOutputConfigOutput `pulumi:"outputConfig"`
	// The Amazon Resource Name (ARN) of the role needed to call other services on your behalf.
	RoleArn pulumi.StringOutput `pulumi:"roleArn"`
	// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
	// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}

// NewFlowDefinition registers a new resource with the given unique name, arguments, and options.
func NewFlowDefinition(ctx *pulumi.Context,
	name string, args *FlowDefinitionArgs, opts ...pulumi.ResourceOption) (*FlowDefinition, error) {
	if args == nil {
		return nil, errors.New("missing one or more required arguments")
	}

	if args.FlowDefinitionName == nil {
		return nil, errors.New("invalid value for required argument 'FlowDefinitionName'")
	}
	if args.HumanLoopConfig == nil {
		return nil, errors.New("invalid value for required argument 'HumanLoopConfig'")
	}
	if args.OutputConfig == nil {
		return nil, errors.New("invalid value for required argument 'OutputConfig'")
	}
	if args.RoleArn == nil {
		return nil, errors.New("invalid value for required argument 'RoleArn'")
	}
	var resource FlowDefinition
	err := ctx.RegisterResource("aws:sagemaker/flowDefinition:FlowDefinition", name, args, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

// GetFlowDefinition gets an existing FlowDefinition resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetFlowDefinition(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *FlowDefinitionState, opts ...pulumi.ResourceOption) (*FlowDefinition, error) {
	var resource FlowDefinition
	err := ctx.ReadResource("aws:sagemaker/flowDefinition:FlowDefinition", name, id, state, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

// Input properties used for looking up and filtering FlowDefinition resources.
type flowDefinitionState struct {
	// The Amazon Resource Name (ARN) assigned by AWS to this Flow Definition.
	Arn *string `pulumi:"arn"`
	// The name of your flow definition.
	FlowDefinitionName *string `pulumi:"flowDefinitionName"`
	// An object containing information about the events that trigger a human workflow. See Human Loop Activation Config details below.
	HumanLoopActivationConfig *FlowDefinitionHumanLoopActivationConfig `pulumi:"humanLoopActivationConfig"`
	// An object containing information about the tasks the human reviewers will perform. See Human Loop Config details below.
	HumanLoopConfig *FlowDefinitionHumanLoopConfig `pulumi:"humanLoopConfig"`
	// Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source. See Human Loop Request Source details below.
	HumanLoopRequestSource *FlowDefinitionHumanLoopRequestSource `pulumi:"humanLoopRequestSource"`
	// An object containing information about where the human review results will be uploaded. See Output Config details below.
	OutputConfig *FlowDefinitionOutputConfig `pulumi:"outputConfig"`
	// The Amazon Resource Name (ARN) of the role needed to call other services on your behalf.
	RoleArn *string `pulumi:"roleArn"`
	// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
	Tags map[string]string `pulumi:"tags"`
	// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
	TagsAll map[string]string `pulumi:"tagsAll"`
}

type FlowDefinitionState struct {
	// The Amazon Resource Name (ARN) assigned by AWS to this Flow Definition.
	Arn pulumi.StringPtrInput
	// The name of your flow definition.
	FlowDefinitionName pulumi.StringPtrInput
	// An object containing information about the events that trigger a human workflow. See Human Loop Activation Config details below.
	HumanLoopActivationConfig FlowDefinitionHumanLoopActivationConfigPtrInput
	// An object containing information about the tasks the human reviewers will perform. See Human Loop Config details below.
	HumanLoopConfig FlowDefinitionHumanLoopConfigPtrInput
	// Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source. See Human Loop Request Source details below.
	HumanLoopRequestSource FlowDefinitionHumanLoopRequestSourcePtrInput
	// An object containing information about where the human review results will be uploaded. See Output Config details below.
	OutputConfig FlowDefinitionOutputConfigPtrInput
	// The Amazon Resource Name (ARN) of the role needed to call other services on your behalf.
	RoleArn pulumi.StringPtrInput
	// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
	Tags pulumi.StringMapInput
	// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
	TagsAll pulumi.StringMapInput
}

func (FlowDefinitionState) ElementType() reflect.Type {
	return reflect.TypeOf((*flowDefinitionState)(nil)).Elem()
}

type flowDefinitionArgs struct {
	// The name of your flow definition.
	FlowDefinitionName string `pulumi:"flowDefinitionName"`
	// An object containing information about the events that trigger a human workflow. See Human Loop Activation Config details below.
	HumanLoopActivationConfig *FlowDefinitionHumanLoopActivationConfig `pulumi:"humanLoopActivationConfig"`
	// An object containing information about the tasks the human reviewers will perform. See Human Loop Config details below.
	HumanLoopConfig FlowDefinitionHumanLoopConfig `pulumi:"humanLoopConfig"`
	// Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source. See Human Loop Request Source details below.
	HumanLoopRequestSource *FlowDefinitionHumanLoopRequestSource `pulumi:"humanLoopRequestSource"`
	// An object containing information about where the human review results will be uploaded. See Output Config details below.
	OutputConfig FlowDefinitionOutputConfig `pulumi:"outputConfig"`
	// The Amazon Resource Name (ARN) of the role needed to call other services on your behalf.
	RoleArn string `pulumi:"roleArn"`
	// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
	Tags map[string]string `pulumi:"tags"`
	// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
	TagsAll map[string]string `pulumi:"tagsAll"`
}

// The set of arguments for constructing a FlowDefinition resource.
type FlowDefinitionArgs struct {
	// The name of your flow definition.
	FlowDefinitionName pulumi.StringInput
	// An object containing information about the events that trigger a human workflow. See Human Loop Activation Config details below.
	HumanLoopActivationConfig FlowDefinitionHumanLoopActivationConfigPtrInput
	// An object containing information about the tasks the human reviewers will perform. See Human Loop Config details below.
	HumanLoopConfig FlowDefinitionHumanLoopConfigInput
	// Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source. See Human Loop Request Source details below.
	HumanLoopRequestSource FlowDefinitionHumanLoopRequestSourcePtrInput
	// An object containing information about where the human review results will be uploaded. See Output Config details below.
	OutputConfig FlowDefinitionOutputConfigInput
	// The Amazon Resource Name (ARN) of the role needed to call other services on your behalf.
	RoleArn pulumi.StringInput
	// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
	Tags pulumi.StringMapInput
	// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
	TagsAll pulumi.StringMapInput
}

func (FlowDefinitionArgs) ElementType() reflect.Type {
	return reflect.TypeOf((*flowDefinitionArgs)(nil)).Elem()
}

type FlowDefinitionInput interface {
	pulumi.Input

	ToFlowDefinitionOutput() FlowDefinitionOutput
	ToFlowDefinitionOutputWithContext(ctx context.Context) FlowDefinitionOutput
}

func (*FlowDefinition) ElementType() reflect.Type {
	return reflect.TypeOf((*FlowDefinition)(nil))
}

func (i *FlowDefinition) ToFlowDefinitionOutput() FlowDefinitionOutput {
	return i.ToFlowDefinitionOutputWithContext(context.Background())
}

func (i *FlowDefinition) ToFlowDefinitionOutputWithContext(ctx context.Context) FlowDefinitionOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionOutput)
}

func (i *FlowDefinition) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return i.ToFlowDefinitionPtrOutputWithContext(context.Background())
}

func (i *FlowDefinition) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionPtrOutput)
}

type FlowDefinitionPtrInput interface {
	pulumi.Input

	ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput
	ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput
}

type flowDefinitionPtrType FlowDefinitionArgs

func (*flowDefinitionPtrType) ElementType() reflect.Type {
	return reflect.TypeOf((**FlowDefinition)(nil))
}

func (i *flowDefinitionPtrType) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return i.ToFlowDefinitionPtrOutputWithContext(context.Background())
}

func (i *flowDefinitionPtrType) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionPtrOutput)
}

// FlowDefinitionArrayInput is an input type that accepts FlowDefinitionArray and FlowDefinitionArrayOutput values.
// You can construct a concrete instance of `FlowDefinitionArrayInput` via:
//
//          FlowDefinitionArray{ FlowDefinitionArgs{...} }
type FlowDefinitionArrayInput interface {
	pulumi.Input

	ToFlowDefinitionArrayOutput() FlowDefinitionArrayOutput
	ToFlowDefinitionArrayOutputWithContext(context.Context) FlowDefinitionArrayOutput
}

type FlowDefinitionArray []FlowDefinitionInput

func (FlowDefinitionArray) ElementType() reflect.Type {
	return reflect.TypeOf((*[]*FlowDefinition)(nil)).Elem()
}

func (i FlowDefinitionArray) ToFlowDefinitionArrayOutput() FlowDefinitionArrayOutput {
	return i.ToFlowDefinitionArrayOutputWithContext(context.Background())
}

func (i FlowDefinitionArray) ToFlowDefinitionArrayOutputWithContext(ctx context.Context) FlowDefinitionArrayOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionArrayOutput)
}

// FlowDefinitionMapInput is an input type that accepts FlowDefinitionMap and FlowDefinitionMapOutput values.
// You can construct a concrete instance of `FlowDefinitionMapInput` via:
//
//          FlowDefinitionMap{ "key": FlowDefinitionArgs{...} }
type FlowDefinitionMapInput interface {
	pulumi.Input

	ToFlowDefinitionMapOutput() FlowDefinitionMapOutput
	ToFlowDefinitionMapOutputWithContext(context.Context) FlowDefinitionMapOutput
}

type FlowDefinitionMap map[string]FlowDefinitionInput

func (FlowDefinitionMap) ElementType() reflect.Type {
	return reflect.TypeOf((*map[string]*FlowDefinition)(nil)).Elem()
}

func (i FlowDefinitionMap) ToFlowDefinitionMapOutput() FlowDefinitionMapOutput {
	return i.ToFlowDefinitionMapOutputWithContext(context.Background())
}

func (i FlowDefinitionMap) ToFlowDefinitionMapOutputWithContext(ctx context.Context) FlowDefinitionMapOutput {
	return pulumi.ToOutputWithContext(ctx, i).(FlowDefinitionMapOutput)
}

type FlowDefinitionOutput struct{ *pulumi.OutputState }

func (FlowDefinitionOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*FlowDefinition)(nil))
}

func (o FlowDefinitionOutput) ToFlowDefinitionOutput() FlowDefinitionOutput {
	return o
}

func (o FlowDefinitionOutput) ToFlowDefinitionOutputWithContext(ctx context.Context) FlowDefinitionOutput {
	return o
}

func (o FlowDefinitionOutput) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return o.ToFlowDefinitionPtrOutputWithContext(context.Background())
}

func (o FlowDefinitionOutput) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return o.ApplyTWithContext(ctx, func(_ context.Context, v FlowDefinition) *FlowDefinition {
		return &v
	}).(FlowDefinitionPtrOutput)
}

type FlowDefinitionPtrOutput struct{ *pulumi.OutputState }

func (FlowDefinitionPtrOutput) ElementType() reflect.Type {
	return reflect.TypeOf((**FlowDefinition)(nil))
}

func (o FlowDefinitionPtrOutput) ToFlowDefinitionPtrOutput() FlowDefinitionPtrOutput {
	return o
}

func (o FlowDefinitionPtrOutput) ToFlowDefinitionPtrOutputWithContext(ctx context.Context) FlowDefinitionPtrOutput {
	return o
}

func (o FlowDefinitionPtrOutput) Elem() FlowDefinitionOutput {
	return o.ApplyT(func(v *FlowDefinition) FlowDefinition {
		if v != nil {
			return *v
		}
		var ret FlowDefinition
		return ret
	}).(FlowDefinitionOutput)
}

type FlowDefinitionArrayOutput struct{ *pulumi.OutputState }

func (FlowDefinitionArrayOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*[]FlowDefinition)(nil))
}

func (o FlowDefinitionArrayOutput) ToFlowDefinitionArrayOutput() FlowDefinitionArrayOutput {
	return o
}

func (o FlowDefinitionArrayOutput) ToFlowDefinitionArrayOutputWithContext(ctx context.Context) FlowDefinitionArrayOutput {
	return o
}

func (o FlowDefinitionArrayOutput) Index(i pulumi.IntInput) FlowDefinitionOutput {
	return pulumi.All(o, i).ApplyT(func(vs []interface{}) FlowDefinition {
		return vs[0].([]FlowDefinition)[vs[1].(int)]
	}).(FlowDefinitionOutput)
}

type FlowDefinitionMapOutput struct{ *pulumi.OutputState }

func (FlowDefinitionMapOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*map[string]FlowDefinition)(nil))
}

func (o FlowDefinitionMapOutput) ToFlowDefinitionMapOutput() FlowDefinitionMapOutput {
	return o
}

func (o FlowDefinitionMapOutput) ToFlowDefinitionMapOutputWithContext(ctx context.Context) FlowDefinitionMapOutput {
	return o
}

func (o FlowDefinitionMapOutput) MapIndex(k pulumi.StringInput) FlowDefinitionOutput {
	return pulumi.All(o, k).ApplyT(func(vs []interface{}) FlowDefinition {
		return vs[0].(map[string]FlowDefinition)[vs[1].(string)]
	}).(FlowDefinitionOutput)
}

func init() {
	pulumi.RegisterOutputType(FlowDefinitionOutput{})
	pulumi.RegisterOutputType(FlowDefinitionPtrOutput{})
	pulumi.RegisterOutputType(FlowDefinitionArrayOutput{})
	pulumi.RegisterOutputType(FlowDefinitionMapOutput{})
}
