AWS Certified Solutions Architect - Professional

AWS Certified Solutions Architect - Professional

Get started today

Ultimate access to all questions.


Within an IAM policy, can you add an If Exists condition at the end of a Null condition?




Explanation:

  1. In AWS IAM policies, you cannot add an "If Exists" condition at the end of a "Null" condition. The "Null" condition is used to specify that the action should only be allowed if the specified key is absent from the request. The "If Exists" condition, on the other hand, is used to check if a key is present in the request. Combining these two conditions in a single statement is not supported by AWS IAM policy language.

  2. The correct approach is to use separate statements for each condition. You can create one statement with the "Null" condition to allow the action if the key is absent, and another statement with the "If Exists" condition to allow the action if the key is present. However, you cannot combine these conditions in a single statement.