You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace primary_identifier_field_name with is_primary_key (#190)
Description of changes:
We have had quite a few issues with the logic of `SetResourceIdentifiers` struggling to find the correct identifier field name or matching it to the corresponding spec or status field. The current implementation solves the first of these issues by pointing directly to the identifier member in the input shape, but the logic to link this back to a spec or status field is still flawed.
Rather than pointing to a member in the input shape and trying to infer the spec or status field, this new implementation directly denotes a field on a resource as the "primary key". The `SetResourceIdentifiers` logic can now directly find the target field and create the corresponding setter. The override logic for ARNs has now been moved to a `is_arn_primary_key` on the `ResourceConfig` object, since we cannot access the ARN as a `FieldConfig`.
This is a **backwards compatibility breaking change** as all existing `primary_identifier_field_name` configurations need to be refactored into `is_primary_key` fields on the respective resource's field. For example:
```yaml
operations:
DescribeDBInstances:
primary_identifier_field_name: DBInstanceIdentifier
DescribeDBSubnetGroups:
primary_identifier_field_name: DBSubnetGroupName
```
becomes:
```yaml
resources:
DBInstance:
fields:
DBInstanceIdentifier:
is_primary_key: true
DBSubnetGroup:
fields:
Name:
is_primary_key: true
```
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
0 commit comments