deleteResourcePolicy method

Future<void> deleteResourcePolicy({
  1. String? expectedRevisionId,
  2. String? policyName,
  3. String? resourceArn,
})

Deletes a resource policy from this account. This revokes the access of the identities in that policy to put log events to this account.

May throw InvalidParameterException. May throw OperationAbortedException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter expectedRevisionId : The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.

Parameter policyName : The name of the policy to be revoked. This parameter is required.

Parameter resourceArn : The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted

Implementation

Future<void> deleteResourcePolicy({
  String? expectedRevisionId,
  String? policyName,
  String? resourceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.DeleteResourcePolicy'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (expectedRevisionId != null)
        'expectedRevisionId': expectedRevisionId,
      if (policyName != null) 'policyName': policyName,
      if (resourceArn != null) 'resourceArn': resourceArn,
    },
  );
}