src/main/java/com/digitalglobe/util/maven/plugin/CloudFormationDeployMavenPlugin.java
/**
     * Use this method to process the output parameters.  Use the stack output parameter mapping to determine if an
     * output parameter should be renamed before it is placed into the output parameter array.  The parameter may
     * optionally be store in the AWS System Manager Parameter Store.  There may be more than one mapping for a
     * given parameter.  If a map exist for a parameter that wasn't in the output, it is ignored.
     *
     * @param cfClient is the CloudFormation Client to use.
     * @param stackName is the name of the stack to fetch the output parameters from.
     * @param outputParameters is the array of output parameters to put the parameters into.
     * @param region is the region to store the parameter.
     * @param credentials are the credentials to use when connecting to AWS APIs.
     * @param outputParameterMappings is the mapping to use when determine parameter name and parameter value
     * @param ssmClient is the client to use when updating the parameter store.
     * @throws IOException when the routine is unable to assume a role.
     * @throws MojoExecutionException when a logic or validation error occurs with assuming a role.
     */
Use this method to process the output parameters.  Use the stack output parameter mapping to determine if an
output parameter should be renamed before it is placed into the output parameter array.  The parameter may
optionally be store in the AWS System Manager Parameter Store.  There may be more than one mapping for a
given parameter.  If a map exist for a parameter that wasn't in the output, it is ignored.

@param cfClient is the CloudFormation Client to use.
@param stackName is the name of the stack to fetch the output parameters from.
@param outputParameters is the array of output parameters to put the parameters into.
@param region is the region to store the parameter.
@param credentials are the credentials to use when connecting to AWS APIs.
@param outputParameterMappings is the mapping to use when determine parameter name and parameter value
@param ssmClient is the client to use when updating the parameter store.
@throws IOException when the routine is unable to assume a role.
@throws MojoExecutionException when a logic or validation error occurs with assuming a role.
Use this method to process the output parameters . Use the stack output parameter mapping to determine if an output parameter should be renamed before it is placed into the output parameter array . The parameter may optionally be store in the AWS System Manager Parameter Store . There may be more than one mapping for a given parameter . If a map exist for a parameter that wasn ' t in the output it is ignored . @param cfClient is the CloudFormation Client to use . @param stackName is the name of the stack to fetch the output parameters from . @param outputParameters is the array of output parameters to put the parameters into . @param region is the region to store the parameter . @param credentials are the credentials to use when connecting to AWS APIs . @param outputParameterMappings is the mapping to use when determine parameter name and parameter value @param ssmClient is the client to use when updating the parameter store . @throws IOException when the routine is unable to assume a role . @throws MojoExecutionException when a logic or validation error occurs with assuming a role .
private void processOutputParameters(CloudFormationAsyncClient cfClient, String stackName,
                                         AwsCredentialsProvider credentials, SsmClient ssmClient,
                                         Map<String, String> outputParameters,
                                         StackOutputParameterMapping[] outputParameterMappings, String region)
            throws IOException, MojoExecutionException {
        boolean retry;
        DescribeStacksResponse masterResult = null;
        do {
            try {
                masterResult = cfClient.describeStacks(DescribeStacksRequest.builder().stackName(stackName).build()).get();
                retry = false;
            } catch (Exception ex) {
                retry = isRetry(ex);
            }
        } while(retry);
        if((masterResult != null) && (masterResult.stacks().get(0).outputs().size() > 0)) {
            System.out.println("Output Parameters for " + masterResult.stacks().get(0).stackName() + ":");
            for (Output masterOutput : masterResult.stacks().get(0).outputs()) {
                Boolean mapped = false;
                if (outputParameterMappings != null) {
                    for (StackOutputParameterMapping mapping : outputParameterMappings) {
                        if (masterOutput.outputKey().equals(mapping.parameterName)) {
                            mapped = ProcessMapping(outputParameters, ssmClient, masterOutput.outputKey(),
                                    masterOutput.outputValue(), mapping, region);
                        }
                    }
                }
                if (!mapped) {
                    outputParameters.put(masterOutput.outputKey(), masterOutput.outputValue().trim());
                    System.out.println("DEBUG: Output Parameter: " + masterOutput.outputKey());
                    System.out.println("  With value: " + masterOutput.outputValue());
                    System.out.println();
                }
            }
            System.out.println();
        }
    }
private void processOutputParameters ( CloudFormationAsyncClient cfClient , String stackName , AwsCredentialsProvider credentials , SsmClient ssmClient , Map < String , String > outputParameters , StackOutputParameterMapping [ ] outputParameterMappings , String region ) throws IOException , MojoExecutionException { boolean retry ; DescribeStacksResponse masterResult = null ; do { try { masterResult = cfClient . describeStacks ( DescribeStacksRequest . builder ( ) . stackName ( stackName ) . build ( ) ) . get ( ) ; retry = false ; } catch ( Exception ex ) { retry = isRetry ( ex ) ; } } while ( retry ) ; if ( ( masterResult != null ) && ( masterResult . stacks ( ) . get ( 0 ) . outputs ( ) . size ( ) > 0 ) ) { System . out . println ( "Output Parameters for " + masterResult . stacks ( ) . get ( 0 ) . stackName ( ) + ":" ) ; for ( Output masterOutput : masterResult . stacks ( ) . get ( 0 ) . outputs ( ) ) { Boolean mapped = false ; if ( outputParameterMappings != null ) { for ( StackOutputParameterMapping mapping : outputParameterMappings ) { if ( masterOutput . outputKey ( ) . equals ( mapping . parameterName ) ) { mapped = ProcessMapping ( outputParameters , ssmClient , masterOutput . outputKey ( ) , masterOutput . outputValue ( ) , mapping , region ) ; } } } if ( ! mapped ) { outputParameters . put ( masterOutput . outputKey ( ) , masterOutput . outputValue ( ) . trim ( ) ) ; System . out . println ( "DEBUG: Output Parameter: " + masterOutput . outputKey ( ) ) ; System . out . println ( "  With value: " + masterOutput . outputValue ( ) ) ; System . out . println ( ) ; } } System . out . println ( ) ; } }
Use this method to process the output parameters.
Use this method to process the output parameters .
// For each output parameter, map it and save it. // Map the parameter with all matching rules.  The same parameter may be mapped multiple times. // Default action to save parameters without any mappings or parameters with mapping restrictions.