def _get_cfn_parameters(availability_zone, internet_gateway_id, public_cidr, vpc_id, private_cidr=None):
    """Create cloudformation-compatible stack parameter given the variables."""
    parameters = [
        {"ParameterKey": "AvailabilityZone", "ParameterValue": availability_zone},
        {"ParameterKey": "InternetGatewayId", "ParameterValue": internet_gateway_id},
        {"ParameterKey": "PublicCIDR", "ParameterValue": public_cidr},
        {"ParameterKey": "VpcId", "ParameterValue": vpc_id},
    ]
    if private_cidr:
        parameters.append({"ParameterKey": "PrivateCIDR", "ParameterValue": private_cidr})
    return parameters