わかりやすい名前でカスタムポリシーを作成します。[ポリシードキュメント] フィールドに、このポリシーが実行を許可する API を含むコードを記述します。
注: 次の JSON サンプルには、クラウドディスカバリー の権限が含まれています。
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"PermissionsNeededForDiscovery",
"Effect":"Allow",
"Action":[
"account:ListRegions",
"apigateway:GET",
"application-autoscaling:Describe*",
"autoscaling-plans:Describe*",
"autoscaling:Describe*",
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeLaunchConfigurations",
"cloudformation:Describe*",
"cloudformation:DescribeStack*",
"cloudformation:List*
"cloudwatch:Get*",
"cloudwatch:List*",
"config:ListDiscoveredResources",
"dynamodb:Describe*",
"dynamodb:DescribeTable",
"dynamodb:ListGlobalTables",
"dynamodb:ListTables",
"ec2:Describe*",
"ec2:ReportInstanceStatus",
"ecs:Describe*",
"ecs:List*",
"eks:Describe*",
"eks:List*",
"elasticache:Describe*",
"elasticache:List*",
"elasticfilesystem:Describe*",
"elasticloadbalancing:Describe*",
"lambda:Get*",
"lambda:List*",
"organizations:Describe*",
"organizations:DescribeOrganization",
"organizations:List*",
"rds:Describe*",
"redshift:Describe*",
"route53:GetHostedZone",
"route53:List*",
"s3:GetAccountPublicAccessBlock",
"s3:GetBucket*",
"s3:GetBucketLocation",
"s3:List*",
"sdb:GetAttributes",
"sns:GetEndpointAttributes",
"sns:GetSubscriptionAttributes",
"sns:List*",
"sns:ListPlatformApplications",
"sns:ListSubscriptions",
"sns:ListSubscriptionsByTopic",
"sns:ListTopics",
],
"Resource":"*"
}
]
}
次の JSON サンプルには、クラウドディスカバリー と クラウドプロビジョニングとガバナンス の権限が含まれています。 {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PermissionsNeededForCPG",
"Effect": "Allow",
"Action": [
"account:ListRegions",
"apigateway:GET",
"application-autoscaling:Describe*",
"autoscaling-plans:Describe*",
"autoscaling:Describe*",
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeLaunchConfigurations",
"cloudformation:Describe*",
"cloudformation:DescribeStack*",
"cloudwatch:Get*",
"cloudwatch:List*",
"config:ListDiscoveredResources"
"dynamodb:Describe*",
"dynamodb:DescribeTable",
"dynamodb:ListGlobalTables",
"dynamodb:ListTables",
"ec2:Describe*",
"ec2:ReportInstanceStatus",
"ecs:Describe*",
"ecs:List*",
"eks:Describe*",
"eks:List*",
"elasticache:Describe*",
"elasticache:List*",
"elasticfilesystem:Describe*",
"elasticloadbalancing:Describe*",
"lambda:Get*",
"lambda:List*",
"organizations:Describe*",
"organizations:DescribeOrganization",
"organizations:List*",
"rds:Describe*",
"redshift:Describe*",
"route53:GetHostedZone",
"route53:List*",
"s3:GetAccountPublicAccessBlock",
"s3:GetBucket*",
"s3:GetBucketLocation",
"s3:List*",
"sdb:GetAttributes",
"sns:GetEndpointAttributes",
"sns:GetSubscriptionAttributes",
"sns:List*",
"sns:ListPlatformApplications",
"sns:ListSubscriptions",
"sns:ListSubscriptionsByTopic",
"sns:ListTopics",
],
"Resource": "*"
},
{
"Sid": "MinimalPermissionsNeededForEc2ProvisioningThroughCloudFormation",
"Effect": "Allow",
"Action": [
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
"cloudformation:DeleteStack",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResources",
"cloudformation:DescribeStacks",
"cloudformation:GetTemplate",
"cloudformation:GetTemplateSummary",
"cloudformation:List*",
"cloudformation:UpdateStack",
"cloudformation:ValidateTemplate"
"ec2:*",
"s3:CreateBucket",
"s3:DeleteBucket",
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject",
],
"Resource": "*"
}
]
}