sagemaker: Some CfnFeatureGroup properties generate incorrect capitalization
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
I attempted to create a new CfnFeatureGroup with the OnlineStoreConfig and OfflineStoreConfig properties configured. When the template is synthesized, the resulting CFN template uses lower camel case for these specific properties while the CFN specification requires upper camel case.
### Expected Behavior
Expecting output in upper camel case as per spec.
```yaml
TestFeatureGroup:
Type: AWS::SageMaker::FeatureGroup
Properties:
FeatureGroupName: test
OfflineStoreConfig:
S3StorageConfig:
S3Uri:
Fn::Join:
- ""
- - s3://
- Ref: offlineStore4208FAB6
KmsKeyId:
Ref: kmsKey3BB021CC
DataCatalogConfig:
Catalog: AwsDataCatalog
Database: testdb
TableName: test
OnlineStoreConfig:
EnableOnlineStore: true
SecurityConfig:
KmsKeyId:
Ref: kmsKey3BB021CC
...
```
### Current Behavior
As show below, the CFN template that is outputted is in lower camel case for the OfflineStorageConfig, OnlineStoreConfig, OnlineStoreSecurityConfig, DataCatalogConfig and S3StorageConfig properties.
```yaml
TestFeatureGroup:
Type: AWS::SageMaker::FeatureGroup
Properties:
FeatureGroupName: test
OfflineStoreConfig:
s3StorageConfig:
s3Uri:
Fn::Join:
- ""
- - s3://
- Ref: offlineStore4208FAB6
kmsKeyId:
Ref: kmsKey3BB021CC
dataCatalogConfig:
catalog: AwsDataCatalog
database: testdb
tableName: test
OnlineStoreConfig:
enableOnlineStore: true
securityConfig:
kmsKeyId:
Ref: kmsKey3BB021CC
...
```
### Reproduction Steps
Below is a snippet of some CDK resources which creates an S3 bucket, KMS key and a FeatureGroup referencing said bucket and key.
```typescript
const bucket = new s3.Bucket(this, 'offlineStore');
const kms_key = new kms.Key(this, 'kmsKey');
new sagemaker.CfnFeatureGroup(this, 'TestFeatureGroup', {
featureGroupName: "test",
eventTimeFeatureName: 'eventTime',
recordIdentifierFeatureName: 'recordIdentifier',
featureDefinitions: [
{
featureName: 'recordIdentifier',
featureType: 'String'
},
{
featureName: 'eventTime',
featureType: 'String'
}
],
onlineStoreConfig: {
enableOnlineStore: true,
securityConfig: {
kmsKeyId: kms_key.keyId,
}
},
offlineStoreConfig: {
s3StorageConfig: {
s3Uri: bucket.s3UrlForObject(),
kmsKeyId: kms_key.keyId,
},
dataCatalogConfig: {
catalog: 'AwsDataCatalog',
database: 'testdb',
tableName: 'test'
}
},
})
```
### Possible Solution
Not sure where this error occurs, but originally discovered this using CDK Python before replicating in Typescript. So its pre the JSII step and might be related to the raw CFN import into L1 Constructs.
### Additional Information/Context
_No response_
### CDK CLI Version
2.138.0 (build 6b41c8b)
### Framework Version
2.138.0
### Node.js Version
v18.16.0
### OS
MacOS 13.6.4
### Language
TypeScript, Python
### Language Version
_No response_
### Other information
CFN doc of impacted properties found:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-featuregroup-offlinestoreconfig.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-featuregroup-s3storageconfig.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-featuregroup-datacatalogconfig.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-featuregroup-onlinestoreconfig.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-featuregroup-onlinestoresecurityconfig.html
Contributor guide
Research direction
Start with the sagemaker.CfnFeatureGroup L1 construct and the raw CloudFormation import or generation path mentioned in the report. Reproduce the TypeScript example and inspect the synthesized template, then add or update a regression test for the affected nested properties. Done means OfflineStoreConfig, OnlineStoreConfig, S3StorageConfig, DataCatalogConfig, and related fields synthesize with the CloudFormation specification's capitalization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python, typescript
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100