終止支援通知:將於 2026 年 10 月 7 日 AWS 結束對 的支援 AWS Proton。2026 年 10 月 7 日之後,您將無法再存取 AWS Proton 主控台或 AWS Proton 資源。您部署的基礎設施將保持不變。如需詳細資訊,請參閱AWS Proton 服務棄用和遷移指南。
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
的條件索引鍵型政策範例 AWS Proton
下列範例 IAM 政策拒絕存取符合 Condition區塊中指定範本 AWS Proton 的動作。請注意,這些條件索引鍵僅支援 動作、資源和條件索引鍵 AWS Proton中列出的動作。若要管理其他動作的許可,例如 DeleteEnvironmentTemplate,您必須使用資源層級存取控制。
拒絕特定 AWS Proton 範本上範本動作的政策範例:
- JSON
-
-
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": ["proton:*"],
"Resource": "*",
"Condition": {
"StringEqualsIfExists": {
"proton:EnvironmentTemplate": ["arn:aws:proton:region_id:123456789012:environment-template/my-environment-template"]
}
}
},
{
"Effect": "Deny",
"Action": ["proton:*"],
"Resource": "*",
"Condition": {
"StringEqualsIfExists": {
"proton:ServiceTemplate": ["arn:aws:proton:region_id:123456789012:service-template/my-service-template"]
}
}
}
]
}
在下一個範例政策中,第一個資源層級陳述式會拒絕存取符合 Resource區塊中所列服務範本的 AWS Proton 範本動作ListServiceTemplates,但 除外。第二個陳述式拒絕存取符合Condition區塊中所列範本 AWS Proton 的動作。
拒絕符合特定範本 AWS Proton 之動作的政策範例:
- JSON
-
-
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"proton:*"
],
"Resource": "arn:aws:proton:us-east-1:123456789012:service-template/my-service-template"
},
{
"Effect": "Deny",
"Action": [
"proton:*"
],
"Resource": "*",
"Condition": {
"StringEqualsIfExists": {
"proton:ServiceTemplate": [
"arn:aws:proton:us-east-1:123456789012:service-template/my-service-template"
]
}
}
}
]
}
最終政策範例允許符合 Condition區塊中所列特定服務範本的開發人員 AWS Proton 動作。
允許符合特定範本的 AWS Proton 開發人員動作的範例政策:
- JSON
-
-
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"proton:ListServiceTemplates",
"proton:ListServiceTemplateVersions",
"proton:ListServices",
"proton:ListServiceInstances",
"proton:ListEnvironments",
"proton:GetServiceTemplate",
"proton:GetServiceTemplateVersion",
"proton:GetService",
"proton:GetServiceInstance",
"proton:GetEnvironment",
"proton:CreateService",
"proton:UpdateService",
"proton:UpdateServiceInstance",
"proton:UpdateServicePipeline",
"proton:DeleteService",
"codestar-connections:ListConnections"
],
"Resource": "*",
"Condition": {
"StringEqualsIfExists": {
"proton:ServiceTemplate": "arn:aws:proton:region_id:123456789012:service-template/my-service-template"
}
}
},
{
"Effect": "Allow",
"Action": [
"codestar-connections:PassConnection"
],
"Resource": "arn:aws:codestar-connections:*:*:connection/*",
"Condition": {
"StringEquals": {
"codestar-connections:PassedToService": "proton.amazonaws.com"
}
}
}
]
}