How to use the pycfmodel.resolver.resolve function in pycfmodel

To help you get started, we’ve selected a few pycfmodel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_and(function, expected_output):
    parameters = {}
    mappings = {}
    conditions = {}

    assert resolve(function, parameters, mappings, conditions) == expected_output
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_sub_and_ref():
    parameters = {"RootDomainName": "skyscanner.net"}
    mappings = {}
    conditions = {}
    function = {"Fn::Sub": ["www.${Domain}", {"Domain": {"Ref": "RootDomainName"}}]}

    assert resolve(function, parameters, mappings, conditions) == "www.skyscanner.net"
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_select_and_ref():
    parameters = {"DbSubnetIpBlocks": ["10.0.48.0/24", "10.0.112.0/24", "10.0.176.0/24"]}
    mappings = {}
    conditions = {}
    function = {"Fn::Select": ["0", {"Ref": "DbSubnetIpBlocks"}]}

    assert resolve(function, parameters, mappings, conditions) == "10.0.48.0/24"
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_equals(function, expected_output):
    parameters = {}
    mappings = {}
    conditions = {}

    assert resolve(function, parameters, mappings, conditions) == expected_output
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_sub(function, expected_output):
    parameters = {"abc": "ABC"}
    mappings = {}
    conditions = {}

    assert resolve(function, parameters, mappings, conditions) == expected_output
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_join(function, expected_output):
    parameters = {}
    mappings = {}
    conditions = {}

    assert resolve(function, parameters, mappings, conditions) == expected_output
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_base64(function, expected_output):
    parameters = {}
    mappings = {}
    conditions = {}

    assert resolve(function, parameters, mappings, conditions) == expected_output
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_join_and_ref():
    parameters = {"Partition": "patata", "AWS::AccountId": "1234567890"}
    mappings = {}
    conditions = {}
    function = {
        "Fn::Join": ["", ["arn:", {"Ref": "Partition"}, ":s3:::elasticbeanstalk-*-", {"Ref": "AWS::AccountId"}]]
    }
    assert resolve(function, parameters, mappings, conditions) == "arn:patata:s3:::elasticbeanstalk-*-1234567890"
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_find_in_map(function, expected_output):
    parameters = {}
    mappings = {"RegionMap": {"us-east-1": {"HVM64": "ami-0ff8a91507f77f867"}}}
    conditions = {}

    assert resolve(function, parameters, mappings, conditions) == expected_output
github Skyscanner / pycfmodel / tests / test_resolver.py View on Github external
def test_condition(function, expected_output):
    parameters = {}
    mappings = {}
    conditions = {"SomeOtherCondition": True}

    assert resolve(function, parameters, mappings, conditions) == expected_output