def define()

in terranova/commands/binds.py [0:0]


def define(path: str, address: str, identifier: str) -> None:
    """Associate existing infrastructure with a Terraform resource."""
    # Construct resources path
    full_path = SharedContext.resources_dir().joinpath(path)

    # Mount terraform context
    terraform = mount_context(full_path, import_vars=True)

    # Execute import command
    try:
        terraform.define(address, identifier)
    except ErrorReturnCode as err:
        raise Exit(code=err.exit_code) from err