本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
下列範例 IAM 政策拒絕存取符合Condition
區塊中指定範本 AWS Proton 的動作。請注意,這些條件索引鍵僅受 動作、資源和條件索引鍵 AWS Proton中列出的動作支援。若要管理其他動作的許可,例如 DeleteEnvironmentTemplate
,您必須使用資源層級存取控制。
拒絕特定 AWS Proton 範本上範本動作的政策範例:
{
"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"]
}
}
}
]
}
在下一個範例政策中,第一個資源層級陳述式會拒絕存取ListServiceTemplates
符合Resource
區塊中列出的服務範本的 AWS Proton 範本動作,但 除外。第二個陳述式拒絕存取符合Condition
區塊中列出的範本 AWS Proton 的動作。
拒絕符合特定範本 AWS Proton 之動作的政策範例:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"proton:*"
],
"Resource": "arn:aws:region_id:123456789012:service-template/my-service-template"
},
{
"Effect": "Deny",
"Action": [
"proton:*"
],
"Resource": "*",
"Condition": {
"StringEqualsIfExists": {
"proton:ServiceTemplate": [
"arn:aws:proton:region_id:123456789012:service-template/my-service-template"
]
}
}
}
]
}
最終政策範例允許符合Condition
區塊中列出的特定服務範本的開發人員 AWS Proton 動作。
允許符合特定範本的 AWS Proton 開發人員動作的政策範例:
{
"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"
}
}
}
]
}