All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.maven.plugins.aws.it.AwsProvisionMojo Maven / Gradle / Ivy

package com.atlassian.maven.plugins.aws.it;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import java.io.File;

/**
 * Provisions AWS infrastructure via AWS CloudFormation template.
 * Generates access keys.
 */
@Mojo(name = "provision-aws", defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST)
public class AwsProvisionMojo extends AbstractMojo {

    @Parameter(
            defaultValue = "eu-central-1",
            property = "aws.region"
    )
    private String awsRegion;

    @Parameter(
            defaultValue = "${basedir}/src/resources/cloudformation.template",
            property = "aws.cloudformation.template"
    )
    private File cloudformationTemplate;

    @Parameter(
            defaultValue = "${project.build.directory}",
            readonly = true
    )
    private File buildDirectory;

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        Provisioner provisioner = new Provisioner(awsRegion, cloudformationTemplate, buildDirectory, getLog());
        provisioner.provision();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy