aws-cdk-lib.aws_stepfunctions_tasks.S3Location

class S3Location

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.Tasks.S3Location
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#S3Location
Javasoftware.amazon.awscdk.services.stepfunctions.tasks.S3Location
Pythonaws_cdk.aws_stepfunctions_tasks.S3Location
TypeScript (source)aws-cdk-lib » aws_stepfunctions_tasks » S3Location

Constructs IS3Location objects.

Example

new tasks.SageMakerCreateTrainingJob(this, 'TrainSagemaker', {
  trainingJobName: sfn.JsonPath.stringAt('$.JobName'),
  algorithmSpecification: {
    algorithmName: 'BlazingText',
    trainingInputMode: tasks.InputMode.FILE,
  },
  inputDataConfig: [{
    channelName: 'train',
    dataSource: {
      s3DataSource: {
        s3DataType: tasks.S3DataType.S3_PREFIX,
        s3Location: tasks.S3Location.fromJsonExpression('$.S3Bucket'),
      },
    },
  }],
  outputDataConfig: {
    s3OutputLocation: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(this, 'Bucket', 'mybucket'), 'myoutputpath'),
  },
  resourceConfig: {
    instanceCount: 1,
    instanceType: new ec2.InstanceType(sfn.JsonPath.stringAt('$.InstanceType')),
    volumeSize: Size.gibibytes(50),
  }, // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
  stoppingCondition: {
    maxRuntime: Duration.hours(2),
  }, // optional: default is 1 hour
});

Initializer

new S3Location()

Methods

NameDescription
bind(task, opts)Called when the S3Location is bound to a StepFunctions task.
static fromBucket(bucket, keyPrefix)An IS3Location built with a determined bucket and key prefix.
static fromJsonExpression(expression)An IS3Location determined fully by a JSON Path from the task input.

bind(task, opts)

public bind(task: ISageMakerTask, opts: S3LocationBindOptions): S3LocationConfig

Parameters

  • task ISageMakerTask
  • opts S3LocationBindOptions

Returns

  • S3LocationConfig

Called when the S3Location is bound to a StepFunctions task.


static fromBucket(bucket, keyPrefix)

public static fromBucket(bucket: IBucket, keyPrefix: string): S3Location

Parameters

  • bucket IBucket — is the bucket where the objects are to be stored.
  • keyPrefix string — is the key prefix used by the location.

Returns

  • S3Location

An IS3Location built with a determined bucket and key prefix.


static fromJsonExpression(expression)

public static fromJsonExpression(expression: string): S3Location

Parameters

  • expression string — the JSON expression resolving to an S3 location URI.

Returns

  • S3Location

An IS3Location determined fully by a JSON Path from the task input.

Due to the dynamic nature of those locations, the IAM grants that will be set by grantRead and grantWrite apply to the * resource.