Show / Hide Table of Contents

Class S3Location

Constructs IS3Location objects.

Inheritance
object
S3Location
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class S3Location : DeputyBase
Syntax (vb)
Public MustInherit Class S3Location Inherits DeputyBase
Remarks

ExampleMetadata: infused

Examples
new SageMakerCreateTrainingJob(this, "TrainSagemaker", new SageMakerCreateTrainingJobProps {
                TrainingJobName = JsonPath.StringAt("$.JobName"),
                AlgorithmSpecification = new AlgorithmSpecification {
                    AlgorithmName = "BlazingText",
                    TrainingInputMode = InputMode.FILE
                },
                InputDataConfig = new [] { new Channel {
                    ChannelName = "train",
                    DataSource = new DataSource {
                        S3DataSource = new S3DataSource {
                            S3DataType = S3DataType.S3_PREFIX,
                            S3Location = S3Location.FromJsonExpression("$.S3Bucket")
                        }
                    }
                } },
                OutputDataConfig = new OutputDataConfig {
                    S3OutputLocation = S3Location.FromBucket(Bucket.FromBucketName(this, "Bucket", "amzn-s3-demo-bucket"), "myoutputpath")
                },
                ResourceConfig = new ResourceConfig {
                    InstanceCount = 1,
                    InstanceType = new InstanceType(JsonPath.StringAt("$.InstanceType")),
                    VolumeSize = Size.Gibibytes(50)
                },  // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
                StoppingCondition = new StoppingCondition {
                    MaxRuntime = Duration.Hours(2)
                }
            });

Synopsis

Constructors

S3Location()

Constructs IS3Location objects.

Methods

Bind(ISageMakerTask, IS3LocationBindOptions)

Called when the S3Location is bound to a StepFunctions task.

FromBucket(IBucket, string)

An IS3Location built with a determined bucket and key prefix.

FromJsonExpression(string)

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

Constructors

S3Location()

Constructs IS3Location objects.

protected S3Location()
Remarks

ExampleMetadata: infused

Examples
new SageMakerCreateTrainingJob(this, "TrainSagemaker", new SageMakerCreateTrainingJobProps {
                TrainingJobName = JsonPath.StringAt("$.JobName"),
                AlgorithmSpecification = new AlgorithmSpecification {
                    AlgorithmName = "BlazingText",
                    TrainingInputMode = InputMode.FILE
                },
                InputDataConfig = new [] { new Channel {
                    ChannelName = "train",
                    DataSource = new DataSource {
                        S3DataSource = new S3DataSource {
                            S3DataType = S3DataType.S3_PREFIX,
                            S3Location = S3Location.FromJsonExpression("$.S3Bucket")
                        }
                    }
                } },
                OutputDataConfig = new OutputDataConfig {
                    S3OutputLocation = S3Location.FromBucket(Bucket.FromBucketName(this, "Bucket", "amzn-s3-demo-bucket"), "myoutputpath")
                },
                ResourceConfig = new ResourceConfig {
                    InstanceCount = 1,
                    InstanceType = new InstanceType(JsonPath.StringAt("$.InstanceType")),
                    VolumeSize = Size.Gibibytes(50)
                },  // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
                StoppingCondition = new StoppingCondition {
                    MaxRuntime = Duration.Hours(2)
                }
            });

Methods

Bind(ISageMakerTask, IS3LocationBindOptions)

Called when the S3Location is bound to a StepFunctions task.

public abstract IS3LocationConfig Bind(ISageMakerTask task, IS3LocationBindOptions opts)
Parameters
task ISageMakerTask
opts IS3LocationBindOptions
Returns

IS3LocationConfig

Remarks

ExampleMetadata: infused

FromBucket(IBucket, string)

An IS3Location built with a determined bucket and key prefix.

public static S3Location FromBucket(IBucket bucket, string keyPrefix)
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

Remarks

ExampleMetadata: infused

FromJsonExpression(string)

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

public static S3Location FromJsonExpression(string expression)
Parameters
expression string

the JSON expression resolving to an S3 location URI.

Returns

S3Location

Remarks

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

Back to top Generated by DocFX