src/main/java/com/awslabs/aws/greengrass/provisioner/implementations/helpers/BasicDeploymentHelper.java
@Override
    public void createAndWaitForDeployment(Optional<Role> serviceRole, Optional<Role> coreRole, GreengrassGroupId greengrassGroupId, String groupVersionId) {
        log.info("Creating a deployment");
        log.info(String.join("", "Group ID [", greengrassGroupId.getGroupId(), "]"));
        log.info(String.join("", "Group version ID [", groupVersionId, "]"));
        String initialDeploymentId = greengrassHelper.createDeployment(greengrassGroupId, groupVersionId);
        log.info(String.join("", "Deployment created [", initialDeploymentId, "]"));

        DeploymentStatus deploymentStatus = getDeploymentStatus(serviceRole, coreRole, greengrassGroupId, groupVersionId, initialDeploymentId);

        if (!DeploymentStatus.SUCCESSFUL.equals(deploymentStatus)) {
            // Not successful, throw an exception to bail out
            throw new RuntimeException("Deployment failed");
        }

        log.info("Deployment successful");
    }
/**
     * Create a deployment and wait for its status to change //
     *
     * @param serviceRole
     * @param coreRole
     * @param greengrassGroupId
     * @param groupVersionId
     */
Create a deployment and wait for its status to change
@param serviceRole
@param coreRole
@param greengrassGroupId
@param groupVersionId
Create a deployment and wait for its status to change @param serviceRole @param coreRole @param greengrassGroupId @param groupVersionId
@Override
    public void createAndWaitForDeployment(Optional<Role> serviceRole, Optional<Role> coreRole, GreengrassGroupId greengrassGroupId, String groupVersionId) {
        log.info("Creating a deployment");
        log.info(String.join("", "Group ID [", greengrassGroupId.getGroupId(), "]"));
        log.info(String.join("", "Group version ID [", groupVersionId, "]"));
        String initialDeploymentId = greengrassHelper.createDeployment(greengrassGroupId, groupVersionId);
        log.info(String.join("", "Deployment created [", initialDeploymentId, "]"));
        DeploymentStatus deploymentStatus = getDeploymentStatus(serviceRole, coreRole, greengrassGroupId, groupVersionId, initialDeploymentId);
        if (!DeploymentStatus.SUCCESSFUL.equals(deploymentStatus)) {
            throw new RuntimeException("Deployment failed");
        }
        log.info("Deployment successful");
    }
@ Override public void createAndWaitForDeployment ( Optional < Role > serviceRole , Optional < Role > coreRole , GreengrassGroupId greengrassGroupId , String groupVersionId ) { log . info ( "Creating a deployment" ) ; log . info ( String . join ( "" , "Group ID [" , greengrassGroupId . getGroupId ( ) , "]" ) ) ; log . info ( String . join ( "" , "Group version ID [" , groupVersionId , "]" ) ) ; String initialDeploymentId = greengrassHelper . createDeployment ( greengrassGroupId , groupVersionId ) ; log . info ( String . join ( "" , "Deployment created [" , initialDeploymentId , "]" ) ) ; DeploymentStatus deploymentStatus = getDeploymentStatus ( serviceRole , coreRole , greengrassGroupId , groupVersionId , initialDeploymentId ) ; if ( ! DeploymentStatus . SUCCESSFUL . equals ( deploymentStatus ) ) { throw new RuntimeException ( "Deployment failed" ) ; } log . info ( "Deployment successful" ) ; }
Create a deployment and wait for its status to change
 @param serviceRole
 @param coreRole
 @param greengrassGroupId
 @param groupVersionId
Create a deployment and wait for its status to change @param serviceRole @param coreRole @param greengrassGroupId @param groupVersionId
// Not successful, throw an exception to bail out