I'm using aws-s3-assets to upload data artifacts I used for a Sagemaker model. According to the documentation of Sagemaker, the S3 object needs to end with tar.gz extension. However, the uploaded asset is renamed to <random-id>.gz.
Reproduction Steps
import * as cdk from "@aws-cdk/core";
import * as s3assets from "@aws-cdk/aws-s3-assets";
export class ModelStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const modelArtifactAsset = new s3assets.Asset(this, 'ModelArtifact', {
path: "artifact.tar.gz"
});
new cdk.CfnOutput(this, "modelArtifactS3Url", {
description: "S3 url to the model artifact.",
exportName: "modelArtifactS3Url",
value: modelArtifactAsset.s3ObjectUrl,
});
}
}
What did you expect to happen?
I expect the s3 object key is ended with tar.gz
What actually happened?
The generated object is named as <id>.gz. Here is an example output from one run:
s3://<bucket-name>/assets/f43ce33c42b10b3e1fe78d87a46cd0dff8611c37637edcf1857a36c33f302ee5.gz
Environment
- CDK CLI Version :: 1.85.0
- Framework Version:: 1.86.0
- Node.js Version:: v15.2.0
- OS : Mac OS X
- Language (Version): Typescript 3.9.7
Other
A possible fix is to add an optional parameter for customize the extension name of the asset.
This is 🐛 Bug Report
I'm using aws-s3-assets to upload data artifacts I used for a Sagemaker model. According to the documentation of Sagemaker, the S3 object needs to end with
tar.gzextension. However, the uploaded asset is renamed to<random-id>.gz.Reproduction Steps
What did you expect to happen?
I expect the s3 object key is ended with
tar.gzWhat actually happened?
The generated object is named as
<id>.gz. Here is an example output from one run:s3://<bucket-name>/assets/f43ce33c42b10b3e1fe78d87a46cd0dff8611c37637edcf1857a36c33f302ee5.gzEnvironment
Other
A possible fix is to add an optional parameter for customize the extension name of the asset.
This is 🐛 Bug Report