mardi 29 septembre 2015

IAM, apply policy only to tagged instances

I need create a policy IAM to stop or terminate only instances that have a specific tag (multiple instances), i have written this:

{
            "Action": [
                "ec2:StopInstances",
                "ec2:TerminateInstances"
            ],
            "Effect": "Allow",
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "ec2:ResourceTag/Name": "tag1",
                    "ec2:ResourceTag/Name": "tag2",
                    "ec2:ResourceTag/Name": "tag3"
                }
            }
        },

But the form is invalid, only one string ec2:ResourceTag/Name can be written. How can Stop and Terminate instances with different tag Name ?




Aucun commentaire:

Enregistrer un commentaire