deleteConfigurationProfile method
Deletes a configuration profile.
To prevent users from unintentionally deleting actively-used configuration profiles, enable deletion protection.
May throw BadRequestException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
Parameter applicationId :
The application ID that includes the configuration profile you want to
delete.
Parameter configurationProfileId :
The ID of the configuration profile you want to delete.
Parameter deletionProtectionCheck :
A parameter to configure deletion protection. Deletion protection prevents
a user from deleting a configuration profile if your application has
called either GetLatestConfiguration
or for the configuration profile during the specified interval.
This parameter supports the following values:
-
BYPASS: Instructs AppConfig to bypass the deletion protection check and delete a configuration profile even if deletion protection would have otherwise prevented it. -
APPLY: Instructs the deletion protection check to run, even if deletion protection is disabled at the account level.APPLYalso forces the deletion protection check to run against resources created in the past hour, which are normally excluded from deletion protection checks. -
ACCOUNT_DEFAULT: The default setting, which instructs AppConfig to implement the deletion protection value specified in theUpdateAccountSettingsAPI.
Implementation
Future<void> deleteConfigurationProfile({
required String applicationId,
required String configurationProfileId,
DeletionProtectionCheck? deletionProtectionCheck,
}) async {
final headers = <String, String>{
if (deletionProtectionCheck != null)
'x-amzn-deletion-protection-check': deletionProtectionCheck.value,
};
await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/configurationprofiles/${Uri.encodeComponent(configurationProfileId)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}