Creates a Custom Resource that blocks CloudFormation updates which would cause
AWS::HealthLake::FHIRDatastore to replace (delete + recreate) the datastore.
On Update, compares the previous and current values of datastoreName, kmsKeyArn,
identityProviderConfiguration, and preloadSynthea — all fields whose change triggers
CloudFormation replacement per
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-healthlake-fhirdatastore.html.
On Create, CloudFormation has no prior state to diff against — but the guard itself
may be new to a stack whose datastore already exists (e.g. this module version was
just adopted). To catch that case, Create looks up any existing live datastore with
the same name via ListFHIRDatastores and diffs its live configuration the same way.
If a guarded field changed and acknowledgeReplacement is not set, the Custom
Resource fails, which fails the stack update before the datastore resource is
ever touched. The caller must addDependency the datastore on this resource so
CloudFormation resolves the guard before attempting the replacement.
Creates a Custom Resource that blocks CloudFormation updates which would cause AWS::HealthLake::FHIRDatastore to replace (delete + recreate) the datastore.
On Update, compares the previous and current values of datastoreName, kmsKeyArn, identityProviderConfiguration, and preloadSynthea — all fields whose change triggers CloudFormation replacement per https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-healthlake-fhirdatastore.html. On Create, CloudFormation has no prior state to diff against — but the guard itself may be new to a stack whose datastore already exists (e.g. this module version was just adopted). To catch that case, Create looks up any existing live datastore with the same name via ListFHIRDatastores and diffs its live configuration the same way. If a guarded field changed and acknowledgeReplacement is not set, the Custom Resource fails, which fails the stack update before the datastore resource is ever touched. The caller must addDependency the datastore on this resource so CloudFormation resolves the guard before attempting the replacement.