aws / aws/aws-cdk

[Core] Fn.ConditionIf doesn't capitalise properties name.

Open
#25,135 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/core effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Same issue as https://github.com/aws/aws-cdk/issues/8396 https://github.com/aws/aws-cdk/issues/10895

As shown in previous issue, Fn.ConditionIf doesn't capitalise properties name which cause problems.

I would like for the feature request to be reconsidered since using fn::if is still useful when creating service catalog stacks with cdk.

### Use Case

fn::if is still useful when creating service catalog stacks with cdk. Specifically I'm using ConditionIf with CfnPipeline's stage property.

This cause the output to be lowercase like this
` - Fn::If:
- IsPrimaryRegion
- actions:
- actionTypeId:
category: Deploy
owner: AWS
provider: S3
version: "1"
name: name
configuration:
BucketName: cdkworkshoppipelinestack-pipelineartifactsbucketa-etpjy3qwjmms
Extract: false
inputArtifacts:
- name: name
name: name3
- Ref: AWS::NoValue`

Instead of
`Actions:
- ActionTypeId:
Category: Deploy
Owner: AWS
Provider: S3
Version: "1"
Configuration:
BucketName: cdkworkshoppipelinestack-pipelineartifactsbucketa-etpjy3qwjmms
Extract: false
InputArtifacts:
- Name: name
Name: name
Name: name3`
### Proposed Solution

Make fn::if capitalise the property name for CfnPipeline's stage property.

and perhaps a function to easily rename properties

### Other Information

https://github.com/aws/aws-cdk/discussions/24381

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.74

### Environment details (OS name and version, etc.)

Windows

Contributor guide

Open the contributing guide

Research direction

Start by tracing Fn.ConditionIf synthesis and how CfnPipeline's stage property is rendered. Compare the generated lowercase structure with the expected CloudFormation property casing, then review issues 8396 and 10895 and discussion 24381 for compatibility concerns and the definition of done.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.