aws-cloudformation / aws-cloudformation/cloudformation-cli
Support nullable primaryIdentifier property
- Dominant language
- Python
- Stars
- 336
- Forks
- 172
- Avg merge
- 3d 5m
- Merged PRs (30d)
- 3
Description
# Description
Customer can use a list of property to define the primaryIdentifier. Customer uluru schema example:
```
"primaryIdentifier":[
"/properties/Name"
"/properties/Type"
"/properties/Id"
]
```
In our current platform, Customer need to provide value to all the identifier property like below now:
```
Properties:
Name: Name_A
Type: Type_A
Id: Id_A
```
We plan to support nullable physical id property and nullable primaryIdentifier property. We plan to support customer using following template.
```
Properties:
Name: Name_A
Id: Id_A
```
This resource will have.a primaryId: Name_A||Id_A
This feature should be supported in RPDK.
# Exit Criteria:
1. add following contract test validation:
a. Verify property in identifierProperties should be either ReadOnlyProperty or CreateOnlyProperty.
b. Verify the model returned by create/read handler must include all the ReadOnlyProperties.
This is because identifierProperties consist of ReadOnlyProperty and CreateOnlyProperty. Only CreateOnlyProperty can be nullable. If model returned from create/read handler includes all the ReadOnlyProperties, it can make sure ReadOnlyProperties are not null.
2. Change the contract test assertion
``assert_primary_identifier`` and ``is_primary_identifier_equal`` should allow nullable primaryIdentifier properties
3. RPDK generated resource Model, should be able to create the nullable property identifier. Now it will return null primaryIdentifier when any of the primaryIdentifier property is null
Contributor guide
Assessment
This issue has not been assessed yet.