0

I'm looking to deploy the SageMaker pipeline using CDK (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnPipeline.html) but could not find any code examples. Any pointers?

Ulkurz
  • 73
  • 1
  • 10

2 Answers2

1

CDK L1 Constructs correspond 1:1 to a CloudFormation resource of the same name. The construct props match the resouce properties. The go-to source is therefore the CloudFormation docs.

The AWS::SageMaker::Pipeline docs have a more complete example.

fedonev
  • 20,327
  • 2
  • 25
  • 34
  • Thanks, @fedonev! Would you say `sagemaker pipeline` is not supported yet using CDK? – Ulkurz May 11 '22 at 16:50
  • @Ulkurz It is supported. It's implemented in the CDK as a [L1 Construct](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html#constructs_lib), which simply means you must work with the low-level CloudFormation-type properties, without the helpful abstractions that CDK L2 and L3 Constructs provide. – fedonev May 11 '22 at 17:11
  • Great, thanks again @fedonev! Would you say that we could perhaps use Python-SDK to codify the sagemaker pipeline in a more developer-friendly fashion, [as shown here](https://stackoverflow.com/a/70191757/7722929)? We can then use `pipeline.definition()` to build a JSON that could be used with CloudFormation. Is this a viable approach? – Ulkurz May 11 '22 at 17:38
  • @Ulkurz Yes, absolutely. Adding abstractions using language features is a CDK superpower! – fedonev May 11 '22 at 17:53
0

pipeline.definition() outputs the needed cloudformation content... as noted above, there is not yet cdk support for L1 services.