@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); hashCode = prime * hashCode + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); hashCode = prime * hashCode + ((getAssumeRolePolicyDocument() == null) ? 0 : getAssumeRolePolicyDocument().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getMaxSessionDuration() == null) ? 0 : getMaxSessionDuration().hashCode()); hashCode = prime * hashCode + ((getPermissionsBoundary() == null) ? 0 : getPermissionsBoundary().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
if (other.getRoleId() != null && other.getRoleId().equals(this.getRoleId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreateDate() == null ^ this.getCreateDate() == null)
account, ImmutableMap.of( "role_arn", role.getArn(), "role_name", role.getRoleName(), "grantees", crossAccountArns),
private Set<String> loadRoles() { Set<String> result = new TreeSet<String>(); boolean done = false; String marker = null; do { final ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.setMarker(marker); final ListRolesResult listRolesResult = iam.listRoles(listRolesRequest); for (Role r : listRolesResult.getRoles()) { result.add(r.getArn()); } done = (!listRolesResult.isTruncated()); marker = listRolesResult.getMarker(); } while (!done); return result; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); hashCode = prime * hashCode + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); hashCode = prime * hashCode + ((getAssumeRolePolicyDocument() == null) ? 0 : getAssumeRolePolicyDocument().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getMaxSessionDuration() == null) ? 0 : getMaxSessionDuration().hashCode()); hashCode = prime * hashCode + ((getPermissionsBoundary() == null) ? 0 : getPermissionsBoundary().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
.withAssumeRolePolicyDocument(assumeRolePolicyDocument); createRole = iam.createRole(request); getLogger().info("Create Role requested: {}", createRole.getRole().getArn()); policyArns.stream().forEach(policyArn -> { iam.attachRolePolicy(new AttachRolePolicyRequest()
if (other.getRoleId() != null && other.getRoleId().equals(this.getRoleId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreateDate() == null ^ this.getCreateDate() == null)
neo4j.execCypher(cypher, "a", role.getArn(), "p", n).forEach(it -> { gc.MERGE_ACTION.accept(it); }); + "merge (n)-[r:CONTAINS]->(p:AwsInlinePolicy { aws_owner_arn: {a}, aws_policyName: {n} })" + " set p :AwsIamPolicy, p.aws_policyDocument = {d}, r.updateTs = {t}"; neo4j.execCypher(policyCypher, "a", role.getArn(), "n", policyName, "d", urlDecode(rolePolicy.getPolicyDocument()), "t", timestamp); neo4j.execCypher(removePolicyCypher, "a", role.getArn(), "t", timestamp); linkToAccount(role.getArn());
private CreateStackTask readyStackTask() { CreateStackTask stackTask = new CreateStackTask(); stackTask.setProject(project); stackTask.setName("AntTaskTestStack"); stackTask.setRegion("us-east-1"); stackTask .setDefaultInstanceProfileArn(iamClient .getInstanceProfile( new GetInstanceProfileRequest() .withInstanceProfileName("aws-opsworks-ec2-role")) .getInstanceProfile().getArn()); stackTask.setServiceRoleArn(iamClient .getRole( new GetRoleRequest() .withRoleName("aws-opsworks-service-role")) .getRole().getArn()); return stackTask; }
/** * Sets the "instanceProfile" and "serviceRole" properties according to the * set parameters. */ public void execute() { checkParams(); AmazonIdentityManagementClient iamClient = getOrCreateClient(AmazonIdentityManagementClient.class); getProject() .setProperty( "instanceProfileArn", iamClient .getInstanceProfile( new GetInstanceProfileRequest() .withInstanceProfileName(instanceProfile)) .getInstanceProfile().getArn()); getProject() .setProperty( "serviceRoleArn", iamClient .getRole( new GetRoleRequest() .withRoleName(serviceRole)) .getRole().getArn()); } }