Deletes a configuration profile.
To prevent users from unintentionally deleting actively-used configuration profiles, enable deletion protection.
Parameters:
-
application_id
(Name)
–
The application ID that includes the configuration profile you want to delete.
-
configuration_profile_id
(LongName)
–
The ID of the configuration profile you want to delete.
-
deletion_protection_check
(Optional[DeletionProtectionCheck], default:
None
)
–
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. APPLY also 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 the UpdateAccountSettings API.
Raises:
Examples:
To delete a configuration profile
The following delete-configuration-profile example deletes the specified configuration profile.
>>> client.delete_configuration_profile(application_id='339ohji', configuration_profile_id='ur8hx2f')
Source code in docs_src/capo_appconfig/_services/app_config.py
| def delete_configuration_profile(
self,
application_id: "capo_appconfig.types.name.Name",
configuration_profile_id: "capo_appconfig.types.long_name.LongName",
*,
config_overrides: Optional[AppConfigClientConfig] = None,
deletion_protection_check: Optional[
"capo_appconfig.types.deletion_protection_check.DeletionProtectionCheck"
] = None,
) -> None:
"""<p>Deletes a configuration profile.</p> <p>To prevent users from unintentionally deleting actively-used configuration profiles, enable <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html">deletion protection</a>.</p>
Args:
application_id: <p>The application ID that includes the configuration profile you want to delete.</p>
configuration_profile_id: <p>The ID of the configuration profile you want to delete.</p>
deletion_protection_check: <p>A parameter to configure deletion protection. Deletion protection prevents a user from deleting a configuration profile if your application has called either <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html">GetLatestConfiguration</a> or for the configuration profile during the specified interval. </p> <p>This parameter supports the following values:</p> <ul> <li> <p> <code>BYPASS</code>: Instructs AppConfig to bypass the deletion protection check and delete a configuration profile even if deletion protection would have otherwise prevented it.</p> </li> <li> <p> <code>APPLY</code>: Instructs the deletion protection check to run, even if deletion protection is disabled at the account level. <code>APPLY</code> also forces the deletion protection check to run against resources created in the past hour, which are normally excluded from deletion protection checks. </p> </li> <li> <p> <code>ACCOUNT_DEFAULT</code>: The default setting, which instructs AppConfig to implement the deletion protection value specified in the <code>UpdateAccountSettings</code> API.</p> </li> </ul>
Raises:
capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_appconfig.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource.</p>
capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To delete a configuration profile
The following delete-configuration-profile example deletes the specified configuration profile.
>>> client.delete_configuration_profile(application_id='339ohji', configuration_profile_id='ur8hx2f')
"""
def _handler(
req: "OperationRequest[capo_appconfig.types.delete_configuration_profile_request.DeleteConfigurationProfileRequest]",
) -> OperationResponse[None]:
import capo_appconfig._operations.amazon_app_config.delete_configuration_profile
output, http_response = (
capo_appconfig._operations.amazon_app_config.delete_configuration_profile.delete_configuration_profile(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteConfigurationProfile")
)
input_: capo_appconfig.types.delete_configuration_profile_request.DeleteConfigurationProfileRequest = {
"application_id": application_id,
"configuration_profile_id": configuration_profile_id,
}
if deletion_protection_check is not None:
input_["deletion_protection_check"] = deletion_protection_check
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|