[英]AWS CDK Policy condition for Tagged ressources
我目前正在使用 CDK 創建一個 AWS 堆棧。 我為部署堆棧的用戶定義了一個策略,以獲得正確的權限。 在 CDK 中,我將我的資源標記為:
const app = new cdk.App();
const scheme = new MyTemplateStack(app, 'MyTemplateStack');
cdk.Tag.add(scheme, 'Team', 'myTeamName');
我想使用條件策略來允許我的用戶僅有權修改或刪除標記有正確團隊的資源:
因此,這是一個策略示例,我需要在以下條件下部署我的堆棧:
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ec2:RevokeSecurityGroupIngress",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Team": "myTeamName"
}
}
}
但是當我嘗試再次部署我的堆棧時,我收到以下錯誤消息,指出我沒有被授權:
API: ec2:RevokeSecurityGroupEgress You are not authorized to perform this operation
我已經閱讀了文檔,但我不明白為什么這不起作用。
感謝您的幫助!
在我看來,您允許ec2:RevokeSecurityGroupIngress
,但是試圖調用ec2:RevokeSecurityGroupEgress
操作。 你能核實和確認嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.