Amazon AWS SDK Guía de usuario Pagina 106

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 155
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 105
"Statement" : [
{
"Sid" : "ListDeploymentsStatement",
"Effect" : "Allow",
"Action" : "codedeploy:ListDeployments",
"Resource" : "*"
}
]
}
*/
var action = new ActionIdentifier("codedeploy:ListDeployments");
var actions = new List<ActionIdentifier>();
actions.Add(action);
var resource = new Resource("*");
var resources = new List<Resource>();
resources.Add(resource);
var statement = new Statement(Statement.StatementEffect.Allow)
{
Actions = actions,
Id = "ListDeploymentsStatement",
Resources = resources
};
var statements = new List<Statement>();
statements.Add(statement);
var policy = new Policy
{
Id = "ListDeploymentsPolicy",
Version = "2012-10-17",
Statements = statements
};
return policy.ToJson();
}
Add a Policy to a Group
The following example creates a new policy, adds the new policy to an existing group, and then displays
a list of the group's associated policies:
// using Amazon.IdentityManagement.Resources;
// using Amazon.IdentityManagement.Model;
var iam = new IdentityManagementService();
try
{
var group = iam.GetGroupByName("DemoGroup");
// GenerateGroupPolicyDocument() is a custom method.
string policyDoc = GenerateGroupPolicyDocument();
Version v2.0.0
102
AWS SDK for .NET Developer Guide
IAM Resource API Examples
Vista de pagina 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 154 155

Comentarios a estos manuales

Sin comentarios