Create IAM Policy to restrict user

0

Hi, Please help me in creating IAM Policy and configure policy to user in which user should only be allowed to create specific type of instance in specific region.

regards, malik

已提問 2 個月前檢視次數 187 次
2 個答案
0
profile pictureAWS
專家
David
已回答 2 個月前
0

Below is an example policy document that allows the user to create only t2.micro instances in the us-east-1 region. You can adjust the instance types and region as needed.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "ec2:RunInstances",
            "Resource": "arn:aws:ec2:us-east-1::image/ami-*",
            "Condition": {
                "StringEquals": {
                    "ec2:InstanceType": "t2.micro",
                    "ec2:Region": "us-east-1"
                }
            }
        }
    ]
}

If necessary, you can modify the policy document to grant additional permissions or restrict further based on your specific requirements.

已回答 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南