aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.35k stars 3.76k forks source link

transfer : CopyStepDetailsProperty Wrong CloudFormation Mapping #28410

Open Zahra-97 opened 6 months ago

Zahra-97 commented 6 months ago

Describe the bug

AWS::Transfer::Workflow CopyStepDetails is generated with camel case. AWS API requires Properties in Pascal Case:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-transfer-workflow-copystepdetails.html { "DestinationFileLocation" : S3FileLocation, "Name" : String, "OverwriteExisting" : String, "SourceFileLocation" : String }

Python code:

Screenshot 2023-12-18 at 16 32 12

Expected Behavior

Json Template output with pascal case properties

Current Behavior

Json Template output with camel case properties.

Reproduction Steps

`

copy_step_details_property = transfer.CfnWorkflow.CopyStepDetailsProperty(
          destination_file_location=transfer.CfnWorkflow.S3FileLocationProperty(
              s3_file_location=transfer.CfnWorkflow.S3InputFileLocationProperty(
                  bucket=bucket.bucket_name,
                  key="csv"
              )
          ),
          name=cp_to_s3,
          overwrite_existing="TRUE",
          source_file_location="${original.file}"
      )

cfn_workflow = transfer.CfnWorkflow(
    self,
    "CopyToS3",
    steps=[
        transfer.CfnWorkflow.WorkflowStepProperty(
            copy_step_details=copy_step_details_property
            )
    ],
    description='copy_to_s3'

)

`

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.110.0

Framework Version

No response

Node.js Version

v21.3.0

OS

macOS Monterey Version 12.6

Language

Python

Language Version

Python (3.11)

Other information

Screenshot 2023-12-18 at 16 18 30 Screenshot 2023-12-18 at 16 19 32
pahud commented 4 weeks ago

https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_transfer/CfnWorkflow.html#aws_cdk.aws_transfer.CfnWorkflow.WorkflowStepProperty

All the properties are loosely typed as Any. You will need to define JSON for that.

e.g.


copy_step_details_property = {
  "DestinationFileLocation" : S3FileLocation,
  "Name" : String,
  "OverwriteExisting" : String,
  "SourceFileLocation" : String
}

related to https://github.com/aws/aws-cdk/issues/21767