@TaskAction private void createVersion() { log.fine("Creating new application version"); AWSElasticBeanstalk client = AWSElasticBeanstalkClientBuilder.standard() .withCredentials(new DefaultAWSCredentialsProviderChain()) .withRegion(awsAppRegion) .build(); client.createApplicationVersion(new CreateApplicationVersionRequest() .withApplicationName(awsAppName) .withVersionLabel(newVersion) .withDescription("") .withSourceBundle(new S3Location() .withS3Bucket(awsAppBucket) .withS3Key(archiveName)) .withProcess(false)); log.fine("Created beanstalk application version for '" + awsAppName + "' with label '" + newVersion + "'"); } }