package awsstepfunctionstasks import ( _init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii" _jsii_ "github.com/aws/jsii-runtime-go/runtime" "github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch" "github.com/aws/aws-cdk-go/awscdk/v2/awsiam" "github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions" "github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks/internal" "github.com/aws/constructs-go/constructs/v10" ) // A Step Functions Task to create an EMR Cluster. // // The ClusterConfiguration is defined as Parameters in the state machine definition. // // OUTPUT: the ClusterId. // // Example: // clusterRole := iam.NewRole(this, jsii.String("ClusterRole"), &RoleProps{ // AssumedBy: iam.NewServicePrincipal(jsii.String("ec2.amazonaws.com")), // }) // // serviceRole := iam.NewRole(this, jsii.String("ServiceRole"), &RoleProps{ // AssumedBy: iam.NewServicePrincipal(jsii.String("elasticmapreduce.amazonaws.com")), // }) // // autoScalingRole := iam.NewRole(this, jsii.String("AutoScalingRole"), &RoleProps{ // AssumedBy: iam.NewServicePrincipal(jsii.String("elasticmapreduce.amazonaws.com")), // }) // // autoScalingRole.AssumeRolePolicy.AddStatements( // iam.NewPolicyStatement(&PolicyStatementProps{ // Effect: iam.Effect_ALLOW, // Principals: []iPrincipal{ // iam.NewServicePrincipal(jsii.String("application-autoscaling.amazonaws.com")), // }, // Actions: []*string{ // jsii.String("sts:AssumeRole"), // }, // })) // // tasks.NewEmrCreateCluster(this, jsii.String("Create Cluster"), &EmrCreateClusterProps{ // Instances: &InstancesConfigProperty{ // }, // ClusterRole: ClusterRole, // Name: sfn.TaskInput_FromJsonPathAt(jsii.String("$.ClusterName")).value, // ServiceRole: ServiceRole, // AutoScalingRole: AutoScalingRole, // }) // type EmrCreateCluster interface { awsstepfunctions.TaskStateBase // The autoscaling role for the EMR Cluster. // // Only available after task has been added to a state machine. AutoScalingRole() awsiam.IRole Branches() *[]awsstepfunctions.StateGraph // The instance role for the EMR Cluster. // // Only available after task has been added to a state machine. ClusterRole() awsiam.IRole Comment() *string DefaultChoice() awsstepfunctions.State SetDefaultChoice(val awsstepfunctions.State) // Continuable states of this Chainable. EndStates() *[]awsstepfunctions.INextable // Descriptive identifier for this chainable. Id() *string InputPath() *string Iteration() awsstepfunctions.StateGraph SetIteration(val awsstepfunctions.StateGraph) // The tree node. Node() constructs.Node OutputPath() *string Parameters() *map[string]interface{} ResultPath() *string ResultSelector() *map[string]interface{} // The service role for the EMR Cluster. // // Only available after task has been added to a state machine. ServiceRole() awsiam.IRole // First state of this Chainable. StartState() awsstepfunctions.State // Tokenized string that evaluates to the state's ID. StateId() *string TaskMetrics() *awsstepfunctions.TaskMetricsConfig TaskPolicies() *[]awsiam.PolicyStatement // Add a paralle branch to this state. AddBranch(branch awsstepfunctions.StateGraph) // Add a recovery handler for this state. // // When a particular error occurs, execution will continue at the error // handler instead of failing the state machine execution. AddCatch(handler awsstepfunctions.IChainable, props *awsstepfunctions.CatchProps) awsstepfunctions.TaskStateBase // Add a choice branch to this state. AddChoice(condition awsstepfunctions.Condition, next awsstepfunctions.State) // Add a map iterator to this state. AddIterator(iteration awsstepfunctions.StateGraph) // Add a prefix to the stateId of this state. AddPrefix(x *string) // Add retry configuration for this state. // // This controls if and how the execution will be retried if a particular // error occurs. AddRetry(props *awsstepfunctions.RetryProps) awsstepfunctions.TaskStateBase // Register this state as part of the given graph. // // Don't call this. It will be called automatically when you work // with states normally. BindToGraph(graph awsstepfunctions.StateGraph) // Make the indicated state the default choice transition of this state. MakeDefault(def awsstepfunctions.State) // Make the indicated state the default transition of this state. MakeNext(next awsstepfunctions.State) // Return the given named metric for this Task. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of times this activity fails. MetricFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of times the heartbeat times out for this activity. MetricHeartbeatTimedOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The interval, in milliseconds, between the time the Task starts and the time it closes. MetricRunTime(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of times this activity is scheduled. MetricScheduled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The interval, in milliseconds, for which the activity stays in the schedule state. MetricScheduleTime(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of times this activity is started. MetricStarted(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of times this activity succeeds. MetricSucceeded(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The interval, in milliseconds, between the time the activity is scheduled and the time it closes. MetricTime(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of times this activity times out. MetricTimedOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Continue normal execution with the given state. Next(next awsstepfunctions.IChainable) awsstepfunctions.Chain // Render parallel branches in ASL JSON format. RenderBranches() interface{} // Render the choices in ASL JSON format. RenderChoices() interface{} // Render InputPath/Parameters/OutputPath in ASL JSON format. RenderInputOutput() interface{} // Render map iterator in ASL JSON format. RenderIterator() interface{} // Render the default next state in ASL JSON format. RenderNextEnd() interface{} // Render ResultSelector in ASL JSON format. RenderResultSelector() interface{} // Render error recovery options in ASL JSON format. RenderRetryCatch() interface{} // Return the Amazon States Language object for this state. ToStateJson() *map[string]interface{} // Returns a string representation of this construct. ToString() *string // Allows the state to validate itself. ValidateState() *[]*string // Called whenever this state is bound to a graph. // // Can be overridden by subclasses. WhenBoundToGraph(graph awsstepfunctions.StateGraph) } // The jsii proxy struct for EmrCreateCluster type jsiiProxy_EmrCreateCluster struct { internal.Type__awsstepfunctionsTaskStateBase } func (j *jsiiProxy_EmrCreateCluster) AutoScalingRole() awsiam.IRole { var returns awsiam.IRole _jsii_.Get( j, "autoScalingRole", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) Branches() *[]awsstepfunctions.StateGraph { var returns *[]awsstepfunctions.StateGraph _jsii_.Get( j, "branches", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) ClusterRole() awsiam.IRole { var returns awsiam.IRole _jsii_.Get( j, "clusterRole", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) Comment() *string { var returns *string _jsii_.Get( j, "comment", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) DefaultChoice() awsstepfunctions.State { var returns awsstepfunctions.State _jsii_.Get( j, "defaultChoice", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) EndStates() *[]awsstepfunctions.INextable { var returns *[]awsstepfunctions.INextable _jsii_.Get( j, "endStates", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) Id() *string { var returns *string _jsii_.Get( j, "id", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) InputPath() *string { var returns *string _jsii_.Get( j, "inputPath", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) Iteration() awsstepfunctions.StateGraph { var returns awsstepfunctions.StateGraph _jsii_.Get( j, "iteration", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) Node() constructs.Node { var returns constructs.Node _jsii_.Get( j, "node", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) OutputPath() *string { var returns *string _jsii_.Get( j, "outputPath", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) Parameters() *map[string]interface{} { var returns *map[string]interface{} _jsii_.Get( j, "parameters", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) ResultPath() *string { var returns *string _jsii_.Get( j, "resultPath", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) ResultSelector() *map[string]interface{} { var returns *map[string]interface{} _jsii_.Get( j, "resultSelector", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) ServiceRole() awsiam.IRole { var returns awsiam.IRole _jsii_.Get( j, "serviceRole", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) StartState() awsstepfunctions.State { var returns awsstepfunctions.State _jsii_.Get( j, "startState", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) StateId() *string { var returns *string _jsii_.Get( j, "stateId", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) TaskMetrics() *awsstepfunctions.TaskMetricsConfig { var returns *awsstepfunctions.TaskMetricsConfig _jsii_.Get( j, "taskMetrics", &returns, ) return returns } func (j *jsiiProxy_EmrCreateCluster) TaskPolicies() *[]awsiam.PolicyStatement { var returns *[]awsiam.PolicyStatement _jsii_.Get( j, "taskPolicies", &returns, ) return returns } func NewEmrCreateCluster(scope constructs.Construct, id *string, props *EmrCreateClusterProps) EmrCreateCluster { _init_.Initialize() if err := validateNewEmrCreateClusterParameters(scope, id, props); err != nil { panic(err) } j := jsiiProxy_EmrCreateCluster{} _jsii_.Create( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", []interface{}{scope, id, props}, &j, ) return &j } func NewEmrCreateCluster_Override(e EmrCreateCluster, scope constructs.Construct, id *string, props *EmrCreateClusterProps) { _init_.Initialize() _jsii_.Create( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", []interface{}{scope, id, props}, e, ) } func (j *jsiiProxy_EmrCreateCluster)SetDefaultChoice(val awsstepfunctions.State) { _jsii_.Set( j, "defaultChoice", val, ) } func (j *jsiiProxy_EmrCreateCluster)SetIteration(val awsstepfunctions.StateGraph) { _jsii_.Set( j, "iteration", val, ) } // Return only the states that allow chaining from an array of states. func EmrCreateCluster_FilterNextables(states *[]awsstepfunctions.State) *[]awsstepfunctions.INextable { _init_.Initialize() if err := validateEmrCreateCluster_FilterNextablesParameters(states); err != nil { panic(err) } var returns *[]awsstepfunctions.INextable _jsii_.StaticInvoke( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", "filterNextables", []interface{}{states}, &returns, ) return returns } // Find the set of end states states reachable through transitions from the given start state. func EmrCreateCluster_FindReachableEndStates(start awsstepfunctions.State, options *awsstepfunctions.FindStateOptions) *[]awsstepfunctions.State { _init_.Initialize() if err := validateEmrCreateCluster_FindReachableEndStatesParameters(start, options); err != nil { panic(err) } var returns *[]awsstepfunctions.State _jsii_.StaticInvoke( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", "findReachableEndStates", []interface{}{start, options}, &returns, ) return returns } // Find the set of states reachable through transitions from the given start state. // // This does not retrieve states from within sub-graphs, such as states within a Parallel state's branch. func EmrCreateCluster_FindReachableStates(start awsstepfunctions.State, options *awsstepfunctions.FindStateOptions) *[]awsstepfunctions.State { _init_.Initialize() if err := validateEmrCreateCluster_FindReachableStatesParameters(start, options); err != nil { panic(err) } var returns *[]awsstepfunctions.State _jsii_.StaticInvoke( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", "findReachableStates", []interface{}{start, options}, &returns, ) return returns } // Checks if `x` is a construct. // // Use this method instead of `instanceof` to properly detect `Construct` // instances, even when the construct library is symlinked. // // Explanation: in JavaScript, multiple copies of the `constructs` library on // disk are seen as independent, completely different libraries. As a // consequence, the class `Construct` in each copy of the `constructs` library // is seen as a different class, and an instance of one class will not test as // `instanceof` the other class. `npm install` will not create installations // like this, but users may manually symlink construct libraries together or // use a monorepo tool: in those cases, multiple copies of the `constructs` // library can be accidentally installed, and `instanceof` will behave // unpredictably. It is safest to avoid using `instanceof`, and using // this type-testing method instead. // // Returns: true if `x` is an object created from a class which extends `Construct`. func EmrCreateCluster_IsConstruct(x interface{}) *bool { _init_.Initialize() if err := validateEmrCreateCluster_IsConstructParameters(x); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", "isConstruct", []interface{}{x}, &returns, ) return returns } // Add a prefix to the stateId of all States found in a construct tree. func EmrCreateCluster_PrefixStates(root constructs.IConstruct, prefix *string) { _init_.Initialize() if err := validateEmrCreateCluster_PrefixStatesParameters(root, prefix); err != nil { panic(err) } _jsii_.StaticInvokeVoid( "aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster", "prefixStates", []interface{}{root, prefix}, ) } func (e *jsiiProxy_EmrCreateCluster) AddBranch(branch awsstepfunctions.StateGraph) { if err := e.validateAddBranchParameters(branch); err != nil { panic(err) } _jsii_.InvokeVoid( e, "addBranch", []interface{}{branch}, ) } func (e *jsiiProxy_EmrCreateCluster) AddCatch(handler awsstepfunctions.IChainable, props *awsstepfunctions.CatchProps) awsstepfunctions.TaskStateBase { if err := e.validateAddCatchParameters(handler, props); err != nil { panic(err) } var returns awsstepfunctions.TaskStateBase _jsii_.Invoke( e, "addCatch", []interface{}{handler, props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) AddChoice(condition awsstepfunctions.Condition, next awsstepfunctions.State) { if err := e.validateAddChoiceParameters(condition, next); err != nil { panic(err) } _jsii_.InvokeVoid( e, "addChoice", []interface{}{condition, next}, ) } func (e *jsiiProxy_EmrCreateCluster) AddIterator(iteration awsstepfunctions.StateGraph) { if err := e.validateAddIteratorParameters(iteration); err != nil { panic(err) } _jsii_.InvokeVoid( e, "addIterator", []interface{}{iteration}, ) } func (e *jsiiProxy_EmrCreateCluster) AddPrefix(x *string) { if err := e.validateAddPrefixParameters(x); err != nil { panic(err) } _jsii_.InvokeVoid( e, "addPrefix", []interface{}{x}, ) } func (e *jsiiProxy_EmrCreateCluster) AddRetry(props *awsstepfunctions.RetryProps) awsstepfunctions.TaskStateBase { if err := e.validateAddRetryParameters(props); err != nil { panic(err) } var returns awsstepfunctions.TaskStateBase _jsii_.Invoke( e, "addRetry", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) BindToGraph(graph awsstepfunctions.StateGraph) { if err := e.validateBindToGraphParameters(graph); err != nil { panic(err) } _jsii_.InvokeVoid( e, "bindToGraph", []interface{}{graph}, ) } func (e *jsiiProxy_EmrCreateCluster) MakeDefault(def awsstepfunctions.State) { if err := e.validateMakeDefaultParameters(def); err != nil { panic(err) } _jsii_.InvokeVoid( e, "makeDefault", []interface{}{def}, ) } func (e *jsiiProxy_EmrCreateCluster) MakeNext(next awsstepfunctions.State) { if err := e.validateMakeNextParameters(next); err != nil { panic(err) } _jsii_.InvokeVoid( e, "makeNext", []interface{}{next}, ) } func (e *jsiiProxy_EmrCreateCluster) Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricParameters(metricName, props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metric", []interface{}{metricName, props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricFailedParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricFailed", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricHeartbeatTimedOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricHeartbeatTimedOutParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricHeartbeatTimedOut", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricRunTime(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricRunTimeParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricRunTime", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricScheduled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricScheduledParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricScheduled", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricScheduleTime(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricScheduleTimeParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricScheduleTime", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricStarted(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricStartedParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricStarted", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricSucceeded(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricSucceededParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricSucceeded", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricTime(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricTimeParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricTime", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) MetricTimedOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := e.validateMetricTimedOutParameters(props); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( e, "metricTimedOut", []interface{}{props}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) Next(next awsstepfunctions.IChainable) awsstepfunctions.Chain { if err := e.validateNextParameters(next); err != nil { panic(err) } var returns awsstepfunctions.Chain _jsii_.Invoke( e, "next", []interface{}{next}, &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderBranches() interface{} { var returns interface{} _jsii_.Invoke( e, "renderBranches", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderChoices() interface{} { var returns interface{} _jsii_.Invoke( e, "renderChoices", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderInputOutput() interface{} { var returns interface{} _jsii_.Invoke( e, "renderInputOutput", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderIterator() interface{} { var returns interface{} _jsii_.Invoke( e, "renderIterator", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderNextEnd() interface{} { var returns interface{} _jsii_.Invoke( e, "renderNextEnd", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderResultSelector() interface{} { var returns interface{} _jsii_.Invoke( e, "renderResultSelector", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) RenderRetryCatch() interface{} { var returns interface{} _jsii_.Invoke( e, "renderRetryCatch", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) ToStateJson() *map[string]interface{} { var returns *map[string]interface{} _jsii_.Invoke( e, "toStateJson", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) ToString() *string { var returns *string _jsii_.Invoke( e, "toString", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) ValidateState() *[]*string { var returns *[]*string _jsii_.Invoke( e, "validateState", nil, // no parameters &returns, ) return returns } func (e *jsiiProxy_EmrCreateCluster) WhenBoundToGraph(graph awsstepfunctions.StateGraph) { if err := e.validateWhenBoundToGraphParameters(graph); err != nil { panic(err) } _jsii_.InvokeVoid( e, "whenBoundToGraph", []interface{}{graph}, ) }