deleteResourcePolicy method
Deletes a Systems Manager resource policy. A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. The following resources support Systems Manager resource policies.
-
OpsItemGroup- The resource policy forOpsItemGroupenables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems). -
Parameter- The resource policy is used to share a parameter with other accounts using Resource Access Manager (RAM). For more information about cross-account sharing of parameters, see Working with shared parameters in the Amazon Web Services Systems Manager User Guide.
May throw InternalServerError.
May throw MalformedResourcePolicyDocumentException.
May throw ResourceNotFoundException.
May throw ResourcePolicyConflictException.
May throw ResourcePolicyInvalidParameterException.
May throw ResourcePolicyNotFoundException.
Parameter policyHash :
ID of the current policy version. The hash helps to prevent multiple calls
from attempting to overwrite a policy.
Parameter policyId :
The policy ID.
Parameter resourceArn :
Amazon Resource Name (ARN) of the resource to which the policies are
attached.
Implementation
Future<void> deleteResourcePolicy({
required String policyHash,
required String policyId,
required String resourceArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.DeleteResourcePolicy'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PolicyHash': policyHash,
'PolicyId': policyId,
'ResourceArn': resourceArn,
},
);
}