validate_policy
async
¶
validate_policy(
policy_document: PolicyDocument,
policy_type: PolicyType,
*,
config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
locale: Optional[Locale] = None,
max_results: Optional[int] = None,
next_token: Optional[Token] = None,
validate_policy_resource_type: Optional[ValidatePolicyResourceType] = None,
) -> ValidatePolicyResponse
Requests the validation of a policy and returns a list of findings. The findings help you identify issues and provide actionable recommendations to resolve the issue and enable you to author functional policies that meet security best practices.
Parameters:
-
locale(Optional[Locale], default:None) –The locale to use for localizing the findings.
-
max_results(Optional[int], default:None) –The maximum number of results to return in the response.
-
next_token(Optional[Token], default:None) –A token used for pagination of results returned.
-
policy_document(PolicyDocument) –The JSON policy document to use as the content for the policy.
-
policy_type(PolicyType) –The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups.
Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.
Service control policies (SCPs) are a type of organization policy attached to an Amazon Web Services organization, organizational unit (OU), or an account.
-
validate_policy_resource_type(Optional[ValidatePolicyResourceType], default:None) –The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is
RESOURCE_POLICY. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can chooseAWS::S3::Bucketfor the policy validation resource type.For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–Internal server error.
-
ThrottlingException–Throttling limit exceeded error.
-
ValidationException–Validation exception error.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_accessanalyzer/_services/async_access_analyzer.py
1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 | |