Policy json is invalid, error: [$[0].Rules[0].Permission[4]: does not have a value in the enumeration. [aoss:CreateIndex]

64 Views Asked by At

Trying to: Create a vector index and add permissions to my policy.

Two issues:

  1. When trying to a create a vector index I get Failed to fetch.

  2. When trying to add a policy it says my JSON is invalid. But all I did was to add more Permissions.

    [
      {
        "Rules": [
          {
            "Resource": [
              "collection/easy-vector-search-collection"
            ],
            "Permission": [
              "aoss:CreateCollectionItems",
              "aoss:DeleteCollectionItems",
              "aoss:UpdateCollectionItems",
              "aoss:DescribeCollectionItems",
              "aoss:CreateIndex",
              "aoss:DeleteIndex",
              "aoss:UpdateIndex",
              "aoss:DescribeIndex",
              "aoss:ReadDocument",
              "aoss:WriteDocument"
            ],
            "ResourceType": "collection"
          }
        ],
        "Principal": [
          "arn:aws:iam::example_id:user/example_user"
        ],
        "Description": "Rule 1"
      }
    ]

Error:

Policy json is invalid, error: [$[0].Rules[0].Permission[4]: does not have a value in the enumeration [aoss:CreateCollectionItems, aoss:DeleteCollectionItems, aoss:UpdateCollectionItems, aoss:DescribeCollectionItems, aoss:*], $[0].Rules[0].Resource[1]: does not match the regex pattern ^index/(?:[a-z][a-z0-9-]{2,31}\*?|\*)/([a-z;0-9&$%][+.\-_a-z;0-9&$%]*\*?|\*)$, $[0].Rules[0].Permission[2]: does not have a value in the enumeration [aoss:ReadDocument, aoss:WriteDocument, aoss:CreateIndex, aoss:DeleteIndex, aoss:UpdateIndex, aoss:DescribeIndex, aoss:*], $[0].Rules[0].ResourceType: must be a constant value index, $[0].Rules[0].Permission[0]: does not have a value in the enumeration [aoss:ReadDocument, aoss:WriteDocument, aoss:CreateIndex, aoss:DeleteIndex, aoss:UpdateIndex, aoss:DescribeIndex, aoss:*], $[0].Rules[0].Resource[2]: does not match the regex pattern ^index/(?:[a-z][a-z0-9-]{2,31}\*?|\*)/([a-z;0-9&$%][+.\-_a-z;0-9&$%]*\*?|\*)$, $[0].Rules[0].Resource[0]: does not match the regex pattern ^index/(?:[a-z][a-z0-9-]{2,31}\*?|\*)/([a-z;0-9&$%][+.\-_a-z;0-9&$%]*\*?|\*)$, $[0].Rules[0].Permission[3]: does not have a value in the enumeration [aoss:ReadDocument, aoss:WriteDocument, aoss:CreateIndex, aoss:DeleteIndex, aoss:UpdateIndex, aoss:DescribeIndex, aoss:*], $[0].Rules[0].Permission[1]: does not have a value in the enumeration [aoss:ReadDocument, aoss:WriteDocument, aoss:CreateIndex, aoss:DeleteIndex, aoss:UpdateIndex, aoss:DescribeIndex, aoss:*], $[0].Rules[0].Resource[3]: does not match the regex pattern ^index/(?:[a-z][a-z0-9-]{2,31}\*?|\*)/([a-z;0-9&$%][+.\-_a-z;0-9&$%]*\*?|\*)$]
0

There are 0 best solutions below