本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
以下示例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"]
}
}
}
]
}
在下一个示例策略中,第一个资源级语句拒绝访问与块中列出的服务 AWS Proton 模板匹配的模板操作以外的ListServiceTemplates
模板操作。Resource
第二条语句拒绝访问与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"
]
}
}
}
]
}
最后一个策略示例允许开发者 AWS Proton 执行与Condition
区块中列出的特定服务模板相匹配的操作。
允许 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"
}
}
}
]
}