Skip to content
v2.274.0

BedrockCreateModelCustomizationJob ​

A Step Functions Task to create model customization in Bedrock.

Example ​

ts
import * as bedrock from 'aws-cdk-lib/aws-bedrock';
import * as kms from 'aws-cdk-lib/aws-kms';

declare const outputBucket: s3.IBucket;
declare const trainingBucket: s3.IBucket;
declare const validationBucket: s3.IBucket;
declare const kmsKey: kms.IKey;
declare const vpc: ec2.IVpc;

const model = bedrock.FoundationModel.fromFoundationModelId(
  this,
  'Model',
  bedrock.FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1,
);

const task = new tasks.BedrockCreateModelCustomizationJob(this, 'CreateModelCustomizationJob', {
  baseModel: model,
  clientRequestToken: 'MyToken',
  customizationType: tasks.CustomizationType.FINE_TUNING,
  customModelKmsKey: kmsKey,
  customModelName: 'MyCustomModel', // required
  customModelTags: [{ key: 'key1', value: 'value1' }],
  hyperParameters: {
    batchSize: '10',
  },
  jobName: 'MyCustomizationJob', // required
  jobTags: [{ key: 'key2', value: 'value2' }],
  outputData: {
    bucket: outputBucket, // required
    path: 'output-data/',
  },
  trainingData: {
    bucket: trainingBucket,
    path: 'training-data/data.json',
  }, // required
  // If you don't provide validation data, you have to specify `Evaluation percentage` hyperparameter.
  validationData: [
    {
      bucket: validationBucket,
      path: 'validation-data/data.json',
    },
  ],
  vpcConfig: {
    securityGroups: [new ec2.SecurityGroup(this, 'SecurityGroup', { vpc })],
    subnets: vpc.privateSubnets,
  },
});
python
import aws_cdk.aws_bedrock as bedrock
import aws_cdk.aws_kms as kms

# output_bucket: s3.IBucket
# training_bucket: s3.IBucket
# validation_bucket: s3.IBucket
# kms_key: kms.IKey
# vpc: ec2.IVpc


model = bedrock.FoundationModel.from_foundation_model_id(self, "Model", bedrock.FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1)

task = tasks.BedrockCreateModelCustomizationJob(self, "CreateModelCustomizationJob",
    base_model=model,
    client_request_token="MyToken",
    customization_type=tasks.CustomizationType.FINE_TUNING,
    custom_model_kms_key=kms_key,
    custom_model_name="MyCustomModel",  # required
    custom_model_tags=[tasks.CustomModelTag(key="key1", value="value1")],
    hyper_parameters={
        "batch_size": "10"
    },
    job_name="MyCustomizationJob",  # required
    job_tags=[tasks.CustomModelTag(key="key2", value="value2")],
    output_data=tasks.OutputBucketConfiguration(
        bucket=output_bucket,  # required
        path="output-data/"
    ),
    training_data=tasks.TrainingBucketConfiguration(
        bucket=training_bucket,
        path="training-data/data.json"
    ),  # required
    # If you don't provide validation data, you have to specify `Evaluation percentage` hyperparameter.
    validation_data=[tasks.ValidationBucketConfiguration(
        bucket=validation_bucket,
        path="validation-data/data.json"
    )
    ],
    vpc_config={
        "security_groups": [ec2.SecurityGroup(self, "SecurityGroup", vpc=vpc)],
        "subnets": vpc.private_subnets
    }
)
java
import software.amazon.awscdk.services.bedrock.*;
import software.amazon.awscdk.services.kms.*;

IBucket outputBucket;
IBucket trainingBucket;
IBucket validationBucket;
IKey kmsKey;
IVpc vpc;


FoundationModel model = FoundationModel.fromFoundationModelId(this, "Model", FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1);

BedrockCreateModelCustomizationJob task = BedrockCreateModelCustomizationJob.Builder.create(this, "CreateModelCustomizationJob")
        .baseModel(model)
        .clientRequestToken("MyToken")
        .customizationType(CustomizationType.FINE_TUNING)
        .customModelKmsKey(kmsKey)
        .customModelName("MyCustomModel") // required
        .customModelTags(List.of(CustomModelTag.builder().key("key1").value("value1").build()))
        .hyperParameters(Map.of(
                "batchSize", "10"))
        .jobName("MyCustomizationJob") // required
        .jobTags(List.of(CustomModelTag.builder().key("key2").value("value2").build()))
        .outputData(OutputBucketConfiguration.builder()
                .bucket(outputBucket) // required
                .path("output-data/")
                .build())
        .trainingData(TrainingBucketConfiguration.builder()
                .bucket(trainingBucket)
                .path("training-data/data.json")
                .build()) // required
        // If you don't provide validation data, you have to specify `Evaluation percentage` hyperparameter.
        .validationData(List.of(ValidationBucketConfiguration.builder()
                .bucket(validationBucket)
                .path("validation-data/data.json")
                .build()))
        .vpcConfig(Map.of(
                "securityGroups", List.of(SecurityGroup.Builder.create(this, "SecurityGroup").vpc(vpc).build()),
                "subnets", vpc.getPrivateSubnets()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Bedrock;
using Amazon.CDK.AWS.KMS;

IBucket outputBucket;
IBucket trainingBucket;
IBucket validationBucket;
IKey kmsKey;
IVpc vpc;


var model = FoundationModel.FromFoundationModelId(this, "Model", FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1);

var task = new BedrockCreateModelCustomizationJob(this, "CreateModelCustomizationJob", new BedrockCreateModelCustomizationJobProps {
    BaseModel = model,
    ClientRequestToken = "MyToken",
    CustomizationType = CustomizationType.FINE_TUNING,
    CustomModelKmsKey = kmsKey,
    CustomModelName = "MyCustomModel",  // required
    CustomModelTags = new [] { new CustomModelTag { Key = "key1", Value = "value1" } },
    HyperParameters = new Dictionary<string, string> {
        { "batchSize", "10" }
    },
    JobName = "MyCustomizationJob",  // required
    JobTags = new [] { new CustomModelTag { Key = "key2", Value = "value2" } },
    OutputData = new OutputBucketConfiguration {
        Bucket = outputBucket,  // required
        Path = "output-data/"
    },
    TrainingData = new TrainingBucketConfiguration {
        Bucket = trainingBucket,
        Path = "training-data/data.json"
    },  // required
    // If you don't provide validation data, you have to specify `Evaluation percentage` hyperparameter.
    ValidationData = new [] { new ValidationBucketConfiguration {
        Bucket = validationBucket,
        Path = "validation-data/data.json"
    } },
    VpcConfig = new Dictionary<string, ISecurityGroup[]> {
        { "securityGroups", new [] { new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps { Vpc = vpc }) } },
        { "subnets", vpc.PrivateSubnets }
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"
import kms "github.com/aws/aws-cdk-go/awscdk"

var outputBucket IBucket
var trainingBucket IBucket
var validationBucket IBucket
var kmsKey IKey
var vpc IVpc


model := bedrock.FoundationModel_FromFoundationModelId(this, jsii.String("Model"), bedrock.FoundationModelIdentifier_AMAZON_TITAN_TEXT_G1_EXPRESS_V1())

task := tasks.NewBedrockCreateModelCustomizationJob(this, jsii.String("CreateModelCustomizationJob"), &BedrockCreateModelCustomizationJobProps{
	BaseModel: model,
	ClientRequestToken: jsii.String("MyToken"),
	CustomizationType: tasks.CustomizationType_FINE_TUNING,
	CustomModelKmsKey: kmsKey,
	CustomModelName: jsii.String("MyCustomModel"),
	 // required
	CustomModelTags: []CustomModelTag{
		&CustomModelTag{
			Key: jsii.String("key1"),
			Value: jsii.String("value1"),
		},
	},
	HyperParameters: map[string]*string{
		"batchSize": jsii.String("10"),
	},
	JobName: jsii.String("MyCustomizationJob"),
	 // required
	JobTags: []CustomModelTag{
		&CustomModelTag{
			Key: jsii.String("key2"),
			Value: jsii.String("value2"),
		},
	},
	OutputData: &OutputBucketConfiguration{
		Bucket: outputBucket,
		 // required
		Path: jsii.String("output-data/"),
	},
	TrainingData: &TrainingBucketConfiguration{
		Bucket: trainingBucket,
		Path: jsii.String("training-data/data.json"),
	},
	 // required
	// If you don't provide validation data, you have to specify `Evaluation percentage` hyperparameter.
	ValidationData: []ValidationBucketConfiguration{
		&ValidationBucketConfiguration{
			Bucket: validationBucket,
			Path: jsii.String("validation-data/data.json"),
		},
	},
	VpcConfig: map[string][]ISecurityGroup{
		"securityGroups": []ISecurityGroup{
			ec2.NewSecurityGroup(this, jsii.String("SecurityGroup"), &SecurityGroupProps{
				"vpc": vpc,
			}),
		},
		"subnets": vpc.privateSubnets,
	},
})

Initializer ​

ts
new BedrockCreateModelCustomizationJob(scope: Construct, id: string, props: BedrockCreateModelCustomizationJobProps)
python
BedrockCreateModelCustomizationJob(scope: Construct, id: str, props: BedrockCreateModelCustomizationJobProps)
java
new BedrockCreateModelCustomizationJob(Construct scope, String id, BedrockCreateModelCustomizationJobProps props)
csharp
new BedrockCreateModelCustomizationJob(Construct scope, string id, BedrockCreateModelCustomizationJobProps props)
go
NewBedrockCreateModelCustomizationJob(Scope Construct, Id *string, Props BedrockCreateModelCustomizationJobProps)

Construct Props ​

assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{}#
Workflow variables to store in this step.

Default: Not assign variables

Using workflow variables, you can store data in a step and retrieve that data in future steps.

baseModelIModelbase_modelIModelbaseModelIModelBaseModelIModelBaseModelIModelrequired#
The base model.
clientRequestTokenoptionalstringclient_request_tokenoptionalstrclientRequestTokenoptionalStringClientRequestTokenoptionalstringClientRequestTokenoptional*string#
A unique, case-sensitive identifier to ensure that the API request completes no more than one time.

Default: no client request token

If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.

The maximum length is 256 characters.

commentoptionalstringcommentoptionalstrcommentoptionalStringCommentoptionalstringCommentoptional*string#
A comment describing this state.

Default: No comment

credentialsoptionalCredentialscredentialsoptionalCredentialscredentialsoptionalCredentialsCredentialsoptionalCredentialsCredentialsoptionalCredentials#
Credentials for an IAM Role that the State Machine assumes for executing the task.

Default: None (Task is executed using the State Machine's execution role)

This enables cross-account resource invocations.

customizationTypeoptionalCustomizationTypecustomization_typeoptionalCustomizationTypecustomizationTypeoptionalCustomizationTypeCustomizationTypeoptionalCustomizationTypeCustomizationTypeoptionalCustomizationType= FINE_TUNING#
The customization type.
customModelKmsKeyoptionalIKeycustom_model_kms_keyoptionalIKeycustomModelKmsKeyoptionalIKeyCustomModelKmsKeyoptionalIKeyCustomModelKmsKeyoptionalIKey#
The custom model is encrypted at rest using this key.

Default: encrypted with the AWS owned key

customModelNamestringcustom_model_namestrcustomModelNameStringCustomModelNamestringCustomModelName*stringrequired#
A name for the resulting custom model.

The maximum length is 63 characters.

customModelTagsoptionalCustomModelTag[]custom_model_tagsoptionaltyping.List[CustomModelTag]customModelTagsoptionalList<CustomModelTag>CustomModelTagsoptionalCustomModelTag[]CustomModelTagsoptional*[]CustomModelTag#
Tags to attach to the resulting custom model.

Default: no tags

The maximum number of tags is 200.

heartbeatoptionalDurationheartbeatoptionalDurationheartbeatoptionalDurationHeartbeatoptionalDurationHeartbeatoptionalDuration= Nonedeprecated#
use `heartbeatTimeout`
heartbeatTimeoutoptionalTimeoutheartbeat_timeoutoptionalTimeoutheartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeout= None#
Timeout for the heartbeat.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

hyperParametersoptional{ [key: string]: string }hyper_parametersoptionaltyping.Mapping[str, str]hyperParametersoptionalMap<String, String>HyperParametersoptionalIDictionary<string, string>HyperParametersoptional*map[string]*string#
Parameters related to tuning the model.

Default: use default hyperparameters

inputPathoptionalstringinput_pathoptionalstrinputPathoptionalStringInputPathoptionalstringInputPathoptional*string= $#
JSONPath expression to select part of the state to be the input to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.

integrationPatternoptionalIntegrationPatternintegration_patternoptionalIntegrationPatternintegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPattern#
AWS Step Functions integrates with services directly in the Amazon States Language.

Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.

You can control these AWS services using service integration patterns.

Depending on the AWS Service, the Service Integration Pattern availability will vary.

jobNamestringjob_namestrjobNameStringJobNamestringJobName*stringrequired#
A name for the fine-tuning job.

The maximum length is 63 characters.

jobTagsoptionalCustomModelTag[]job_tagsoptionaltyping.List[CustomModelTag]jobTagsoptionalList<CustomModelTag>JobTagsoptionalCustomModelTag[]JobTagsoptional*[]CustomModelTag#
Tags to attach to the job.

Default: no tags

The maximum number of tags is 200.

The S3 bucket configuration where the output data is stored.
outputPathoptionalstringoutput_pathoptionalstroutputPathoptionalStringOutputPathoptionalstringOutputPathoptional*string= $#
JSONPath expression to select part of the state to be the output to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.

outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{}#
Used to specify and transform output from the state.

Default: $states.result or $states.errorOutput

notes

When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.

queryLanguageoptionalQueryLanguagequery_languageoptionalQueryLanguagequeryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguage= JSONPath#
The name of the query language used by the state.

If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.

resultPathoptionalstringresult_pathoptionalstrresultPathoptionalStringResultPathoptionalstringResultPathoptional*string= $#
JSONPath expression to indicate where to inject the state's output.

May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.

resultSelectoroptional{ [key: string]: any }result_selectoroptionaltyping.Mapping[str, Any]resultSelectoroptionalMap<String, Object>ResultSelectoroptionalIDictionary<string, object>ResultSelectoroptional*map[string]interface{}= None#
The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.

You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.

roleoptionalIRoleRefroleoptionalIRoleRefroleoptionalIRoleRefRoleoptionalIRoleRefRoleoptionalIRoleRef#
The IAM role that Amazon Bedrock can assume to perform tasks on your behalf.

Default: use auto generated role

notes

For example, during model training, Amazon Bedrock needs your permission to read input data from an S3 bucket, write model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the caller of this API must have the iam:PassRole permission.

stateNameoptionalstringstate_nameoptionalstrstateNameoptionalStringStateNameoptionalstringStateNameoptional*string#
Optional name for this state.

Default: The construct ID will be used as state name

taskTimeoutoptionalTimeouttask_timeoutoptionalTimeouttaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeout= None#
Timeout for the task.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration= Nonedeprecated#
use `taskTimeout`
The S3 bucket configuration where the training data is stored.
validationDataoptionalValidationBucketConfiguration[]validation_dataoptionaltyping.List[ValidationBucketConfiguration]validationDataoptionalList<ValidationBucketConfiguration>ValidationDataoptionalValidationBucketConfiguration[]ValidationDataoptional*[]ValidationBucketConfiguration#
The S3 bucket configuration where the validation data is stored.

Default: undefined - validate using a subset of the training data

If you don't provide a validation dataset, specify the evaluation percentage by the Evaluation percentage hyperparameter.

The maximum number is 10.

Properties ​

endStatesINextable[]end_statestyping.List[INextable]endStatesList<INextable>EndStatesINextable[]EndStates*[]INextablerequired#
Continuable states of this Chainable.
idstringidstridStringIdstringId*stringrequired#
Descriptive identifier for this chainable.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
roleIRoleroleIRoleroleIRoleRoleIRoleRoleIRolerequired#
The IAM role for the bedrock create model customization job.
startStateStatestart_stateStatestartStateStateStartStateStateStartStateStaterequired#
First state of this Chainable.
stateIdstringstate_idstrstateIdStringStateIdstringStateId*stringrequired#
Tokenized string that evaluates to the state's ID.

Methods ​

addCatch(handler: IChainable, props?: CatchProps): TaskStateBasedef add_catch(self, handler: IChainable, props: typing.Optional[CatchProps] = None) -> TaskStateBasepublic TaskStateBase addCatch(IChainable handler, CatchProps props)public TaskStateBase AddCatch(IChainable handler, CatchProps? props = null)func AddCatch(Handler IChainable, Props CatchProps) TaskStateBase#
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.

addPrefix(x: string): voiddef add_prefix(self, x: str) -> Nonepublic void addPrefix(String x)public void AddPrefix(string x)func AddPrefix(X *string)#
Add a prefix to the stateId of this state.
addRetry(props?: RetryProps): TaskStateBasedef add_retry(self, props: typing.Optional[RetryProps] = None) -> TaskStateBasepublic TaskStateBase addRetry(RetryProps props)public TaskStateBase AddRetry(RetryProps? props = null)func AddRetry(Props RetryProps) TaskStateBase#
Add retry configuration for this state.

This controls if and how the execution will be retried if a particular error occurs.

bindToGraph(graph: StateGraph): voiddef bind_to_graph(self, graph: StateGraph) -> Nonepublic void bindToGraph(StateGraph graph)public void BindToGraph(StateGraph graph)func BindToGraph(Graph StateGraph)#
Register this state as part of the given graph.

Don't call this. It will be called automatically when you work with states normally.

filterNextables(states: State[]): INextable[]@staticmethod def filter_nextables(states: typing.List[State]) -> typing.List[INextable]public static List<INextable> filterNextables(List<State> states)public static INextable[] FilterNextables(State[] states)func FilterNextables(States *[]State) *[]INextablestatic#
Return only the states that allow chaining from an array of states.
findReachableEndStates(start: State, options?: FindStateOptions): State[]@staticmethod def find_reachable_end_states(start: State, options: typing.Optional[FindStateOptions] = None) -> typing.List[State]public static List<State> findReachableEndStates(State start, FindStateOptions options)public static State[] FindReachableEndStates(State start, FindStateOptions? options = null)func FindReachableEndStates(Start State, Options FindStateOptions) *[]Statestatic#
Find the set of end states states reachable through transitions from the given start state.
findReachableStates(start: State, options?: FindStateOptions): State[]@staticmethod def find_reachable_states(start: State, options: typing.Optional[FindStateOptions] = None) -> typing.List[State]public static List<State> findReachableStates(State start, FindStateOptions options)public static State[] FindReachableStates(State start, FindStateOptions? options = null)func FindReachableStates(Start State, Options FindStateOptions) *[]Statestatic#
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.

isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

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.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return the given named metric for this Task.
metricFailed(props?: MetricOptions): Metricdef metric_failed(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFailed(MetricOptions props)public Metric MetricFailed(MetricOptions? props = null)func MetricFailed(Props MetricOptions) Metric#
Metric for the number of times this activity fails.
metricHeartbeatTimedOut(props?: MetricOptions): Metricdef metric_heartbeat_timed_out(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricHeartbeatTimedOut(MetricOptions props)public Metric MetricHeartbeatTimedOut(MetricOptions? props = null)func MetricHeartbeatTimedOut(Props MetricOptions) Metric#
Metric for the number of times the heartbeat times out for this activity.
metricRunTime(props?: MetricOptions): Metricdef metric_run_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricRunTime(MetricOptions props)public Metric MetricRunTime(MetricOptions? props = null)func MetricRunTime(Props MetricOptions) Metric#
The interval, in milliseconds, between the time the Task starts and the time it closes.
metricScheduled(props?: MetricOptions): Metricdef metric_scheduled(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricScheduled(MetricOptions props)public Metric MetricScheduled(MetricOptions? props = null)func MetricScheduled(Props MetricOptions) Metric#
Metric for the number of times this activity is scheduled.
metricScheduleTime(props?: MetricOptions): Metricdef metric_schedule_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricScheduleTime(MetricOptions props)public Metric MetricScheduleTime(MetricOptions? props = null)func MetricScheduleTime(Props MetricOptions) Metric#
The interval, in milliseconds, for which the activity stays in the schedule state.
metricStarted(props?: MetricOptions): Metricdef metric_started(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricStarted(MetricOptions props)public Metric MetricStarted(MetricOptions? props = null)func MetricStarted(Props MetricOptions) Metric#
Metric for the number of times this activity is started.
metricSucceeded(props?: MetricOptions): Metricdef metric_succeeded(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSucceeded(MetricOptions props)public Metric MetricSucceeded(MetricOptions? props = null)func MetricSucceeded(Props MetricOptions) Metric#
Metric for the number of times this activity succeeds.
metricTime(props?: MetricOptions): Metricdef metric_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricTime(MetricOptions props)public Metric MetricTime(MetricOptions? props = null)func MetricTime(Props MetricOptions) Metric#
The interval, in milliseconds, between the time the activity is scheduled and the time it closes.
metricTimedOut(props?: MetricOptions): Metricdef metric_timed_out(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricTimedOut(MetricOptions props)public Metric MetricTimedOut(MetricOptions? props = null)func MetricTimedOut(Props MetricOptions) Metric#
Metric for the number of times this activity times out.
prefixStates(root: IConstruct, prefix: string): void@staticmethod def prefix_states(root: IConstruct, prefix: str) -> Nonepublic static void prefixStates(IConstruct root, String prefix)public static void PrefixStates(IConstruct root, string prefix)func PrefixStates(Root IConstruct, Prefix *string)static#
Add a prefix to the stateId of all States found in a construct tree.
toStateJson(topLevelQueryLanguage?: QueryLanguage): jsondef to_state_json(self, top_level_query_language: typing.Optional[QueryLanguage] = None) -> Anypublic Object toStateJson(QueryLanguage topLevelQueryLanguage)public object ToStateJson(QueryLanguage? topLevelQueryLanguage = null)func ToStateJson(TopLevelQueryLanguage QueryLanguage) interface{}#
Return the Amazon States Language object for this state.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining