Example usage for com.amazonaws.services.cloudformation.model Parameter withUsePreviousValue

List of usage examples for com.amazonaws.services.cloudformation.model Parameter withUsePreviousValue

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudformation.model Parameter withUsePreviousValue.

Prototype


public Parameter withUsePreviousValue(Boolean usePreviousValue) 

Source Link

Document

During a stack update, use the existing parameter value that the stack is using for a given parameter key.

Usage

From source file:de.taimos.pipeline.aws.cloudformation.parser.JSONParameterFileParser.java

License:Apache License

@Override
public Collection<Parameter> parseParams(InputStream fileContent) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    JsonNode tree = mapper.readTree(fileContent);
    Collection<Parameter> parameters = new ArrayList<>();
    if (tree instanceof ArrayNode) {
        ArrayNode jsonNodes = (ArrayNode) tree;
        for (JsonNode node : jsonNodes) {
            Parameter param = new Parameter();
            param.withParameterKey(node.get("ParameterKey").asText());
            if (node.has("ParameterValue")) {
                param.withParameterValue(node.get("ParameterValue").asText());
            }//from   w  w w.j a va 2 s  .com
            if (node.has("UsePreviousValue")) {
                param.withUsePreviousValue(node.get("UsePreviousValue").booleanValue());
            }
            parameters.add(param);
        }
    }
    return parameters;
}