Examples of CreateSecurityGroupRequest


Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

                groupId = describeResult.getSecurityGroups().get(0).getGroupId();
            }
            else
            {
                log.info("Security group \"" + groupName + "\" does not exists. Creating it.");
                groupId = ec2Client.createSecurityGroup(new CreateSecurityGroupRequest().
                        withGroupName(groupName).
                        withDescription(description)).getGroupId();
            }

            log.info("Authorizing ingress rules for \"" + groupName + "\".");
View Full Code Here

Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

        Region usWest2 = Region.getRegion(Regions.US_WEST_2);
        ec2.setRegion(usWest2);

        // Create a new security group.
        try {
            CreateSecurityGroupRequest securityGroupRequest = new CreateSecurityGroupRequest(
                    "GettingStartedGroup", "Getting Started Security Group");
            CreateSecurityGroupResult result = ec2
                    .createSecurityGroup(securityGroupRequest);
            System.out.println(String.format("Security group created: [%s]",
                    result.getGroupId()));
View Full Code Here

Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

        when(pool.getProvider()).thenReturn(provider);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        client.createSecurityGroup(new CreateSecurityGroupRequest()
            .withGroupName(SECURITY_GROUP_NAME).withDescription("Just for test"));

        activity.execute(execution);

        try {
View Full Code Here

Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

        final String businessKey = execution.getProcessBusinessKey();
        final String groupName = SecurityGroups.formatNameFromBusinessKey(businessKey);

        try {
            LOG.info(">> Creating Security Group with name {}", groupName);
            CreateSecurityGroupRequest request = new CreateSecurityGroupRequest()
                .withGroupName(groupName).withDescription("Security Group for " + businessKey);

            CreateSecurityGroupResult result = client.createSecurityGroup(request);
            LOG.info("<< Created Security Group with ID {}", result.getGroupId());
View Full Code Here

Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

    /** {@inheritDoc} */
    public String createSecurityGroup(String instanceId, String name, String description) {
        String vpcId = getVpcId(instanceId);

        AmazonEC2 ec2Client = ec2Client();
        CreateSecurityGroupRequest request = new CreateSecurityGroupRequest();
        request.setGroupName(name);
        request.setDescription(description);
        request.setVpcId(vpcId);

        LOGGER.info(String.format("Creating EC2 security group %s.", name));

        CreateSecurityGroupResult result = ec2Client.createSecurityGroup(request);
        return result.getGroupId();
View Full Code Here

Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

        final String businessKey = execution.getProcessBusinessKey();
        final String groupName = SecurityGroups.formatNameFromBusinessKey(businessKey);

        try {
            LOG.info(">> Creating Security Group with name {}", groupName);
            CreateSecurityGroupRequest request = new CreateSecurityGroupRequest()
                .withGroupName(groupName).withDescription("Security Group for " + businessKey);

            CreateSecurityGroupResult result = client.createSecurityGroup(request);
            LOG.info("<< Created Security Group with ID {}", result.getGroupId());
View Full Code Here

Examples of com.amazonaws.services.ec2.model.CreateSecurityGroupRequest

        when(pool.getProvider()).thenReturn(provider);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        client.createSecurityGroup(new CreateSecurityGroupRequest()
            .withGroupName(SECURITY_GROUP_NAME).withDescription("Just for test"));

        activity.execute(execution);

        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.