It is question on AWS IAM policy, multiple Actions with Multiple Resources (presumably not related). I have parameter 'myparam' encrypted with 'mykey', and I have policy as below separate blocks, one for param and one for key, it works.
{
{
"Action": [
"ssm:GetParameter",
],
"Effect": "Allow",
"Resource": "MY-ARN:MY-ACC:parameter/myparam"
},
{
"Action": [
"kms:Decrypt"
],
"Effect": "Allow",
"Resource": "MY-ARN:MY-ACC::key/mykey"
}
}
As per documentation, We can combine multiple actions and resources, If I combine the same as below, Does this work?
{
{
"Action": [
"ssm:GetParameter",
"kms:Decrypt"
],
"Resource": [
"MY-ARN:MY-ACC:parameter/myparam"
"MY-ARN:MY-ACC::key/mykey"
],
"Effect": "Allow"
}
}
How the Actions to Resource mapping happens in this case? I couldn't find any documentation on this https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_action.html If I have associated resources or associed Actiosn then it makes sense, What is your comments on this?