getComplianceDetail method

Future<GetComplianceDetailResponse> getComplianceDetail({
  1. required String memberAccount,
  2. required String policyId,
})

Returns detailed compliance information about the specified member account. Details include resources that are in and out of compliance with the specified policy. Resources are considered noncompliant for AWS WAF and Shield Advanced policies if the specified policy has not been applied to them. Resources are considered noncompliant for security group policies if they are in scope of the policy, they violate one or more of the policy rules, and remediation is disabled or not possible. Resources are considered noncompliant for Network Firewall policies if a firewall is missing in the VPC, if the firewall endpoint isn't set up in an expected Availability Zone and subnet, if a subnet created by the Firewall Manager doesn't have the expected route table, and for modifications to a firewall policy that violate the Firewall Manager policy's rules.

May throw ResourceNotFoundException. May throw InternalErrorException. May throw InvalidInputException. May throw InvalidOperationException.

Parameter memberAccount : The AWS account that owns the resources that you want to get the details for.

Parameter policyId : The ID of the policy that you want to get the details for. PolicyId is returned by PutPolicy and by ListPolicies.

Implementation

Future<GetComplianceDetailResponse> getComplianceDetail({
  required String memberAccount,
  required String policyId,
}) async {
  ArgumentError.checkNotNull(memberAccount, 'memberAccount');
  _s.validateStringLength(
    'memberAccount',
    memberAccount,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(policyId, 'policyId');
  _s.validateStringLength(
    'policyId',
    policyId,
    36,
    36,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSFMS_20180101.GetComplianceDetail'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MemberAccount': memberAccount,
      'PolicyId': policyId,
    },
  );

  return GetComplianceDetailResponse.fromJson(jsonResponse.body);
}