class S3Location
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Tasks.S3Location |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#S3Location |
Java | software.amazon.awscdk.services.stepfunctions.tasks.S3Location |
Python | aws_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', 'amzn-s3-demo-bucket'), '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
Name | Description |
---|---|
bind(task, opts) | Called when the S3Location is bound to a StepFunctions task. |
static from | An IS3Location built with a determined bucket and key prefix. |
static from | An IS3Location determined fully by a JSON Path from the task input. |
bind(task, opts)
public bind(task: ISageMakerTask, opts: S3LocationBindOptions): S3LocationConfig
Parameters
- task
ISage
Maker Task - opts
S3
Location Bind Options
Returns
Called when the S3Location is bound to a StepFunctions task.
Bucket(bucket, keyPrefix)
static frompublic 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
An IS3Location
built with a determined bucket and key prefix.
JsonExpression(expression)
static frompublic static fromJsonExpression(expression: string): S3Location
Parameters
- expression
string
— the JSON expression resolving to an S3 location URI.
Returns
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.